function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
falfadlifalfadli 

Looking for how to properly use the Execute Anonymous feature in the IDE

Hi all,

 

easy question.....I have writtent the following web service...

 

global class UwCheckList {

 

webService static boolean getRegion(id opportunityId){

 

boolean oppExistInCw = false;

//query UW_CheckList Object to search for related opportunity

UW_Checklist__c aUW_Checklist = [Select Id, UW_Activity_Status__c from UW_checklist__c where Opportunity__c= :opportunityId LIMIT 1];

 if(aUW_Checklist!=null) {

//update status field

aUW_Checklist.UW_Activity_Status__c = 'Ready to Rate'; update aUW_Checklist;

oppExistInCw = true;

return oppExistInCw;

}

else {

return oppExistInCw;

}

 

 

}

}

 

I was trying to find some simple example syntax that I could use in the Execute Anonymous area of the IDE to test htis out. Can anyone provide an example I could reference?

 

Thanks

Best Answer chosen by Admin (Salesforce Developers) 
JimRaeJimRae

you should be able to call it like this:

 

 

string OppID='xxxxx'; //insert your test id here Boolean Result = UwCheckList.getRegion(OppID); System.debug('\n\nREsult was '+Result);

 

 

 

All Answers

JimRaeJimRae

you should be able to call it like this:

 

 

string OppID='xxxxx'; //insert your test id here Boolean Result = UwCheckList.getRegion(OppID); System.debug('\n\nREsult was '+Result);

 

 

 

This was selected as the best answer
falfadlifalfadli

Thanks Jim!

 

Worked like a charm!