PO references invalid value

Hi,

I am writing function which loops through all our PO change suggestions and updates a UD field that contains the total value of the purchase order.

For example:
PONum: 1036536
POLine: 1
PORelNum 4
SurplusQuantity: 1000
TotalPOCost_c: 3500.00

I have been through the following process using the BL Tester:

  • Get the POSuggChg tableset by running the method POSuggChg.GetByID

  • Update the UD field to a value

  • Update RowMod to U

  • Run the method POSuggChg.Update

This all works OK.

I then created the following function:

and get the following error:

image

I have checked, and the tableset values are OK prior to the update (i.e. PONum references a valid purchase order).

Has anyone get any ideas?

Thanks,

Andrew.

Could you not loop through a UBAQ? How are you working out your PO Total Price? You doing part price or querying the PO for the Purchase Price? What about PPV?

I understand the business solution but why not create a dashboard with this information?

Plus, MRP… Seems like a sledge hammer approach for something that will require a toffee hammer.

Hi,

This is the ‘story’.

We are preparing to use a third party supplier collaboration tool which sends Change suggestions from MRP to the supplier and need to come up with some way of stopping change suggestions going across to the 3rd Party database, if the combined impact of implementing all the change suggestions for a PO would blow the PO Approval of the buyer.

Without this functionality, we breach our PO limit auditing requirement, as a user could just go into the third party tool, accept the change suggestion, which then supplier accepts and the third party software updates Epicor via the API.

At this point the ‘Approved’ status in Epicor would change to pending, but this is too late.

My idea is to run a function after MRP has run that calculates the impact of all the change suggestions for a PO and then store this value against the change suggestion.

I can then create an updateable BAQ which will allow the relevant approver to approve the suggestion.

In terms of audit, I’ll keep all info in a UD table.

Only approved change suggestions will go across to the third party.

I thought it would be very straightforward and the code is something I coded before and constructed with widgets on other BO’s (i.e. GetByID, make the changes and then Update).

I found this post Logic works in BL Tester, but not BPM Code (Mass Shipment), but whilst the reported problem is similar, the scenario is different.

Cheers,

Andrew.

Updateable BAQ in custom code may well be the way to go - thanks

1 Like