• jwoodall1
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 3
    Replies
I am having issues with using the remote objects retrieve method to filter an object using dates.  I can't figure out what format the remote objects method wants for the date.  It looks like it is using SOQL in the error message and I can get SOQL to work on this field by using the date formatted as 2015-09-23.  
 
var d = new Date();
d = d.format('yyyy-mm-dd');
coupon.retrieve({where:{Start_Date__c:{lte:d}}}, function(err,c) {
           console.log(err);
});
Error: Error occurred while performing RETRIEVE operation on sobject: Coupon__c with data: {where={Start_Date__c={lte=2015-09-23}}} (INVALID_FIELD: 
start_date__c FROM Coupon__c WHERE Start_Date__c <= '2015-09-23' LIMIT
                                   ^
ERROR at Row:1:Column:89
value of filter criterion for field 'Start_Date__c' must be of type date and should not be enclosed in quotes)


It looks like the remote call is putting the single quotes in ('), but I don't have it in my call.
 
I am trying to use javascript remote objects and can't find a way to filter on a multi picklist.  In SOQL, it would be an INCLUDES statement, but I don't think you can use includes in remote objects. Does anyone have an example of setting a multi select picklist value in a where clause in remote objects.
 
coupons.retrieve({limit: 100, where: {Brands__c: {includes: ('brand1','brand2')}}, orderby:[{Name: 'ASC'}]}, function(err, couponRecords){
//process records
}

//Brands__c is a multi select picklist

 
I am trying to use javascript remote objects and can't find a way to filter on a multi picklist.  In SOQL, it would be an INCLUDES statement, but I don't think you can use includes in remote objects. Does anyone have an example of setting a multi select picklist value in a where clause in remote objects.
 
coupons.retrieve({limit: 100, where: {Brands__c: {includes: ('brand1','brand2')}}, orderby:[{Name: 'ASC'}]}, function(err, couponRecords){
//process records
}

//Brands__c is a multi select picklist

 

With the new API 20.0 version, seems like we get access to photos using SmallPhotoUrl and FullPhotoUrl, but seems like i need to have my salesforce session while accessing these images.

 

I have 2 requirements:

 

1. Way to download the image (get Image method)

2. Or an external shared image which can be accessed without salesforce session,

 

Is it possible with new API 20?