You need to sign in to do that
Don't have an account?
The_Fox
Date Calculation with Sforce.Util
Hello,
I have a date A, and I have a new date B and I would like to calculate the Diff between the two dates (B- A) (the diff could possibly be negative) and apply the diff to another date C so that new C= C+ (B-A).
All dates are converted first in ISO format if it can help
Second point I want to update different sforce objects can I pass something like updateObjects (Objects X; Objects Y; Objects Z) or I need to make updateObjects(Objects X), updateObjects(Objects Y)...
Thanks for your help
Cheers
I have a date A, and I have a new date B and I would like to calculate the Diff between the two dates (B- A) (the diff could possibly be negative) and apply the diff to another date C so that new C= C+ (B-A).
All dates are converted first in ISO format if it can help
Second point I want to update different sforce objects can I pass something like updateObjects (Objects X; Objects Y; Objects Z) or I need to make updateObjects(Objects X), updateObjects(Objects Y)...
Thanks for your help
Cheers
if you hava a opportunity, for example, oppourtunity.get("CloseDate") will return a Date Object.
If you want to store a Date you can use var mydate = new Date(), etc, etc and finally myObject.set("myDateFieldname", mydate)
to get the servertime into a date object
var sts = sforceClient.GetServerTimestamp().timeStamp;
In order to update differents kind of objects, the AJAX Tookit Documentation says:
..."
Update
Performs an update operation operation
Parameters:
objects
- An array of sobjects to update, must be of the same object type.callback
- A pointer to a function to be called once the http request has returned.async
- A flag to indicate that the call should be made asynchronously or not. A value of true will cause the method to return immediately and once a response is recieved, the callback function will be invoked and passed the results of the call."...