You need to sign in to do that
Don't have an account?
Stavros McGillicuddy
Delete query runs from Developer Console, Unexpected Identifier error from button
Why can I get this to run in the Developer Console but not from a custom button?
I get an unexpected identifier error
I get an unexpected identifier error
{!REQUIRESCRIPT("/soap/ajax/32.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/32.0/apex.js")} OpportunityLineItem opp=[Select OpportunityID From OpportunityLineItem WHERE OpportunityId = '0063300000iu2IC']; delete opp; sforce.connection.update([record]); window.location.reload();
use var opp=sforce.connection.query("Select .. from...");
refer this link: https://developer.salesforce.com/docs/atlas.en-us.ajax.meta/ajax/sforce_api_ajax_more_samples.htm