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
harsha vardhan vasa 9harsha vardhan vasa 9 

i am invoking below code from process builder, in line update surveyInvt; where i am trying to update surveyinvitation,record updation is proper in logs but when i checked in UI its not updating.

below is the code snippet: 
i can see in the logs value is getting updated but in UI its nor reflecting.
f(ObjID.getSObjectType().getDescribe().getName()=='EVSH_application__c')
            {
                EVSH_application__c evsh=[Select Id, Name, CC_Rep_EI__c, CC_Rep_EI__r.FirstName, CC_Rep_EI__r.Email, 
                                          Application_Type_EI__c ,Customer_Contact_EI__r.FirstName,
                                          Customer_Contact_EI__r.LastName, (select id, Name from Project_Deliveries__r)
                                          from EVSH_application__c where Id=:subject.SubjectId];
                system.debug('@@@evsh-->'+evsh.Id);
                
                if(('FLEET'.equals(evsh.Application_Type_EI__c)||'DCFC'.equals(evsh.Application_Type_EI__c)||
                  'SCHOOL'.equals(evsh.Application_Type_EI__c)||'PARK'.equals(evsh.Application_Type_EI__c)) && 
                  (evsh.Project_Deliveries__r.size() == 0))
                {
                    String SurveyInvtRecTypeId=[select Id from RecordType where Name = 'EVSH Fleet Survey' and SobjectType = 'SurveyInvitation'].Id;
                    surveyInvt.RecordTypeId=SurveyInvtRecTypeId;
                    String surveyInvtName=''+evsh.Name+'_'+evsh.Customer_Contact_EI__r.FirstName+'_'+evsh.Customer_Contact_EI__r.LastName+'_'+dt.format();
                    surveyInvt.Name=surveyInvtName;
                    system.debug('name is '+surveyInvt.Name);
                    if(evsh.CC_Rep_EI__c!=null||evsh.CC_Rep_EI__c!='')// To avoid lookup field error
                    {
                        system.debug('@@@CC_Rep_EI__c : '+evsh.CC_Rep_EI__r.FirstName+' & '+evsh.CC_Rep_EI__r.Email);
                        surveyInvt.EV_Fleet_sales_rep_first_name_EI__c=evsh.CC_Rep_EI__r.FirstName;
                        surveyInvt.EV_Fleet_sales_rep_email_EI__c=evsh.CC_Rep_EI__r.Email;
                    }
                    surveyInvt.EV_Site_Host_EI__c=evsh.Id;
                    update surveyInvt;
                   
                }
            }

 
SwethaSwetha (Salesforce Developers) 
HI Harsha,
Is there any other process that is executing after this code that is possibly reverting the changes?

Order of execution: https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_triggers_order_of_execution.htm

Thanks