Solved

How can enable the unit cost field on the Details tab of Sales Order?

  • 15 September 2021
  • 6 replies
  • 474 views

Userlevel 2
Badge

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))]
[PXUIField(DisplayName = "Unit Cost", Visibility = PXUIVisibility.Dynamic)]
[PXDefault(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.

icon

Best answer by Naveen Boga 16 September 2021, 07:23

View original

6 replies

Userlevel 6
Badge +3

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.

Userlevel 7
Badge +17

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.

 

 

 

 

Userlevel 2
Badge

Thanks @Naveen B.  This is a huge help.

Userlevel 2
Badge

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. 

Userlevel 7
Badge +17

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

 

Userlevel 3
Badge

@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


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved