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
Ed055Ed055 

Account Lookup field on contact not saving

I'm trying to show all contacts related to child accounts at parent account level. I created a custom account lookup field on contact. When I try to add or edit a contact and select the name of my parent account in the custom lookup field, it does not save. Not sure what is going on. Any suggestions

Thanks for help.
 
Pankaj_GanwaniPankaj_Ganwani
Hi,

Is there any error message you are experiencing on click of the save button?
Ed055Ed055
No error messages. Puzzling part is .. I made this lookup required field just to what happens. Even whn I enter value in this field it is giving me "Required value" error.
 
Pankaj_GanwaniPankaj_Ganwani
Hi,

Can you please check validation rules on this object, may be they would be causing this?
Ed055Ed055
There are no validation rules. All other field updates gets saved.
Pankaj_GanwaniPankaj_Ganwani
Hi,

Can you please execute the below mentioned code statement from developer console:
insert new Contact(LastName = 'Test contact', parentObjectAPIName = Id);

Replace parentObjectAPIName with your field api name and assign the Id of the Parent Account.
Ed055Ed055
I tried to execude below code

insert new Contact(LastName = 'Test branch contact1',AccountId='001c000000ioL9g',  Firm_Account__c = '001c000000ioL9M');

Im getting below error

ystem.DmlException: Insert failed. First exception on row 0; first error: REQUIRED_FIELD_MISSING, Required fields are missing: [Firm_Account__c]: [Firm_Account__c]


 
Ed055Ed055
forgot to mention in my last message ... Firm_Account__c is the custom account lookup field that I mentioned earlier. Thanks.
Pankaj_GanwaniPankaj_Ganwani
Hi,

It seems the problem is coming at the configuration level not at the UI level. Can you please check if there is any trigger on Contact object which sets the value of Firm_Account__c field value back to blank. If so, just deactivate that trigger and then try?
Ed055Ed055
Pankaj , I just created field Firm_Account__c today and I can confirm there are no triggers or workflow rule that sets it to blank. No idea what is going on with this field.
Julian Juez Alfaro 5Julian Juez Alfaro 5
Would this help? https://success.salesforce.com/answers?id=90630000000gxJ7AAI