Try our conversational search powered by Generative AI!

Adding a custom column in Commerce Manager orders view

Vote:
 

Hello,

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:

  • EPiServer.Commerce.Core: 9.14.1
  • EPiServer.CommerceManager: 9.14.1
#172669
Edited, Dec 07, 2016 19:03
Vote:
 

Hi,

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.

#172671
Dec 07, 2016 22:58
Vote:
 

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.

#172718
Dec 08, 2016 17:21
Vote:
 

how do we add view for customproperty for lineitems

ILineItem lineItem

lineItem.Properties["ErpNumber"]

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 :(

#191781
Apr 27, 2018 15:45
Vote:
 

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. 

#192105
May 07, 2018 15:38
Vote:
 

Thanks Quan, will check it out! (yes i have bought your book :), forgot to check in it first, sorry )

#192111
May 07, 2018 21:14
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.