You need to sign in to do that
Don't have an account?
smriti sharan19
When a opportunity is created then billing address of accounts should get updated into the opportunity?
When a opportunity is created then billing address of accounts should get updated into the opportunity?
I have created a custom field on opportunity object BilingAddress__c. Now i want that whenever i create a new opportunity then the billing field on opportunity gets updated with the BillingAddress field of account.
Step 1: Trigger will be created on Opportunity object
Step 2. We will use after insert as it is based on two objects.
Can you give me code for this.
I have created a custom field on opportunity object BilingAddress__c. Now i want that whenever i create a new opportunity then the billing field on opportunity gets updated with the BillingAddress field of account.
Step 1: Trigger will be created on Opportunity object
Step 2. We will use after insert as it is based on two objects.
Can you give me code for this.
Here is the trigger for you
All Answers
Here is the trigger for you
Workflow, process builder, formula field, flow,trigger. Which is the best way to do it?
It throws error - Error: Compile Error: Invalid type: ids at line 10 column 3
try this code
Hi I am getting this error.
BilingAddress__c is a custom field in contact
BillingAddress is standard field in account
I am not sure why we wanted to go through the hassle of Trigger, Process Builder etc. when we can achieve this through a simple formula field. Convert your BillingAddress__c Field to Formula Field like mentioned below. This way as soon as you create an opportunity with Acccount tie to ti this field will automatically get populated with the Account Billing Address if defined. Also the beauty of this if there is any change on the Account level you will see the same here.
Here is the code if it is not clear in the image
Please explain me the need of trigger for my knowledge otherwise I see it a best solution. Thanks.