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
Akshay MhetreAkshay Mhetre 

Sub Stage field is not changing...Please Help

Hello

I have a requirmnet, When user click Risk Rafer button,RCU Sub Stage is getting select as RCU Completion - Fresh....Now when user clicking  on submit button (Completion_Submit__c), RCU Sub Stage field should change from RCU Completion - Fresh to 'UW Confirmation Awaited'.

But its not changing to  'UW Confirmation Awaited'..its remaining as it is (RCU Completion - Fresh).

My Code--

 if(oldMap.get(caseRecord.Id).RCU_completion_Status__c != caseRecord.RCU_completion_Status__c
                   && caseMap.get('RCU Completion') == caseRecord.RecordTypeId) {
                       caseRecord.RCU_Completion_date__c = System.now();
                       if(caseRecord.RCU_completion_Status__c == 'Risk Refer'  && oldMap.get(caseRecord.Id).Completion_Submit__c != caseRecord.Completion_Submit__c ) {
                           caseRecord.RCU_Sub_Stage__c = 'UW Confirmation Awaited'; 
                            
                       }
                   }

 

User-added image

AbhinavAbhinav (Salesforce Developers) 
Hi Akshay,

In this scenario check by adding debug log whether your if condition is getting true or not

or if your caseRecord is queried data than you will have to use update dml statement for that  .

If it help mark it as best answer.

Thanks!