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
sd2008sd2008 

Unexpected Token Trigger Error, please Help

trigger WebUserClientIDTrigger on Web_User__c (before insert) {

 for(Web_User__c w: Trigger.New){

     if (w.Account_Name__c <> ''){

       string tempid = w.Account_Name__c;

       w.ClientID__c = [Select ClientID__c from Account where id = tempid].ClientID__c;

      }

   }

}

 

It returns "Unexpected Token tempID"

What did I do wrong?

Best Answer chosen by Admin (Salesforce Developers) 
SuperfellSuperfell

You're missing the colon that specifies its bind variable.

 

where id = tempid]

 

should be

 

where id = :tempid]

All Answers

SuperfellSuperfell

You're missing the colon that specifies its bind variable.

 

where id = tempid]

 

should be

 

where id = :tempid]

This was selected as the best answer
sd2008sd2008

thanks