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
Jonny.KatesJonny.Kates 

Updating a Lookup value

Hi guys - this appears like it's a reasonable well documented problem but I'm still struggling here...

 

We have a web-to-case form on our website that asks users about their company. Most of these questions are new to our database, in that they don't appear on the existing Account record for the user's company. However a handful of them - such as their registered company number - overlap with existing fields on their Account. It's not possible to put the Lookup field in to the self-service form so I'm left with a situation where I have both Case.Registered_name__c being fed by the web form and a Lookup to the existing value on the related Account: Case.Account_RegisteredName__c.

 

It's not possible to create Workflow to update the Lookup if there's a conflict so I'm going to have to write a Trigger for it. At the moment I'm making do with an email alert to myself and then manual resolve.

 

Ideally, in lehman's terms...I would like both fields to effectively be synonymous. If the Registered Name value is updated on the Account, update it on the Case. If it's updated (/inserted) on the related Case then update the Account value.

 

More than acceptable...if the value on create or edit new case does not equal that of the 'duplicate' Lookup value, then update the Lookup value.

 

Thanks in advance,

Jonny