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
Prakhyat sapraPrakhyat sapra 

I have 2 custom field in lead 1 is of text type & 2nd one is of lookup with lead. so when we create the lead & we filll th text in the 1st text type field & save the lead & again do the same & give the id of the that above lead record so that text field

I have 2 custom field in lead 1 is of text type & 2nd one is of lookup with lead. so when we create the lead & we filll th text in the 1st text type field & save the lead & again do the same & give the id of the that above lead record so that text field data of the above lead record will also show in the another lead record ???? plz. help me to work on this 
Jaya Karthik  karnatiJaya Karthik karnati
Hi Prakhyat,

Can you please elaborate more on your requirement. because when you want to populate the text field read or after creating the 2nd lead . 
After creating the 2nd lead :
If we want to populate the text field after creation of 2nd lead , we can simply use a formula field.
The formula field would be reffering to text field of 1st lead.

Hope this helps.

Thanks,
Karthik
Prakhyat sapraPrakhyat sapra
can you help me by providing the code...??
Jaya Karthik  karnatiJaya Karthik karnati
Hello prakhyat,

PFB the way you can build via Formula
  • Relation Field Name : Parent Lead (Parent_Lead__c)
  • Text feild (input ) : New Text (New_Text__c)
  • Formula field (display and relation) : New Text ( New_Text_Formula__c )
Formula :
IF(ISBLANK(Parent_Lead__c ) , New_Text__c , Parent_Lead__r.New_Text__c)


Other way is using the same field ( New Text field ) to store parent lead and child lead text data .you can acheive via trigger .

trigger logic :
trigger CopyTextField on Lead (before insert, before update) {

for(Lead ld:Trigger.New){
    if(ld.Parent_Lead__c != null && ld.New_Text__c == null){
        ld.New_Text__c = ld.Parent_Lead__r.New_Text__c;
        }
    }
}

Hope it help , if so kindly mark it as best answer.

Thanks,
karthik