:: Bang Head! Should have seen that one coming! ::
Ok, so - no problem - just put the script in the Opportunity Product form too, so that no matter the stage of the process (Opportunity or Quote), the category is set when the item is created - right? Sure, and then just map that attribute from Opportunity Product to Quote Product, and voilá! Mission Accomplished, right?
Unfortunately it was not that easy...
A custom attribute in Opportunity Product, Quote Product, and Order Product Entities that is maintained throughout the life cycle of Opportunity to Quote to Order.
In Dynamics CRM 4.0, there is no intrinsic way to customize the mappings from Opportunity Product to Quote Product, or from Quote Product to Order Product. The relationship appears not to exist.
So, off I went to research. Surely I'm not the first person who's had the need to map custom attributes from Opportunity Product to Quote Product. Eventually I found someone doing this from Quote Product to Order Product, and it was suprisingly simple!
As it turns out, a form exists for editing such mappings - there is just no implicit way of accessing it.
The base URL for this form is:
So, if we can get the GUID of the "mappingList" of interest, we can in theory access those mappings and edit them through this form. For this, we'll go directly to the database. In your favorite SQL client (I use SQL Server Management Studio), run the following queries to get the information you're after:
Copy the GUID from the opportunityproduct return itemSELECT *FROM entitymapbaseWHERE targetentityname = 'quotedetail'
Copy the GUID from the quotedetail return itemSELECT *FROM entitymapbaseWHERE targetentityname = 'salesorderdetail'
With the necessary GUID now at your fingertips, simply complete the URL and paste it into IE, and you'll be rewarded with a mapping configuration form: