Delete UD Record in Application Studio

Hi,

I’ve created a child table in the customer shipment record to record box contents in a phantom box.

When I delete using the ‘delete’ function of the view, the record is removed from the grid, but not deleted at the database level.

Does anyone have any advice on the best way push the delete through from the grid to the database?

Thanks,

Andrew.

You trying to clear a field or really delete a row?

Need more details regardless.

I’m trying to delete a row, not just from the view.

The row is being deleted from the view, but not firing the DeleteByID BO.

I’ve got around it at the moment using a button to fire the event to delete record, but just find the vanilla ‘Delete’ in Action menu misleading.

It’s an old post I know… but @aclements did you ever review the base event and resolve it?

The “stock” Delete action is going to run an event that calls the base BO delete method.

You should be able to create an event with a trigger of before_delete to intercept the delete call. Use a condition like: "%currentDataView%"=="MyUDdataview"… if true, call your own UDXX.DeleteByID rest call.

If the current dataview is not your UD dataview, it should continue on to the “stock” delete action.

1 Like

Good Morning Gentlemen,

Adding to the original question.
I am using an Updateable BAQ in a part of a larger dashboard. I have figured out how to add and Update records but deleting then is evading me.
This is what I have do far:

Rowmod set to “D”

I threw a textbox on a gridpanel to show dvTasks.Rowmod and when I add a record, it shows A , Update a field and it shows U

1 Like

Going this route MIGHT work… I’ve never tried it. But the row-updates are just going to change your dataset locally. You still need to push it to the server.

So, if you want to try it, I’m assuming you’ll still need a rest call using an update method. The Update may see the rowmod = D value and delete that row during the update. Not sure.

I typically do it with an UD0X.DeleteByID rest call.

3 Likes

I was trying to follow the process I used to add and Update the rows by calling the UD BAQ , setting the mode to Update

Caveat with this is you have to do a on column Changed event for all fields… a bit of a pain but was trying it out to see if it would work. It does not work by setting the RowMod to D

Here is the dashboard before and After updating a row. erp-text-box-1 is bound to dvTasks.RowMod

Finally took a stab at DeleteByID . Wow. easy peasy…

2 Likes