+ Start a Discussion
Devendra Hirulkar 3Devendra Hirulkar 3 

trigger to copy parent obj to child

trigger to copy parent obj to child
hello friends i want trigger to copy parent obj to child only when the field type us user group
i have 3 obj  account , product and subscrations
by this trigger in subscration there is 3 field type like elearning , digital learning and user group  by this trigger if we select field type user group then only it   match account  name if match then put product  name into account
here account and product are lookup into subscration  when we chose  user group field type in subscration it match account  name like account name is devendra then  when we put  product name in substraction  then it automatcally put that product name into account
thanks
devendra
SonamSonam (Salesforce Developers) 
If I understand your issue correctly:  you have 3 objects, Account, Product and  subscrations(not sure of the spelling) and you have lookup fields on subscrations for Account and product.There are 3 custom fields : elearning , digital learning and user group and you want the following updates: when you update the user group field, the account field should be updated if the name matches and the product related to account should also be updated.

As mentioned above that you are trying to update lookup fields on your custom object, you will have to create a trigger on subscrations object.

sample code to update lookup on the thread on the link below:
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000AY2oIAG