img_cross

How to specify an internal PO Order type

img_circle
img_triangle_white
acumatica customisation packages

We will create a customisation package that would allow the business users to specify and internal PO Order type, which can be used for workflows, assignment maps and reports.

Introduction

Acumatica has the ability to customise almost any screen to provide additional information or business logic that is required by an ERP client. Customisations are done using the Acumatica xRP platform and seamlessly integrate into the ERP platform.
The extension is robust and agile, ensuring that it would allow the application to still be upgradeable and when the package is removed, returns the application to its original state.
STEP 1

Creating customisation package

For creating customisations, go to Customisations and open Customisation Projects (SM204505). On the screen, create a new customisation and open the link.
acumatica customisation img1

Notes

  • User needs to have Customiser role
  • Project naming convention to be relevant to the function
  • Provide a version number sequence to manage the customisation reiterations (on description)
    • Minimum Acumatica Build
    • Version reiteration
  • Project Level is important for two reasons:
    • The more important the customisation, the higher the number
    • It ensures that customisations do not merge and cause conflicts
STEP 2

Start with screens

Once the customisation package has been created, start with screens, and add all the required screens for the customisation. Below we are adding a purchase order screen (PO301000):
acumatica customisation img2
STEP 3

Create a defined field

On the screen, create a user defined field for the internal order type.
acumatica customisation img3
Adding custom fields, based on storage type (DBTableColumn), could create a column in the database. By following this process, two additional items on the project is created:
  • Data Access – DAC field and it’s attributes
  • Database Scripts – the script Acumatica generates to create the column (DBTableColumn storage type)

Notes

  • User defined fields need to be specified with ‘Usr’ prefix. This is to ensure the column does not get removed during upgrades
  • When adding new fields, the project needs to be published before the field can be used
    • Field is added to the screen with ‘CREATE CONTROLS’
  • Ensure the correct view is selected when creating the field, i.e. if it is on the header, make sure the summary section is selected when creating new fields
  • Review and adjust field attributes before adding the field onto the form
    • If this item is not done, the original item type will be used. This is an issue when a field is created for a dropdown or selector but not defined. Without it, the field would be added as a plain text field
On ‘CREATE CONTROLS’, the field is added onto the view. Once added, the field (based on selector field type) has a list of attributes. Two properties are required to be reviewed
  • CommitChanges – this property would trigger the field updated event
  • ID – The control’s identifier on the page. Acumatica by default would provide a Cst… field ID. Pro-tip Change the ID to be unique to the field, as other customisations on the same site might have the same custom ID value assigned and will cause a conflict issue
STEP 4

Convert the item to an extension

On Data Access, convert the item to an extension too. The item would move to the Code section for further amendment.
acumatica customisation img4
STEP 5

Additional activities

From the code section, additional activities can be performed:
acumatica customisation img5

From the above the following:

  • Code section lists all the code’s extensions
  • Override Method provides a list of methods/actions that can be override, this allows for an original method to be called and can be modified
  • New action provides the code to create new actions “buttons” on the screen
  • Moving the code to an extension library/code-behind (dll file)
STEP 6

Add field to the screen

After the DAC extension has been modified for the DAC field’s attributes, the field can be added to the screen.
(More information on the extension coding is in the following section).

The DAC field is set as a selector, which will list the attributes’ IDs and descriptions.
acumatica customisation img6

Code

Gist

https://gist.github.com/Gerhard-ZA/102d5a2c5a182e8795bbb19733dee6ee
STEP 7

Extending the package to code-behind

To move the extension, click on the Extension Library and create/open extension library. Opening Visual Studio, the extension file would be available on the solution explorer.
acumatica customisation img7

Notes

  • PO Order Extension file is available on the solution explorer, this file is used when attaching the extension library to Internet Information Service (IIS)
    • If the file (extension) is on both Customisation Package and Visual Studio, the customisation package file would be used for processing
  • The class name of the extension, this name should be unique as it could cause a conflict issue if the application has the same extension name on another customisation package
  • IsActive method allows business logic to identify if the extension should be used or not. This method can be used with business logic or setup to only activate on certain conditions
STEP 8

Include on the customisation project

On creating an extension library, the dll file would need to be included on the customisation project in order to have the customisation package functional.
acumatica customisation img8
acumatica customisation img9

The Final Result

Link to Customisation Package > URL

Conclusion

By using the methods provided in the post, you will be avoid issues with other published customisations and keep your packages clean and maintainable now and in the future.

Look for further customisation best practices from our Developer MVPs.

Good luck and Happy Coding!
Astraia Technology
Powered by ERP. Transformed by Astraia
Copyright © 2010-2024. All Rights Reserved.