Mass Reopen & Release PO

nvermanverma Member Posts: 396
One of our customers, want a batch report that will reopen and release all Purchase Order.

I created a batch report with the Purchase Header dataitem and wrote the following code in OnAfterGetRecord
ReleasePurchDoc.PerformManualReopen("Purchase Header");
ReleasePurchDoc.PerformManualRelease("Purchase Header");

However, now when I run the report, I get error messages such as: There is no Tax Area Line within filter OR There is nothing to release.

In these special cases, I want the system to skip the Purchase Order and move to the next rather than erroring out. How can I accomplish this.

I tried putting the above code in IF statement, but that didnt work. I tried using GETLASTERRORTEXT function along with CLEARLASTERROR, but I didnt have much success either.

Answers

  • nvermanverma Member Posts: 396
    I resolved the issue, but putting in quite a few checks in order to avoid running into error for really old PO's.
  • FDickschatFDickschat Member Posts: 380
    You could have created a new CU, putting in the actual Reopen and Release calls into the OnRun trigger. Call the CU with if CU.run from your report. In this case you can also use Getlasterrortext to display the error in the printout of the report.
    Frank Dickschat
    FD Consulting
Sign In or Register to comment.