on the Customer Location screen I have added two new tables and new DACs of course and I have modified the Location table to have a few custom fields. I have added the Location_Ext to the Visual studio project after adding the fields.
The screen allows me to update the custom fields all day long.
But I am trying to create a custom action to loop my custom table and put the total of one of the fields in there. I don’t think I have a problem looping the table. It uses the view I added for the screen and seems to work but trying to put the total in Location.UsrSettlementAmt.
I don’t see a Location.UsrSettlementAmt. What gives?
Below is the custom action.
public PXAction<Location> CalculateSettlement;
[PXButton(DisplayOnMainToolbar = true)]
[PXUIField(DisplayName = "Settlement Total", Enabled = true)]
protected virtual void calculatesettlement()
{
decimal? d = 0;
foreach (SettlementDetail sd in InvoiceSettlement.Select())
{
d = d + sd.DetailAmt;
}
}
This is the definition of the custom field in the DAC:
namespace PX.Objects.CR
{
public class LocationExt : PXCacheExtension<PX.Objects.CR.Location>
{
#region UsrSettlementAmt
[PXDBDecimal]
[PXUIField(DisplayName="Settlement Amount")]
I have tried changing the namespace to LocationTab (same as rest of project) to no avail
Any help would be appreciated…
Best answer by edwardmcgovern97
View original