0

I am new to Acumatica and need to add approvals to a custom module. Following the instruction found at https://stackoverflow.com/a/37331106/10006439 leads to adding a constant for the custom approval to the static class PX.Objects.EP.AssignmentMapType.

The code is located in PX.Objects\EP\DAC\AsssignmentMap.cs in the code repository, but it isn't part of the editable DAC definition when trying to customize the DAC inside of Acumatica.

Following the instructions, I need to add:

public class AssignmentMapTypeCS : Constant<string>
  {
    public AssignmentMapTypeCS() : base(typeof(STCSDocument).FullName) { }
  }

What is the proper way to access AssignmentMapType to append my custom constant?

Brian Stevens
  • 1,826
  • 1
  • 7
  • 16

1 Answers1

0

You put the constant anywhere you want it where publicly accessible.

In your namespace you can just create a static class like below.

public static class AssignmentMapType
{
    ...
    public class AssignmentMapTypeCS : Constant<string>
    {
        public AssignmentMapTypeCS() : base(typeof(STCSDocument).FullName) { }
    }
    ...
}
Brendan
  • 5,428
  • 2
  • 17
  • 33
  • The only usage I can find of the constant seems to be in places like the PXSelector (i.e. SOSetup.cs on DefaultOrderAssignmentMapID). Does this mean that as long as my custom constant is accessible to the PXSelector then it doesn't have to be appended to the original class with all the other values? That would make sense if it is only used in the PXSelector. – Brian Stevens Jul 05 '18 at 15:22
  • That is correct - use it in the selector and not required to be in the original class with all other values. The constant is really just for using the value in BQL statements so the value used doesn't matter where it lives in your overall solution. – Brendan Jul 05 '18 at 15:40