cancel
Showing results for 
Search instead for 
Did you mean: 

Add, Remove UDO records and child records

Former Member
0 Kudos

hey All,

Can anyone tell me how I can remove a row from my UDO document lines table? I know how to update a row in the UDO document table but i am unsure as to how I can remove a row from my lines table using DI API.

Thanks

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Curtis,

As far as I know, you can't access to UDO using the DI API.

you may be able to do that using a recordset, but you're not allowed to do it, and it may have some bad effect

Sebastien

rasmuswulff_jensen
Active Contributor
0 Kudos

Last thing I've heard was that the UDO data would be exposed to the DI in version 2006A.... Already waiting...

Regarding recordset, I've read many times from a UDO using that, but haven't had the nerve to write to it using recordset, but it depense on how desperate customor becomes in needing this over the year.

Former Member
0 Kudos

Anyone from SAP have a comment on this? Is there anyway to remove records from UDO tables?

former_member185703
Active Contributor
0 Kudos

Hi Curtis,

As it has already been pointed out:

There is no way to work with UDO records through DI API in a way which is compliant with Support rules and guidelines...

So, the only way would be through the SAP Business One application.

Sorry,

Frank

Former Member
0 Kudos

Actualy there is a way if you want do cascade remove all the child records of you master data UDO

Here is a little snipet of how i did it in C#

private void CascadeRemove(string __Code) { //Code is the MasterData record's code

UserTable _ChildTable = SBOCompany.UserTables.Item("ChildTable");

while (_ChildTable.GetByKey(__Code)) {

_ChildTable.Remove();

}

}

Answers (1)

Answers (1)

barend_morkel2
Active Contributor
0 Kudos

Hi Curtis,

If you've got the Parent ID of the child lines you want to remove its easy. You won't be using the udo object in the DI API. You will run a delete query using a Recordset Object on your table. Here is an example:

''''''''''''''


DELETE 
  FROM [@SOS_RBC]
 WHERE DocEntry = 'xxx'

'''''''''''''''

(@SOS_RBC has the object type Document Lines)

DocEntry is the key to the master table.