How do you track a line deletion in Purchase Order Entry, for example

Hello,

I have an employee that had a line deleted from her purchase order and wanted to know who and when.
I couldn’t find anything useful to tell her.
I suggested enabling the change log to track for future.
I did a test in my test database and found it doesn’t tell you when a line has been deleted, Just some totals have changed.
Is there a way to track this?
Funny enough, if you add a line, it creates a new change log record that starts with: New Record

Any help or advise is appreciated.

Thanks,
Shawn

Hi Shawn,

I’m beginning to think that it’s called a ChgLog because it only tracks changes and not additions or deletions. :face_with_raised_eyebrow:

A BPM selecting ROW_MOD=‘D’ and writing to a UD table might be the only solution at this time.

Mark W.

2 Likes

That was the exact answer I was afraid of, lol.

Can you give me any specific instructions?

Any help is appreciated.

I don’t have specific code for that but I seem to recall that I saw some here or over at the EUG forum.

Maybe it was @SueLowden?

Data Directive on condition there is a Delete() Row is your only choice

1 Like

Could you be just a little more specific?
I don’t seem to be getting it today.

I tell my customers never delete a PO unless the entire order was entered by mistake. Instead, it is a much better business process to Close the line(s) and/or release(s). Adding a comment or memo about “why” is also important for audit purposes. Closing lines/releases is also captured in the change log (when enabled).

1 Like

For future reference, this is what I did:

  1. I created a new Pre-Processing Method Directive (Erp.PO.Update)
  2. in Design, hooked ‘Start’ to ‘Condition’.
  3. Added condition: The ‘ttPODetail.RowMod’ field of ‘the deleted row’ ‘is equal to’ the “D” expression
  4. Hooked true condition to ‘Fill Table by Query’.
  5. Hooked ‘Fill Table by Query’ to ‘Invoke External Method’.
  6. Set up ‘Invoke External Method’ like this:
    a. Invoke ‘Ice.UD01.UpdateExt’ BO method with ‘specified’ parameters.
    b. specified parameter:
Name Type Direction Binding
ds UpdExtUD01Tableset in-out var: UD01LogRecords
continueProcessingOnError bool in expr: false
rollbackParentOnChildError bool in expr: true
errorsOccurred bool out [ignore]
< return value > BOUpdErrorTableset out [ignore]
  1. Set up ‘Fill Table by Query’ like this:
    a. Use the ‘POLineDeleted’ query to insert data into the ‘UD01LogRecords.UD01’ table with ‘configured’ mapping
    b. POLineDeleted: add ttPODetail table, add these fields:
Alias Label DataType
Company Company System.String
PONUM PONUM System.Int32
POLine POLine System.Int32
PartNum PartNum System.String
OrderQty OrderQty System.Decimal
  1. Set up configured like this:
Name Type Binding
Company string field: ttPODetail_Company
Key1 string expr: BpmFunc.Now().ToString("yyyy-MM-dd HH:mm:ss")
Key2 string expr: ttPODetailRow.PONUM.ToString("G")
Key3 string expr: ttPODetailRow.POLine.ToString("G")
Key4 string expr: "POLineDeletedBy"
Key5 string expr: System.Guid.NewGuid().ToString()
Character01 string expr: string.Format("PO {0} - Line {1}: Part #: {2} with Qty: {3} was deleted by {4} on {5}",
queryRow.ttPODetail_PONUM,
queryRow.ttPODetail_POLine,
queryRow.ttPODetail_PartNum,
queryRow.ttPODetail_OrderQty,
callContextClient.CurrentUserId,
BpmFunc.Now() )
Character02 string field: ttPODetail_PartNum
Character03 string expr: callContextClient.CurrentUserId
Number01 decimal field: ttPODetail_OrderQty

I then saved it all and tested by deleting a line from the PO. I wrote a simple BAQ to pull the data from the UD01 and it looks like a winner.

Hopefully this will help someone in the future who would like to write data to a UD table for tracking.

1 Like