locked
Changing Values on Activated Contract Line RRS feed

  • Question

  • Hi,

    Once a contract line is activated it's read only. I can understand the reasons why this is the case. However this doesn't support our business model very well. We have two senarios we need to accomodate.

    1. In order to correct an issue with a hardware product we may swap the product will another item. In this circumstance we would want to change either just the serial number, or if we supply a different model the serial number and the product.

    2. The customer for the contract line may change during the duration of the contract period, (promtion / redundancy that kind of thing). In this circumstance we want to change the customer but leave everything else the same.

    The above can be achieved by canceling the contract, copying it, modifying then re actviating. But this is a pain.

    Can I do this with a SOAP call using JavaScript or would I be prevented from updating a read only record. Would a .net webservice have the same restriction?

    Regards

    Chris

    Friday, October 1, 2010 9:29 AM

Answers

  • All updates of any form are prevented upon Contracts and Contract Lines, once they are invoiced/activated.  The only way to modify them, is to do so directly in SQL--which is unsupported by Microsoft.  With that said, here is what I would do to approach your situations, as you identified them:

    1. Write a custom workflow activity engineered to communicate directly with SQL and update the ContractDetailBase table.  Allow it to take one parameter: the updated product.  Write it into a manual workflow that only trusted CRM users can execute.  Configure the product reference from the custom activity to by dynamically associated to a product field on some other record that is related to the Contract Line.  Ideally this would be the customer.

      When the workflow executes, allow it to take the GUID/Key value of the product and write directly to the ContractDetailBase table for the row that has a "contractdetailid" value that matches the Contract Line record, extracted from the execution context.  It will update the "productid" column for that row.
    2. Consider that Contracts are legal agreements between your company and some other entity.  When the other entity "changes", the agreement may hold, but its conditions change.  Would you not want to have a snap-shot of the previous "version" of the agreement between you both?  Also, if you change the Customer record directly (instead of creating a new one to represent the change), its changes will reflect immediately on the Contract.
    An alternative to both recommendations is to stick the Contract back in Draft status with a Workflow activity written by the ever helpful MayankP .  It's not ideal, because the state change will not trigger any other Workflows/Plugins, but when you reactivate it, anything that is listening to the state change will trigger.  (Although, I suppose you would reverse-engineer his code to perform the reactivation without necessarily calling a CRM platform operation.)
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Tuesday, October 19, 2010 6:13 PM
    Moderator

All replies

  • Can anyone help with this?

    Regards

    Chris

     

    Tuesday, October 19, 2010 5:40 PM
  • All updates of any form are prevented upon Contracts and Contract Lines, once they are invoiced/activated.  The only way to modify them, is to do so directly in SQL--which is unsupported by Microsoft.  With that said, here is what I would do to approach your situations, as you identified them:

    1. Write a custom workflow activity engineered to communicate directly with SQL and update the ContractDetailBase table.  Allow it to take one parameter: the updated product.  Write it into a manual workflow that only trusted CRM users can execute.  Configure the product reference from the custom activity to by dynamically associated to a product field on some other record that is related to the Contract Line.  Ideally this would be the customer.

      When the workflow executes, allow it to take the GUID/Key value of the product and write directly to the ContractDetailBase table for the row that has a "contractdetailid" value that matches the Contract Line record, extracted from the execution context.  It will update the "productid" column for that row.
    2. Consider that Contracts are legal agreements between your company and some other entity.  When the other entity "changes", the agreement may hold, but its conditions change.  Would you not want to have a snap-shot of the previous "version" of the agreement between you both?  Also, if you change the Customer record directly (instead of creating a new one to represent the change), its changes will reflect immediately on the Contract.
    An alternative to both recommendations is to stick the Contract back in Draft status with a Workflow activity written by the ever helpful MayankP .  It's not ideal, because the state change will not trigger any other Workflows/Plugins, but when you reactivate it, anything that is listening to the state change will trigger.  (Although, I suppose you would reverse-engineer his code to perform the reactivation without necessarily calling a CRM platform operation.)
    Dave Berry - MVP Dynamics CRM - http:\\crmentropy.blogspot.com
    Tuesday, October 19, 2010 6:13 PM
    Moderator
  • Hi, I have a similar problem.

    To facilitate the reading of the times in the contract lines (all in minutes) I have created some custom fields to translate units of service from minutes in hours and days.
    For instance I created totalallotments_h and totalallotments_d to keep the amount of the field totalallotments in hours and days. The same thing I did for allotments used and allotments remaining.

    So, when a case is resolved, my custom fields are misaligned,
    because the CRM updates only itsoriginal fields, in minutes. I wanted to make a workflow to update my fields when change the value of allotmentsremaining (like a "trigger"), or when a case is resolved, but the interface does not allow me to use the line of contract to perform the update.
    How can I do?

    Kind regards,

    nachille

    Tuesday, December 4, 2012 3:12 PM