BPM to set POs created with PO Suggestions as unapproved

We are implementing SourceDay for processing POs. SourceDay picks up new POs that are marked as approved. We generate 90% of our POs from PO Suggestions, which automatically creates the PO as approved. We need to modify this so that new POs are not approved by default and can be reviewed and edited before SourceDay picks them up.

Has anyone done this before? I’ve done some trace logging, but I can’t figure out where to put a BPM to do this. I assume it needs to be a Method Directive since I only want POs created by PO Suggestions.

I tried a method directive on Erp.POSugg.Generate both Pre & Post, but the PONum field isn’t populated.

Any thoughts or pointers would be appreciated.

1 Like

You could try setting a callContextBPMData variable in a post method directive on POSugg.Generate , and then check for that value in an in-trans data directive on the POHeader table. If the callContextBPMData value is present, change the POHeader.Approve field to false. That way it should only happen when the PO is created from the suggestion.

2 Likes

Thanks, @Asz0ka, for pointing me in the right direction; that was the direction I was thinking. Your steps were correct, except I had to do a Pre-Processing on Erp.POSugg.Generate, not a Post. Otherwise, this worked!

5 Likes

After some testing I realized I needed to set;

  • ttPOHeader.Approve = false
  • ttPOHeader.ApprovalStatus = “U”
  • ttPOHeader.ReadyToPrint = false

3 Likes

Norman,

We are in the same boat here. Getting ready to go with Source Day.
I am not an expert code writer. Is it possible you might share your “FromPoSugg”
expression with me?

It would be greatly appreciated.

Thanks,
Brian Groner

1 Like

Hello Brian,

What version of Epicor/Kinetic are you running? I might be about to export the 2 BPMs and send them to you.

In order to get this to work, you need a method directive on ERP.BO.POSugg.Generate / Pre-processing to tag record PO generated from PO Suggestions. So that the Data Directive can id the POs.

The data directive with be on POHeader.Update, the condition is:

Then you need 3 actions to set field values:

  • ttPOHeader.Approve = false
  • ttPOHeader.ApprovalStatus = “U”
  • ttPOHeader.ReadyToPrint = false

2 Likes

We are running 11.2.200. Kinetic 2022. If you are willing it certainly worth a try for me.

Try this:

UnAppPOSugg.bpm (27.3 KB)

Thank you @nhutchins, you just saved me hours of work!

Hello Guys,
This method only working on Classic Mode. In kinetic, it doesn’t work. anyone see why?

thanks,

Eddy

@naruto I can’t see any reason this shouldn’t work in either classic or kinetic. If you are running into issues, I’d recommend placing some messages boxes into to workflow so you can tell where it stops working. i.e. does either BPM activate? Are the PO created by Suggestions tagged with “FromPOSugg”, etc.

Good luck!

It could be something to do with the program name Kinetic is using to run PO suggestions.

You can use a messagebox to see what ProcessID is being used. And then update the BPM to recognize the right POSuggestions program for Kinetic. Though I’m surprised it is different…
Please share what program name it uses is if you get it figured out. Ty.

FYI, the way all this works is:

  1. PO Suggestions creates a PO, that is initially unapproved. This is the New record.
  2. Then automatically, PO Suggestions marks it as Approved. This is an Updated record. It is a little tricky to stop this, as if we prevent all PO Header Updates from approving, no POs could be approved. We just want to stop the approvals triggered by POSuggestions.
  3. One way to do that is @nhutchins’ method, with 2 BPMs.
  4. You can also do it with just 1 Data Directive BPM, checking what ProcessID is triggering the table update. I used code but this can be done with widgets too:

var Result = (from t0 in Db.Menu
  where t0.Company == callContextClient.CurrentCompany
  && t0.MenuID == callContextClient.ProcessId
  select new{t0.Program}).FirstOrDefault();

if (Result != null && Result.Program != null) {

  if ( Result.Program.ToString().Contains("POSugg")) {  //should be Erp.UI.POSuggEntry.dll or Erp.UI.POEntry.dll
    gLaunchedByPOSugg = true;
  } else {
    gLaunchedByPOSugg = false;
  }
}

In the Kinetic, it doesn’t call POSugg->Generation BPM.
but classic, it call POSugg-Generation BPM. don’t know why.

regards,

Eddy

1 Like

Kinetic uses different methods in some instances, if you perform the action in web access with developer tools on you can see the method being called by the Kinetic instance

2 Likes

finally, i use a different method which is to put message in the shipdtl comments. so that it indicate if it is from PO suggustion or not.

Regards,

Eddy