cancel
Showing results for 
Search instead for 
Did you mean: 

Updating Master Data Row Tables

Former Member
0 Kudos

Hi

I need to update a usertable which is of master data row type. Now user tables have the property of .GETBYKEY but in master data row tables the key would be the code field right? That is where my problem is coz i just need to update 1 row depending on an event fired in a different form altogether.

Pls help..

Regards

Aris

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

For master table i believe DocEntry or DocNum is the primary key. To make sure you could create a Master and/or Master Rows tables and check with the SAP Business One DBBrowser

Answers (3)

Answers (3)

Former Member
0 Kudos

Hi all

The problem is in master data row has a composite key.. That is the code n the line id.. So in master data row if i were to say getbykey it will give a list of all the record wouldnt it? Is there a way i can single out the rows?

I'l illustrate with an example:

Master Data Table:

Proj Code: P001

Doc Num:1

Master Data Row Table

Doc Num:1

Line Id:1

Activity Code:1

Time Spent:10

Doc Num:1

Line Id: 2

Activity Code:2

Time Spent:20

Now i want to update record having Line ID = 2. What should i use? Usertables is not going to help. I have used UDO's to maintain records for the structure mentioned above. The updation i want to do is from another form al-together. Please help.

Regards

Aris

former_member201110
Active Contributor
0 Kudos

Hi Aris,

If your UDT is part of a UDO (eg master data type) then you cannot update it through the DI API. This is a limitation in working with UDOs. As far as I'm aware, the only way to update a UDO is through the UI.

Kind Regards,

Owen

Former Member
0 Kudos

Hi Aristotle,

There is wrote in a help file that only Code is a Primary Key for Master Data Table, so GetByKey should work with that column.

Regards,

Hmg

Former Member
0 Kudos

Yes I know

But if you check the table "physically" on SQL Server you'll see that the DocEntry field cannot be null. So it is a required. And in some cases it must also be unique.

On the No Object tables the Code and Name fields are required and must be unique both.