xrmquery.update -> update crm date field - datetime

I'm writing a custom typescript page for a scan module.
When a code is scanned a datetime field on a CRM record needs to be updated.
Here is my code:
XrmQuery.update(x => x.cgk_bonuses,
this.bonusId(),
{ cgk_datescan: new Date() })
.execute(id => { });
Does anyone know what I'm doing wrong for updating a datetime field?
Update other fields works fine.

It looks like you have found a bug in relation to updating Date and Time fields in CRM through XrmQuery.
I have created an issue for us to follow up on this:
XrmQuery: Debug sending dates to CRM

This issue has now been fixed in version 2.3.7
https://www.nuget.org/packages/Delegate.XrmDefinitelyTyped/

Related

Drupal 7 views of type Services fetches incomplete data

I have created a Service View using views module, where I have a field body of which the formatted as services raw. It is only showing me the first character in the body string (eg: if body string is "All men must die", It shows "A") shown as folling:
I wanted to get the complete text from the field body.
This is also happening if I have an entity reference field where formatter is set to Entity id, It gives me only the first digit of Entity uid (eg: if uid is 16, It shows 1)
Please help
I'm guessing you are using PHP 7.1
There's a known issue with the Services Views module; and seems like a fix has been committed to 7.x-1.x-dev branch on December 1, 2017.
I'd recommend reading through the issue #2910966
https://www.drupal.org/project/services_views/issues/2910966
Then, you will have to upgrade to the development branch to fix the issue you are having.
Make sure to backup your files and database before upgrading the module code.

SuiteScript 2.0 Intellisense create search filter

