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
Prasanth RPrasanth R 

Patient(grandparent),Caselist(Parent).diagnosis(child)...caselist and patient(field name--patient__c) had a lookup-relationship

In diagnosis object created a field (causes-datatype(picklist)--fever,cough,wheezing. and in patient object created a field is called Reason(datatype-reason):My requirement : if causes is fever,it will pop up on reason as fever,if it cough reason should be cough..i don;t know how to write a code..kindly someone help me.User-added imageUser-added imageUser-added image
PriyaPriya (Salesforce Developers) 

Hi Prasanth,

To achieve this requirement, You can better write the Process Builder on the Child Object (Diagnosis). 

In the Condition, you can define as below :- 
If Cause =Fever 

or 

Cause = Cough

Then in Action you can choose the update record. And update the related Object, here in your case, update the Parent Record's Reason Field as below.

Reason = Text(Diagnosis.Cause)

Please let me know if it work for you by marking it as Best Answer.

Regards,

Priya Ranjan

Prasanth RPrasanth R
hi priya,
     Need to do only with code using trigger