Skip to main content

We have a business requirement to have unit cost be visible and editable on the Details tab for Sales Orders.  I made it visible but I can’t find a way to make it editable.  Here are the attributes:

>PXDBCurrency(typeof(Search<CommonSetup.decPlPrcCst>), typeof(SOLine.curyInfoID), typeof(SOLine.unitCost))]
rPXUIField(DisplayName = "Unit Cost", Visibility = PXUIVisibility.Dynamic)]
rPXDefault(TypeCode.Decimal, "0.0")]

These seem to match Unit Price except for the Visibility.  

If there is a way to enable this please let me know.

My understanding is the only way to make the field editable is using a Workflow.  I had a similar issue and I think support told me that you cannot use a workflow on that screen.

Please let me know if you find a way to do this.  I would love to know how.


Hi @vpoulson and Joe,

To enable the Unit Cost field in Sales Order → Details tab, we need to do following changes.

  • Enable Unit Cost field from Workflows
  • Enable Unit Cost field from code level

I have prepared a new package and attached few screenshots for your reference.

 

 

 

 


Thanks @Naveen B.  This is a huge help.


I’m now trying get the unit cost on the opportunity document details.  I’ve added the new workflow and the event handler but the OpportunityMaint doesn’t have a definition for  Base.Document and Base.Transactions but I’m not sure those are necessary since I removed that code from the sales order line and it still has the unit cost enabled.  

When I add a line to the opportunity document details the unit cost is editable but then when I select an inventory item the unit cost is no longer editable.  I’m not sure what I can do to change that behavior. 


Hi @vpoulson  I just updated my comment in below ticket. Hope that helps!

 


@Naveen Boga:  This was very helpful. 

 

Are we able to modify the code to pull the last sold price instead for that item for that customer?  I think pulling from ARTran maybe?


Reply