+ Start a Discussion
Juan Rafael Motta Velasco 4Juan Rafael Motta Velasco 4 

How can I populate a master-detail field ?

Hello, good morning everyone.

Could you help? I created a field related to the account object and I want to fill in autometico when creating a record by Dataloader, the CSV file only contains the customer number, but not the account name (Account)

I have tried to populate that field by Process Builder, but I do not start as, the other option is to do a trigger, which as soon as the CSV is loaded, it will be triggered and compare "Customer Number" of my custom object against "Client Number" (Accounts) and if it is the same, fill in the field Master-detail, in my custom object. Do you have any idea how to do this trigger?

Look out for comments.User-added image
Shashikant SharmaShashikant Sharma
Hi Juan,

There are two ways for you here:

1. If it is one time load then you could easily use VLookup functiona of excel and use it to map salesforce Account Ids load the data.
a .Export All Accounts with Number and Id
b. In your csv create new column for AccountId and use VLookup function to populate it from Number
c. Upload the modfied csv

2. Before insert trigger on Account, you could start with these and ask questions as you face issues.