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
Bill ButtonBill Button 

How to check an ID field

How do you check an ID field is not blank, I get an exception error 'invalid id' on the following for the if statement.
 
Assignment__c AssignThis = [select Area_Account_Manager__c,Reseller__c from Assignment__c where Country__c = :a.Country and Region__C = :a.State];
SendEmail = 1;
a.OwnerId = AssignThis.Area_Account_Manager__c;
if (AssignThis.Reseller__c <> '') {
    a.Reseller__C = AssignThis.Reseller__C;
    SendToReseller = 1;
}

 
 
Ron HessRon Hess
i think you can test this field against null

if (AssignThis.Reseller__c != null ) {


Bill ButtonBill Button

Hi Ron,

Thanks this worked great, I really appreciate the help.

Bill