Tuesday, 25 March 2014

Epicor 9 – Sales Order BPM - How to create a popup message on Specific Parts

Eyup! (Yorkshire, UK for Hello) - I was asked recently to create an informational message on the Sales Order Entry form which, when a part (with a specific prefix on the line description) was added, the click on a save button would raise an information popup to alert the user to a specific message, in this case – “This order may contain drop-ship Gas”.

1. You should either be a System Manager or log on as one.

2. Navigate to System Management > Business Process Management > Setup > Method Directives.

 image
image

3. Click on the Method Code button and select SalesOrder from the Business Object dropdown, then hit the Search button and it will list the individual methods under the SalesOrder business object.

Given that there are more than 100 methods under this business object you’ll need to click on the options button and check the Return All Rows… then click OK and hit search again. You should now see around 180 methods listed.
image

4. Mostly every form in Epicor uses the respective BO Update when it is saving data. What we are about to do in this instance is raise a popup before the SAVE has completed based on certain conditions. Now select the Update method from the list and click OK.
image

5. Now select New Pre Processing from the menu.
image

6. Under Directive Name, give it something meaningful to let you and others know what this does. Group is overtyped or dropdown but will help you categorise when searching for your BPMs. Order will be used for prioritising which BPM should run in which order and the owner company is left as is. Now tick Enabled and Company Independent.
image

7. Now click on the Conditions button. Then select the “number of rows in the designed query is not less than 1”.
image

We are not going to use this exact syntax, but it will help shape the conditional query we need.

8. Click on the highlighted word ‘designed’ and give your query any name. Now click on the Editor Button. Now for those of you who have experienced Business Activity Queries, this next screen will be familiar to you, but I’ll step you through it if you are not.

image

The white box under the Diagram view will help you filter the table you need to query against which in this case happens to be OrderDtl (or ttOrderDtl to be more precise, but I’ll come on to that soon.) Drag out the OrderDtl from the left into the main pane and you should end up with something like the above image.

Now click on the Criteria Tab at the bottom of the active BAQ Designer window and add a new row by clicking the white page to the slight upper left of that tab.

image

Click on the Field Name dropdown and choose the LineDesc field, then choose the Compare as BEGINS and finally choose Specified Constant in the filter value. Click on the Specified Constant highlighted link and then type the beginning few letters of the line description you wish to have the popup appear against. In my case, the line description would always appear as FCGxxxxx so I just type FCG. Now hit the red X to close the designer window… you’ll be prompted to save – click YES.

image

Now here's the final bit, you’ll need to amend the query you have just created, as the query will reference the TEMP TABLE or OrderDtl.

Change from this

image

To this.

image

(just add the tt to the beginning of OrderDtl in both instances)

Click Check query – is should return ‘Query is OK. Now click the OK and return to the Conditions Dialogue.

Click on the is not less than and change to is more than.

Now click the 1 and change to 0 (zero). Now Click OK

Conditions should now look like this.

image

Now click the Actions button.

Add a new line in the usual way by clicking the white blank page.
image

Select the following from the drop-down…
image

Click on the highlighted word ‘designed’ … this will be the text your popup will display…

Fill in the message you would like to appear.

image

Click OK. then click OK again.

Now hit the save button.
image

You can now test your BPM on the Sales Order Entry Form.

image

Hope that helped!