Ask a Question
Ask Question Login
Corporate Training
  1. Community
  2. Salesforce
  3. Question
Salesforce

Why am I getting an error when comparing trigger.oldMap with trigger.newMap on a boolean custom field?

Asked by Dan Peters May 5, 2023 707 views 1 answer
Share

About this question

 I am trying to do a field change comparison in a trigger (trigger.oldMap vs trigger.newMap) on a boolean custom field I have in cases. This causes an incorrect signature error, when I do the exact same thing on other field types like text areas or picklist it works fine.


Is there a reason I can't do it on a boolean, and if so is there a workaround for it, I have tried with trigger.old.get(theField) but that gave the same error?


        case oldStatus = Trigger.oldMap.get(c.Status);                      //picklist field type
        case oldClosedBy = trigger.oldMap.get(c.Case_Closed_by_User__c);    //boolean field type. give error "Method does not exist or incorrect signature: void get(Boolean) from the type Map"
        case oldQueue = Trigger.oldMap.get(c.Case_Queue_Name__c);           //text area field type

Your answer

1 Answer

More Salesforce discussions

Learn & Explore

Free tutorials and interview questions from industry experts — learn the skill, then get ready to prove it.

Latest Salesforce Blogs

Guides, tips and career advice on Salesforce from JanBask experts.