BPM To Set PO Header Due Date on Update after adding new detail line


I have a simple request to automatically populate the due date on the PO head from the lead time on the parts added on po detail. I have attached my method to pre-processing on PO.Update. My condition is that when there is at least one added detail row, set the ttheader field. The problem is, the method is not passing any info into the TTheader table when a detail line is saved. Is there a way I can include the ttheader change?

Will I need to make this a post processing item and retrieve the po again to update it?

When you change a date on the header, doesn’t it ask if you want to update the dates on the lines? How would you handle that?

And since you can have different dates on the lines, which one would be the winner that should be used for the Header? Just the specific line being updated?

It’s not super clear, but the dates (NeedByDate and RequstedDate) have a heirarchy between the header, detail and release. If a Release has value set, then that is the value for that release of that line. If the Release’s date is blank, then it inherits the Lines date. If that date is also blank, then it inherits the Header’s date. But it doesn’t actually populate the blank fields.

thats a very good point Calvin! They just want it set on the header. All of our po lines and releases will use the highest date determined by the part with the highest lead time on the order.

So this is working,

  1. Set a pre processing directive that will only enable the post process after a dtl row is added
  2. In post processing,
    -getById with the po num
  • Set the due date field
  • Set row mod to U
  • Call update