One of our clients wants to add an extra column to the Order List view within the Commerce Manager. This column pulls its value from the Mediachase.Commerce.Customers.CustomerContact object for the customer who placed the order. I created a custom control that can fetch the CustomerContact from the current PurchaseOrder and display the value.
Then, I added the column within the Orders-List view (~/Apps/Order/Config/View/Grids/Orders-List.xml), using the new custom control to render the value:
This works perfectly fine, but our only concern is how this XML file is persisted. If we upgrade our EPiServer Commerce version, will this file be overwritten, causing us to lose our changes? Is there a better way of implementing this change?
Edit for NuGet package versions:
It's the way to go - and yes, you will have to reapply your fix after every upgrade. In most cases it's simply a copy-and-overwrite.
It will get overridden with updates from episerver but there is a better way of doing it.
The xml-view have to be changed but instead of editing it manually you can set up an xml transform and have it apply the changes upon compilation.
This will prevent manually stages when upgrading unless there are breaking changes, make the transform well and you might survive pretty much all minor changes. Major changes are unlikely, if Episerver would decide to make such changes we are most likely to see entire new views integrated into the CMS site instead of altering this old legacy system.
how do we add view for customproperty for lineitems
we tried to add it:
<Column width="200" allowSorting="true" dataField="ErpNumber" headingText="Erp Number" columnType="CustomTemplate"> <Template id="ErpNumberFieldTemplate" controlUrl="GridTemplates/ErpNumberFieldTemplate.ascx"></Template> </Column>
but that does not work..
something similar to this maybe?<Column width="200" allowSorting="true" dataField="Properties['ErpNumber']" headingText="Erp Number" columnType="CustomTemplate"><Template id="ErpNumberFieldTemplate" controlUrl="GridTemplates/ErpNumberFieldTemplate.ascx"></Template></Column>
cant get this to work :(
The dataField is not that important, but you will need to implement ErpNumberFieldTemplate.ascx. I just wrote about it in my second book - so if you bought it, check out the latest version. I plan to re-publish those recipes in my blog, but that will take time.
Thanks Quan, will check it out! (yes i have bought your book :), forgot to check in it first, sorry )