Autoset Lock Date and/or Lock Qty CheckBoxes for new PO Releases in Epicor 9

Software: Epicor 9

Have you ever wanted to have the Lock Date or Lock Qty check boxes automatically checked when new PO Releases are created? It’s possible using a Data Directive BPM on the PORel table.

Instructions to Autoset Lock Date and Lock Qty CheckBoxes in Epicor


Step 1:

Navigate to System Management, select Business Process Management and then Setup.

Step 2:

Select Data Directives. Click the Table… button and search by table  with the table name starting at “PORel.” Now, select the PORel table.

Step 3:

From the data directives menu select New In-Transaction Directive. Add a directive name. Make sure the Enabled check box is checked. Click the Conditions… button and add a condition to check that there is at least one added row in the ttPORel table. Optionally you can add conditions checking fields on the added PORel record.

Step 4:

Click the Actions… button to add a new action, “Synchronously execute ABL code.” Choose Execute code below and paste the code at the bottom of this page into the window. Click the Validate button. Click OK, then click OK again.

Click for full-sized image.

Your BPM should look similar to the screenshot above.

Step 5:

Save the BPM. Now, when a new PO release is created, the lock date and/or lock quantity check boxes will be automatically checked.

Click for full-sized image.

This is the code you will need:

/* Set the Lock Date checkbox
and/or the Lock Qty checkbox when a new PORel is created.
The Lock Date and Lock Qty checkbox values are stored in the ComXref table.
COMxref.foreignKey1 = Lock Date
COMxref.foreignKey2 = Lock Qty */

def var foundComxRefRecord as logical init false.
def var setLockDate as character init “No”. /* Set to “Yes”
to set Lock Date checkbox */
def var setLockQty as character init “Yes”. /* Set to “Yes”
to set Lock Qty checkbox */

for each ttPORel where ttPORel.RowMod = ‘A’:

/* Since this BPM might fire multiple times for the same PORel
and Comxref records are not deleted/changed when a PORel is deleted,
check to see if a Comxref record was already created for this PORel. */
Find first Comxref where COMxref.company = ttporel.Company
and COMxref.file = “PORel_Mapping”
and COMxref.Key1 = string(ttporel.PONum)
and COMxref.Key2 = string(ttporel.POLine)
and COMxref.Key3 = string(ttporel.PORelNum) exclusive-lock no-error.

If available Comxref then do:
/* A Comxref record already exists for this PORel.
Set LockDate and/or LockQty */
Assign COMxref.foreignKey1 = setLockDate.
COMxref.foreignKey2 = setLockQty.
foundComxRefRecord = true.
Release Comxref .
End.

If not foundComxRefRecord then do:
/* A Comxref record does not exist for this PORel.
Create a new Comxref record and set LockDate and/or LockQty */
Create COMxref.
assign COMxref.company = ttporel.Company.
COMxref.file = “PORel_Mapping”.
COMxref.Key1 = string(ttporel.PONum).
COMxref.Key2 = string(ttporel.POLine).
COMxref.Key3 = string(ttporel.PORelNum).
COMxref.foreignKey1 = setLockDate.
COMxref.foreignKey2 = setLockQty.
End.
End.

Suggested:

Becky Lipnick

Recent Posts

Maximize Your ROI with Infor VISUAL Integrations​

Infor VISUAL ERP is a go-to choice for manufacturers who need a production-centric system that…

3 months ago

Infor CloudSuite Industrial: Features & Options

Infor CSI (Syteline) - Features & Options With the creation of Infor Configure Price Quote…

5 months ago

Infor CSI: Excel Report Output Format for Reports Without a Dataview

Infor CloudSuite Industrial (CSI) provides powerful reporting capabilities, often leveraging Dataviews for easy extraction of…

5 months ago

How Datix can help Support your Infor VISUAL ERP Platform

In today’s fast-paced manufacturing environment, efficiency, accuracy, and scalability are critical for business success. Infor…

8 months ago

Custom Integrations Disguised As IPAAS Solutions

Many software integrations are build on IPAAS (Integration Platform As A Service) technology because an…

9 months ago