UBAQ Custom Delete not working

I need the ability to delete a row in a child UD table (UD100A).
There is no DeleteByID BO on the UD100A table so I cannot “Invoke BO Method”.
I defined the CustomAction as “Base-Processing” BPM and called it “DeleteRow”.
The code compiles and runs without error, just that it does not actually delete the record.

Can anyone offer a suggestion as to why this is not deleting?:

using (var txScope = IceContext.CreateDefaultTransactionScope())
{

  foreach(var UD100A in (from row in Db.UD100A.With(LockHint.UpdLock) where
                              row.Company == Session.CompanyID &&
                              row.CheckBox01 == true
                              select row))
            {
                Db.UD100A.Delete(UD100A);
            }
     Db.Validate();
     txScope.Complete();
}

Yes, before the Db.UD100A.Delete(UD100A); line you need .to set the RowMod also to “D”

Example:

UD100A.RowMod = IceRow.ROWSTATE_DELETED;
Db.UD100A.Delete(UD100A);

Please do yourself a favor and use the BO

3 Likes

No go. It does not like this line of code.
I would prefer to use the BO, but nothing displays for UD100A. There is a UD100 DeleteByID, but I want to delete the child table records UD100A and not sure how I get that method syntax.

Rather than a CustomAction, should I instead put this in the UD100A.Update BPM ?

Yes - Use the BO update and set the child record to deleted.

Check out this thread.

Thanks Dan, putting the “Delete” code in the BO UD100A Update >> BaseProcessing works.

Is there a way to refresh the UBAQ after Update without calling the GetList? If that is how it works, that’s fine.

Fwiw, doing a trace of a child delete from the UD provided screens, they use update with a row mod to remove the row.

Trace of child delete Ice.Proxy.BO.UD109Impl Update net.tcp://e10-2/ERP102Pilot/ System.Void 5/24/2019 08:32:36:4375199 AM 1 0 RAPAT test test test test test 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 0.000000000 false false false false false false false false false false false false false false false false false false false false false false 359702876 0f312e4c-c49c-4972-8f1a-6696f6169810 0 00000000-0000-0000-0000-000000000000 Ice.Proxy.BO.UD109Impl GetByID net.tcp://e10-2/ERP102Pilot/ Ice.Tablesets.UD109Tableset 5/24/2019 08:32:36:5924679 AM 1 0 00000000-0000-0000-0000-000000000000

You should not over over-writing the Base processing… (ever… there’s pretty much no good reason)
Replicate what @Banderson sugested via the BO

1 Like

@josecgomez He’s in a UBAQ, there is no base processing for delete.

No he put the code (as far as I can tell) in the UD100 Update base Processing. (that’s how I read it)

Ah, yeah. Don’t do that…

No, I did not modify the ##BASE## processing Directive.
I created a new Directive with the original code I posted and the functionality is working as I would expect.

1 Like