I'm just starting out with suitescript, and I was wondering how to get the intellisense to work in suitescript 2.0 on creating a saved search.
I know this is easy to do on the netsuite UI but I would like to learn how to do it in Suitescript. Here is example code below. I'm trying to use ctrl + space to show options on the Customer type. I've tried adding ['N/record'] and it gave me options on records.Type.(here were the options) but I can't get it to give me anything inside the filter single quotes.
define(['N/search'],
function(search) {
var MYsearch = search.create({
type: search.Type.CUSTOMER,
title: 'My Customer search',
filters: ['', '', ''] // here is where i want intellisense
})
as a side question: Does anyone know a good place for suitescript 2.0 questions and answers? stackoverflow seems to be lacking. I'm assuming because it's pretty much brand new.
(I know of all the tutorials on the help center and SuiteAnswers)
Thanks for the help!
UPDATE: It looks like Netsuite 2.0 doesn't like Internal IDs... hope that helps.
I usually just create an array for filters, and another for columns, then add my filters to that array like sovar arrFilters = [];
arrFilters.push(search.createFilter({
name: 'mainline',
operator: search.Operator.IS,
values: ['F']
}));
arrFilters.push(search.createFilter({
name: 'trandate',
operator: search.Operator.WITHIN,
values: 'lastMonth',
}));
var arrColumns = [];
// invoiceid
arrColumns.push(search.createColumn({
name: 'internalid',
join: 'appliedtotransaction'
}));
Then you can just use your
search.create({
type: search.Type.VENDOR_PAYMENT,
filters: arrFilters,
columns: arrColumns
});
Hope this helps.
Download the latest SuiteCloud Developer IDE or the Eclipse Mars version (just make sure you have downloaded SuiteCloud plugin SuiteCloud IDE - http://system.netsuite.com/download/ide/update_e4). With this IDE, you will be able to have API code assist for SuiteScript 1.0. However, there is other setup to enable it for SuiteScript 2.0. Also, this will enable you to have intellesense for native fields.
Then if you want to include custom fields/columns, setup your master password at main menu >Netsuite>Master Password>.
Get the list of your accounts from the production, sandbox, and beta environment. Do this at main menu >Netsuite>Manage Account>. If you will be added to a new customer account later, you need to add it manually by doing this step again to reflect it.
Now, you need to connect your project folder to NetSuite account. But first, check the project setting by right clicking to the project folder>NetSuite>Change Project Settings>. Then, make sure you will be using the correct account.
Then log-in to the account by right clicking the project folder >NetSuite>Log in to Project Account>. Once successfully logged-in.
Finally, right click again the project folder >NetSuite>Sync Script IDs from Account>. Follow the instructions and select record type and fields.

set alfresco dateTextBox to empty

I want to set an empty value for Alfresco Aikau DateTextBox widget.
But the date is being set to "1970/1/1" automatically. How can i set a date to empty in Aikau ?
I'm trying this code in the jsonModel but it's not working:
{
name:"alfresco/forms/controls/DateTextBox",
widthPx:"90",
config:{
fieldId:"DATE_1",
additionalCssClasses:"datefield",
name:"Date1",
value:"",
requirementConfig:{
initialValue:false
}
}
}
What version of Aikau are you using? We've made a number of changes to the alfresco/forms/controls/DateTextBox widget since it was first created. If the problem still persists in the latest version (which at the time of writing is v1.0.57) then you should raise a JIRA ticket or GitHub issue. There is a new release of Aikau each week and they are all backwards compatible so you should be able to take advantage of bugs fixes as soon as they are available. All bugs are prioritized ahead of features as the intention is that there should be no technical debt on the Aikau project. See this blog post for information on how to use new Aikau releases.
I am not sure regarding why it is not working with existing alfresco/forms/controls/DojoDateTextBox widget.I did following,for making it work.
1.I have created a new widget,Placed below content in the file.(This content is copied from existing widget)
define(["dojo/_base/declare",
"alfresco/forms/controls/DateTextBox"],
function(declare, DateTextBox) {
return declare([DateTextBox], {});
});
2.Used that widget by using following.
name : "js/Demo/MyCustomWidget",//It is the path of my custom widget.
widthPx: "90",
config :
{
fieldId : "DATE_1",
additionalCssClasses: "datefield",
name : "Date1",
value : undefined,//This must be undefined,neight null nor ""
requirementConfig:
{
initialValue: false
}
}
In case of aikau control,you can find source code inside tomcat\webapps\share\WEB-INF\lib\aikau-1.0.8.1.jar.Version of aikau jar file may differ depends on your alfresco version.

Fullcalendar shows wrong day in month view

I'm using Fullcalendar within a Asp.Net project and I'm using the function 'events' to refresh items in my calendar.
I'm putting events in myArray to pass it in the callback function as below:
var event = {
title: 'Disponível',
start: moment(horario.DtInicio),
end: moment(horario.DtFim),
}
myArray.push(event);
where horario.DtInicio and horario.DtFim is a Asp.Net json Date (eg. "/Date(1423321200000)/")
When I show callendar in month view, this date shows in 02/06/2015 (mm/dd/yyyy), but when I toggle to other view, this event shows in 02/07/2015. The real date is 02/07/2015.
Has anyone faced this situation?
Try to set the timezone for the calendar:
$('#calendar').fullcalendar({
timezone : 'local',
...
});
As RodrigoDela suggested, try setting your timezone. If that does not help, then try what worked for me.
Setting the timezone alone to "local" did not fix the issue for me. Updating moment.js from 2.8.3 to 2.8.4 did fix the issue.
For reference, I am running the following versions of FullCalendar and its dependencies:
FullCalendar 2.2.6
jQuery 2.1.3
jQuery UI 1.10.4
moment.js 2.8.4
Additional details regarding my debugging process and fix here.

How to get the correct LastModifiedDate from SPFile in SP2013

I've got a Issue with SharePoint 2013 Files in Libraries. If I push an File via WebDAV into an Folder the file will still hold it's created/modified date (and that's good!).
Other Case is: I use the "New Document" Upload Form - the File will be newly created and loses its correct created/modified date.
I'm looking for a way to get these correct Values of the SPFile Item.
DateTime modified = Li.File.TimeLastModified;
That's my current attempt to get the DateTime but it only retrieves the "sharepoint" value and not the "filesystem" value of the LastModifiedDate.
I tried to let my Webpart open the File on the server.. but URI-Formats arent supported :-(
Has anybody already run into this problem?
Thanks for your help in advance!
EDIT:
This is what I get in explorer view of the document library. For example the file lync.PNG has a last modified date of 26.12.2013.
this is what I get from my webpart using the code snippet (sorry for the german description; "geändert am" means lastmodifieddate)
You can get the modified date that SharePoint uses by getting the Item of the SPFile then reading the date property. Something like this:
DateTime date = DateTime.Parse(file.Item["Modified"].ToString());
Once its in SharePoint any changes should come from the modified property of the item. You would have to use an event receiver to capture the original file date and then overwrite the SharePoint created date, or add the value to another field in the item.
Hope this helps.

Resources