Answered by:
Map custom attributes from salesorder detail to invoice detail when convert sales order to invoice

Question
-
Hi,
I would like to convert salesorder to invoice with MS CRM 2011.
having custom attributes in salesorder detail that I want to map to invoice detail, these custom attributes can not be mapped with simple customization because there is no relationship between the salesorder detail and the invoice detail.
Is there any way to do this ?
thanks for your help.
- Edited by w.benamor Thursday, September 22, 2011 4:42 PM
Thursday, September 22, 2011 4:41 PM
Answers
-
Hi there,
You might find this similar thread helpful: http://social.microsoft.com/Forums/en/crm/thread/7462bed7-6029-415f-8bff-decfe38ecedc
To quote a snippet from it, the following articles show how to get access to these mappings and add new field mappings between the Opportunity Product, Sales Order Detail, Quote Detail and Invoice Detail entities:
For CRM 4.0
For CRM 2011
http://dynamicslollipops.blogspot.com/2011/07/mscrm-2011-mapping-opportunity-product.html
However the technique is similar for both versions of Dynamics CRM.
Is slightly strange that this set of mappings is not directly exposed by the CRM interface as is a common request to map fields between the detail line entities, and these mappings can help avoid having to develop a Plugin which can add cost in development time. Hope that helps.
Kind Regards, Paul | http://crmconsultancy.wordpress.com- Marked as answer by w.benamor Tuesday, September 27, 2011 8:40 AM
Friday, September 23, 2011 9:57 AM
All replies
-
This *could* be possible with a plugin that triggers when an invoice detail is created. You might be able to figure out which sales order it is coming from by using the ParentContext.
You could have an if statement like this in your plugin to make sure that it is being triggered from the convert process.
if (context.ParentContext != null && context.ParentContext.MessageName == "ConvertSalesOrderToInvoice")
Then use this to get the SalesOrderId
salesOrderId = (Guid)context.ParentContext.InputParameters["SalesOrderId"];
Blake Scarlavai - http://mscrmdev.blogspot.com/ - Sonoma Partners - http://www.sonomapartners.com/ - Follow @bscarlav- Edited by Blake ScarlavaiMVP Thursday, September 22, 2011 5:45 PM
- Proposed as answer by anwar_addi Thursday, November 8, 2012 12:32 PM
Thursday, September 22, 2011 5:44 PM -
Hi there,
You might find this similar thread helpful: http://social.microsoft.com/Forums/en/crm/thread/7462bed7-6029-415f-8bff-decfe38ecedc
To quote a snippet from it, the following articles show how to get access to these mappings and add new field mappings between the Opportunity Product, Sales Order Detail, Quote Detail and Invoice Detail entities:
For CRM 4.0
For CRM 2011
http://dynamicslollipops.blogspot.com/2011/07/mscrm-2011-mapping-opportunity-product.html
However the technique is similar for both versions of Dynamics CRM.
Is slightly strange that this set of mappings is not directly exposed by the CRM interface as is a common request to map fields between the detail line entities, and these mappings can help avoid having to develop a Plugin which can add cost in development time. Hope that helps.
Kind Regards, Paul | http://crmconsultancy.wordpress.com- Marked as answer by w.benamor Tuesday, September 27, 2011 8:40 AM
Friday, September 23, 2011 9:57 AM -
Thanks for all,
The following post seems to be very helpfull:
http://dynamicslollipops.blogspot.com/2011/07/mscrm-2011-mapping-opportunity-product.html
Thank you again !
Tuesday, September 27, 2011 8:39 AM