I'd like to pre-populate a quick-create form of opportunity using the values of its parent Account record.
I read some articles but still not very clear.
I am thinking of doing this way: Writing a function in Onload() event of the quick create form. But how can I retrieve field values from its parent record?
When you create task from opportunity or account by default system will prepopulate regarding filed. System activity entities does not support mapping.
You got the AccountId from the Task Quick Create Form, right?
Then, you can do query, using query agains AccountSet OData Table, using the AccountId as a filter, you can get all of the fields value and information you need from Account.
Better, you use REST.
And download the OData Query Designer to help the development.
Hope it helps!
There is no need to write any code to populate some field values from parent record. All you have to do is mapping filed values from account to opportunity .
Go to customization and select account as below.
Double click the relationshipt and it will open new window like below. from here click on new button to add mapping between account field and opportunity field. You can as many field mapping you want.
Thank you! I got it.
The mapping relationship works well for Opportunity. However, "Task" is not supported.
If I want to prepopulate the regarding field when creating a new Task. Shall I get the Account ID from the URL? How am I able to do this?
We are not using the social panel now. The reason is social panel can only display few fields of Tasks or Phonecalls. So we created a sub-grid view on Account page and are trying to use the "+" button to create new Tasks.
No I didn't get the accountid. I wanted to prepopulate the regardingobjectid field when creating new task from Account page. The Task entity doesn't support relationship mappings. So I am trying to get the accountid from the url parameter. But I don't know how to access the url parameters.