Skip to Content

Archived discussions are read-only. Learn more about SAP Q&A

Set default value for UDF on form load

Hi everyone,

I have created a user-defined field in the title part of a transaction table. But I am having a problem on how I can get this value to set to another UDF on another transaction table, also on the header part. Thanks.

replied

Hello Sta,

You can use RecordSet Object or UserTable.

1.RecordSet (Execute the data manuplation SQL, SELECT ,INTERT, UPDATE, DELETE)

oRecordSet.DoQuery("UPDATE @AnotherUDT SET Code = 'Test' WHERE ***");

2.UserTable (Only allow to update those non object User Defined Table)

oUserTable.GetByKey ("T1")
    'Set default, mandatory fields
    oUserTable.Code = "A"
    oUserTable.Name = "Albert"
    'Set user field
    oUserTable.UserFields.Fields.Item("U_AlbUDF").Value = "1"

You may go to SDK online help. Search the key word RecordSet or UserTable for help.

Or refer to SDK Sample Code:

C:\Program Files\SAP\SAP Business One SDK\Samples\COM DI\VB.NET\01.BasicOperations

Kind Regards

-Yatsea

0 View this answer in context

Helpful Answer

by
Not what you were looking for? View more on this topic or Ask a question