• Brannonk
  • NEWBIE
  • 10 Points
  • Member since 2014
  • Business Operations Manager

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 2
    Replies
I have been trying to use the new Visualforce Object for some basic javascript functions, but have a tough time using a retrieve with a date clause.

example sniplet :
var c = new SObjectModel.Campaign(); c.retrieve(function(){return({ limit : 100, where: {StartDate: { gt: '2014-12-31' }}});}, function (err, records) { if (err) { console.log(err); } else {


I have formatted the date in miliseconds, utc string (2014-12-31T23:59:59Z), and a few others. So far always get ther error:
"Error: Error occurred while performing RETRIEVE operation on sobject: Campaign with data: {limit=100, where={StartDate={gt=2014-12-31}}} (INVALID_FIELD: type, id FROM Campaign WHERE StartDate > '2014-12-31' LIMIT 100 ^ ERROR at Row:1:Column:81 value of filter criterion for field 'StartDate' must be of type date and should not be enclosed in quotes)"

I have tried it for other objects that have DateTime formats ( ie CreatedDate ) wit the same problems.
Has anyone solved this? Maybe us moment.js to set a specific format?

Thanks for your help!
 
I want to try to bulkify a headless flow using an apex batch job to call it every hour, but I can't find anything on how to write a test class for a batch that only calls a flow. Has anyone tried to do this? Are there any gotchas you ran into with the flow?
I have been trying to use the new Visualforce Object for some basic javascript functions, but have a tough time using a retrieve with a date clause.

example sniplet :
var c = new SObjectModel.Campaign(); c.retrieve(function(){return({ limit : 100, where: {StartDate: { gt: '2014-12-31' }}});}, function (err, records) { if (err) { console.log(err); } else {


I have formatted the date in miliseconds, utc string (2014-12-31T23:59:59Z), and a few others. So far always get ther error:
"Error: Error occurred while performing RETRIEVE operation on sobject: Campaign with data: {limit=100, where={StartDate={gt=2014-12-31}}} (INVALID_FIELD: type, id FROM Campaign WHERE StartDate > '2014-12-31' LIMIT 100 ^ ERROR at Row:1:Column:81 value of filter criterion for field 'StartDate' must be of type date and should not be enclosed in quotes)"

I have tried it for other objects that have DateTime formats ( ie CreatedDate ) wit the same problems.
Has anyone solved this? Maybe us moment.js to set a specific format?

Thanks for your help!