locked
map product field RRS feed

  • Question

  • hi,

    I have created a whole number field on the product entity that I would like to appear in the order product then invoice product.

    basically its a sort order that enables me to sort the display order of the products in an order

    I located the 1:n relationship on the product but got stuck filling it out.

    is this the right approach?

    what would I have to do to make the update go through?

    thanks in advance

    Wednesday, May 1, 2013 6:30 AM

Answers

  • I went out to look for a no-code solution that would allow mapping the value from the product field down to the order product. I downloaded North52 Formula Manager, which has a Standard Edition available that supports up to 10 formulas for free. Installing this managed solution will enable you to write formulas that update data either on the server or client side based on a search criteria, calculation etc.

    In this case I added the following type of server side formula for the create & update event on the Order Product's Existing Product field, with an output set to the Line Item Number field of the same record. In my test I'm pulling the value from a default field on the Product (Vendor Part Number), so the actual formula looks like this:

    FindValue('product', 'productid', [salesorderdetail.productid], 'vendorpartnumber')

    (Thanks to John Grace from North52 on helping me find the right function.)

    After we save and publish the rule, when creating a new Order Product or editing the Product of an existing record, Formula Manager will pull the value from the Product record to the Line Item Number field whenever I save the record.

    There are tons of things like this you could do with the Formula Manager without writing a line of code. Well, you need to construct the formula of course, but the barrier for using a tool like this is surely much lower than learning how to write plugins.


    Jukka Niiranen - My blog: Surviving CRM - Follow @jukkan on Twitter

    Monday, May 6, 2013 4:35 PM

All replies

  • The relationship attributes will not be inherited from the parent to the child record unless you start the creation of the child record from the parent record form. In this case where you are starting from the Order form and creating a new line item, you'll need to set up a workflow rule for the Order Product entity that is triggered upon record creation and the change of the Existing Product field. Through this workflow you can update the value from the Product record to the Order Product record asynchronously. The user won't therefore see it immediately, but I imagine for this type of a record sorting use case (presumably for printing the order as a document) this should be an acceptable solution. If you need it synchronously, then either a form script or plugin is needed.

    Next, in order to inherit these custom attributes from Order Product to Invoice Product you'll need to dig up a few GUID's, as this particular relationship is not visible in the CRM customization UI. Here's an article from Jamie Miley that shows how to gain access to the relationship attribute mapping window between Order Product and Invoice Product. (Works the same for Opportunity Product and Quote Product, in case anyone else is searching for a similar solution with a different type of sales process.)

    http://mileyja.blogspot.fi/2010/12/map-custom-attributes-from-opportunity.html


    Jukka Niiranen - My blog: Surviving CRM - Follow @jukkan on Twitter

    Wednesday, May 1, 2013 8:33 AM
  • Through this workflow you can update the value from the Product record to the Order Product record asynchronously.

    Hi Jukka,

    How would you update an order product through a workflow?



    My Weblog | My Website

    Sunday, May 5, 2013 6:48 AM
    Moderator
  • Good catch, Payman. Even though you can create a workflow rule for an Order Product, it looks like a workflow cannot update the record. I was under the impression that this limitation to work with line items had been removed in the current version of CRM, but apparently it is still there. So, it looks like this feature cannot be implemented without developing a plugin, form script or a custom workflow activity to overcome the limitation of the default workflow steps.


    Jukka Niiranen - My blog: Surviving CRM - Follow @jukkan on Twitter

    Sunday, May 5, 2013 7:07 AM
  • For accessing the mappings between the different line items I created a little tool to help out.

    That way you don't have to dig up the GUIDs from the database - and it can be used in CRM Online where that isn't possible.

    CRM 2011 Entity Maps


    Jason Lattimer
    My Blog -  Follow me on Twitter -  LinkedIn

    Sunday, May 5, 2013 2:22 PM
    Moderator
  • I went out to look for a no-code solution that would allow mapping the value from the product field down to the order product. I downloaded North52 Formula Manager, which has a Standard Edition available that supports up to 10 formulas for free. Installing this managed solution will enable you to write formulas that update data either on the server or client side based on a search criteria, calculation etc.

    In this case I added the following type of server side formula for the create & update event on the Order Product's Existing Product field, with an output set to the Line Item Number field of the same record. In my test I'm pulling the value from a default field on the Product (Vendor Part Number), so the actual formula looks like this:

    FindValue('product', 'productid', [salesorderdetail.productid], 'vendorpartnumber')

    (Thanks to John Grace from North52 on helping me find the right function.)

    After we save and publish the rule, when creating a new Order Product or editing the Product of an existing record, Formula Manager will pull the value from the Product record to the Line Item Number field whenever I save the record.

    There are tons of things like this you could do with the Formula Manager without writing a line of code. Well, you need to construct the formula of course, but the barrier for using a tool like this is surely much lower than learning how to write plugins.


    Jukka Niiranen - My blog: Surviving CRM - Follow @jukkan on Twitter

    Monday, May 6, 2013 4:35 PM
  • wow thanks everyone

    I too happen to be user that would prefer to stay away from code if i can help it!!

    Tuesday, May 7, 2013 4:12 AM
  • Hi Jukka,

    Can you share a screenshot of the N52 Formula Detail, please.

    Tuesday, May 7, 2013 9:27 PM
  • Disregard Jukka,

    The awesome support out of North52 (thanks John) did the trick.

    This is an excellant product, thanks for putting me on to it.

    Wednesday, May 8, 2013 12:47 AM