locked
Campaign: Custom Calculation for Total Cost of Campaign RRS feed

  • Question

  • I have a custom entity that is associated with a campaign and there is a variable cost associated with this entity. Somehow I need to get that into the "Total Cost of Campaign". Ideally I want to have an additional non-editable field under Financials that then gets added to the total cost. I can figure out the syncing of that field with my entity. However, what I don't know how to do is adding that to "Total Cost of Campaign". I am not sure if a plugin in the post stage would work (if I have access rights) but I suspect this would be considered an unsupported hack?? If so are there other solutions?
    Wednesday, September 1, 2010 10:23 PM

Answers

  • Maybe too late for the original poster, but for reference the general model I use for this scenario is to create 2 custom fields. One of these fields (e.g. schema_customcost) will be used to store the cost calculated solely from your custom entity, and the other (e.g. schema_totalcost) will be used to sum the previous field and the built in totalactualcost field to give a total cost. Display this second field in CRM in place of the built-in totalactualcsot field.

     

    You'll need to write plugins to update these 2 custom fields


    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Monday, October 18, 2010 3:49 PM
    Moderator

All replies

  • Hi.

    I don't think that this is possible through SDK because total cost is system calculated field and it can not be updated through webservices of CRM. But I think you can do it through direct update of SQL database.


    Microsoft CRM Freelancer

    My blog (english)
    Мой блог (русскоязычный)
    Wednesday, September 1, 2010 10:40 PM
    Moderator
  • Great link. Thank you. I see there is not just a get but also a set function but then "valid for update" says no. That's confusing.

    While I appreciate the suggestion I think there are too many possible side affects to update the value directly in the database. I would be nice if the 'formula', i.e. the involved fields for the total cost calculation could be defined somewhere. I doubt that is the case, though.

    Thursday, September 2, 2010 4:46 AM
  • Maybe too late for the original poster, but for reference the general model I use for this scenario is to create 2 custom fields. One of these fields (e.g. schema_customcost) will be used to store the cost calculated solely from your custom entity, and the other (e.g. schema_totalcost) will be used to sum the previous field and the built in totalactualcost field to give a total cost. Display this second field in CRM in place of the built-in totalactualcsot field.

     

    You'll need to write plugins to update these 2 custom fields


    Microsoft CRM MVP - http://mscrmuk.blogspot.com  http://www.excitation.co.uk
    Monday, October 18, 2010 3:49 PM
    Moderator