Plugin for getting attribute values from a grid ? RRS feed

  • Question

  • Hi All,

    I have a requirement like , on product form I have placed a product line item grid in that form I have added a custom column cost.Product and Productlineitem has 1:N relationship.

    Now I need to get the cost column value from the productlineitems records associated with the product and add the total cost and place it on product form.

    For this I need some code in plugin how to get the values from the productlineitems records.

    Please help me..

    Wednesday, June 4, 2014 5:51 AM

All replies

  • Register a plugin 
    On Update message of Product..

    Retrive all the productlineitems records where their product is "Target Entity product" (retrive only cost attribute)

    Count all the cost [CountCost]

    Now Update the target entity's "total cost" filed with value CountCost

    Thats It..
    Wednesday, June 4, 2014 6:33 AM
  • Hi,

    I am new for developing plugin, will you please provide me the code so that it will be helpful for me.

    Thanks in advance !

    Wednesday, June 4, 2014 6:59 AM
  • Hi,

    Are you going to register the Plugin on Update of Product or Create/Update of Product Line item? From what you're trying to achieve it makes more sense to register the Plugin on Create/Update of Product Line item, provided that you do not have existing records of Products already associated with Product Line items; else whenever you're adding a new Product Line item to a Product, the Plugin on Product won't fire and the total cost wont be updated.

    Admin QuikView Solution for CRM 2013

    Wednesday, June 4, 2014 7:18 AM
  • on update of products ...
    Wednesday, June 4, 2014 8:02 AM