0

I have a query for a JS button:

ccid = sforce.connection.query("Select Id, Account__c from CCI__C Where IsActive__c = True AND Account__c ='" +AccountId+ "'");

It is working fine. Now I want to add ORDER BY LastModifiedDate DESC LIMIT 1 to above query. I tried:

ccid = sforce.connection.query("Select Id, Account__c from CCI__C Where IsActive__c = True AND Account__c ='" +AccountId+ "' + "ORDER BY LastModifiedDate DESC LIMIT 1"");

But it gives an error when button is clicked:

missing ) after argument list.

Can someone help me on this? Also it will be great, if a documentation/link can be provided for constructing these queries with the correct format.

0

You could try like:

ccid = sforce.connection.query("Select Id, Account__c from CCI__C Where IsActive__c = True AND Account__c ='" +AccountId+ "'ORDER BY LastModifiedDate DESC LIMIT 1");

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.