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

Populating Lookup to Parent



Is the following possible?


I have create a new custom object (let's call it custom__c).

This holds records that I want a case to be related to, if the case meets a certain criteria. I want to automatically populate the look up field on the case. Is this possible? and how would I do this without hardcoding the record id's?




if case_region__c = 'x'

& case__date__c = 'y'

custom__r /custom__c = record id of parent record to relate.


Many thanks, as always.



Anu Raj.ax1269Anu Raj.ax1269

you can you custom setting.


Thanks Anu.


How would I write the above trigger with the custom setting?






Thanks again,


Alot of this is new to me, so I'm struggling to understand these references.



Anu Raj.ax1269Anu Raj.ax1269

you asked to hardcord some value. But after hardcord if it is need to be changed after some period of time then again we need to touch the code, so with out touching the code it is a simple way to create a custom setting and add value to it so the the clint it self can make changes. 

refer :

Does it make sence.





I think I understand Anu,


In the custom setting do I include the record ID's of the object I want to map too?


Thanks for your help

Anu Raj.ax1269Anu Raj.ax1269

yes it is possible.