Banner

Locking a price list in Dynamics CRM 2011/2013

Back to Blog Listing


Why Lock Prices?

lock price option in form image Invoices within Microsoft Dynamics CRM have an option to allow the user to "Lock Pricing" as an option in the toolbar of the Invoice form window.

This facility ensures that any changes to the price of the products do not impact the invoice.

As such when an invoice has been issued to a customer it is necessary to ensure that the prices have been locked.

If you are using workflows to automate the invoicing processes then it may be necessary to lock the pricing via code.

How to Lock Prices via Workflows / Code

Unfortunately it is not possible to update the "ispricelocked" attribute to be "Yes"/"No" via a standard workflow step.  This has to be achieved via a custom workflow step.  

Within the custom workflow step the attribute "ispricelocked" cannot be simply updated in the standard way as it is a read only field, within the API as well as the form. To set this attribute you must use a "LockInvoicePricingRequest". Please see example on how to use this below:

Dim ser As IOrganizationService = CType(serProxy, IOrganizationService)
 
Dim inv As New Invoice
 
Dim req As New LockInvoicePricingRequest()
req.InvoiceId = inv.InvoiceId

ser.Execute(req)

 

It is worth noting that after you have locked the pricing that any changes to you Invoice Product lines will not be impacted by any workflows/code.   As such you need to consider carefully when the invoice pricing should be locked e.g. when the invoice is emailed to the client.


11 Feb 2014

About the Author

James CTwo is our blogging alter ego for the Dynamics CRM and Web experts here at C2. We have a passion for anything CRM, Web Design or Social Media. We love writing about it! Find us on YouTube & Twitter.

comments powered by Disqus

Our White Papers

Discover the content that matters to you on business transformation. Explore how you can drive customer engagement, empower your team, optimise your businesses and revolutionise your products with the next digital revolution. For more information visit our white paper library.

Library

C2 Newsletter

Our newsletter is sent on a quarterly basis, offering detailed insights into all aspects of business transformation with Microsoft cloud technologies. We also promote upcoming events and special offers throughout the year. Sign up to get involved today.

Dynamics 365 Office 365 Power BI Silver Partner