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
KR_ForceKR_Force 

Custome Field is not getting updated


Hi, in below method  Ultimate_Parent_Revenue__c field is getting updated fine but  the "Ultimate_Parent_Vertical__c" field is not getting updated at all . i see the value coming in for 'Parent.OS_Industry_Sector__c' but its not refelecting on "Ultimate_Parent_Vertical__c". can someone please into it and help to fix the issue?
  1. for(Account a: uChild)
  2.                {
  3.                 //Account uParent = uChildMap.get(a.id);
  4.                 //System.debug('Parent ID**:'+ a.ParentId);
  5.                 if (a.ParentId ==null){
  6.                 System.debug('Condition 6**:');
  7.                     a.Ultimate_Parent_Vertical__c = a.OS_Industry_Sector__c;
  8.                     a.Ultimate_Parent_Revenue__c = a.AnnualRevenue;
  9.                    // uChild1.add(a);
  10.                     }
  11.                 else if (a.Parent.ParentId ==null){
  12.                 System.debug('Condition 7**:'+a.Parent.OS_Industry_Sector__c+a.Parent.AnnualRevenue);
  13.                    a.Ultimate_Parent_Vertical__c = a.Parent.OS_Industry_Sector__c;
  14.                          a.Ultimate_Parent_Revenue__c = a.Parent.AnnualRevenue;
  15.                           //uChild1.add(a);
  16.                          }
  17.                 else if (a.Parent.Parent.ParentId ==null){
  18.                 System.debug('Condition 8**:');
  19.                          a.Ultimate_Parent_Vertical__c = a.Parent.Parent.OS_Industry_Sector__c;
  20.                          a.Ultimate_Parent_Revenue__c = a.Parent.Parent.AnnualRevenue;
  21.                          //uChild1.add(a);
  22.                          }
  23.                 else if (a.Parent.Parent.Parent.ParentId ==null){
  24.                 System.debug('Condition 9**:');
  25.                          a.Ultimate_Parent_Vertical__c = a.Parent.Parent.Parent.OS_Industry_Sector__c;
  26.                          a.Ultimate_Parent_Revenue__c = a.Parent.Parent.Parent.AnnualRevenue;
  27.                           //uChild1.add(a);
  28.                          }
  29.                 else if (a.Parent.Parent.Parent.Parent.ParentId ==null){
  30.                 System.debug('Condition 10**:');
  31.                          a.Ultimate_Parent_Vertical__c = a.Parent.Parent.Parent.Parent.OS_Industry_Sector__c;
  32.                          a.Ultimate_Parent_Revenue__c = a.Parent.Parent.Parent.Parent.AnnualRevenue;
  33.                          //uChild1.add(a);
  34.                          }
  35.                }
  36.                Update uChild;
  37.                }
Vamsi KrishnaVamsi Krishna
can you check the field level security of the Ultimate_Parent_Vertical__c field and see if it has write access setup properly ?