Question Status

Suggested Answer
TheHappyGiraff asked a question on 31 Jul 2014 10:06 AM

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?

Reply
Chitrarasan Duraisamy responded on 31 Jul 2014 10:42 AM

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.

Chitra


Reply
TheHappyGiraff responded on 31 Jul 2014 10:52 AM

Thank you! I got it.  

Reply
TheHappyGiraff responded on 31 Jul 2014 11:31 AM

HI, Chitra,

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?

Reply
Suggested Answer
Chitrarasan Duraisamy responded on 31 Jul 2014 11:39 AM

When you create task from opportunity or account by default system will  prepopulate regarding filed. System activity entities does not support mapping.

Chitra


Reply
TheHappyGiraff responded on 31 Jul 2014 12:01 PM

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.

Reply
Suggested Answer
Aileen Gusni responded on 31 Jul 2014 1:18 PM

Hi,

If the mapping is does not work, then, I suggest you to use OData and javascript function.

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.

msdn.microsoft.com/.../gg334279.aspx

msdn.microsoft.com/.../gg985387.aspx

And download the OData Query Designer to help the development.

crm2011odatatool.codeplex.com

Hope it helps!

Thanks.

Reply
TheHappyGiraff responded on 31 Jul 2014 2:22 PM

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.

Reply
Suggested Answer
Chitrarasan Duraisamy responded on 31 Jul 2014 11:39 AM

When you create task from opportunity or account by default system will  prepopulate regarding filed. System activity entities does not support mapping.

Chitra


Reply
Suggested Answer
Aileen Gusni responded on 31 Jul 2014 1:18 PM

Hi,

If the mapping is does not work, then, I suggest you to use OData and javascript function.

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.

msdn.microsoft.com/.../gg334279.aspx

msdn.microsoft.com/.../gg985387.aspx

And download the OData Query Designer to help the development.

crm2011odatatool.codeplex.com

Hope it helps!

Thanks.

Reply