cancel
Showing results for 
Search instead for 
Did you mean: 

Set default value for UDF on form load

Former Member
0 Kudos

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.

Accepted Solutions (1)

Accepted Solutions (1)

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hello Sta,

A little confused the difference between your thread title and question. No sure understand you correctly.

1.How Set the default vlaue for UDF on Form load

Just set the default value for UDF, when you'are creating it.

2. how I can get this value to set to another UDF on another transaction table, also header info?

If you are not working with a addon, I think you can use Format Search to fill to another UDF automatically (suppose it should be in the same form),

otherwise, you need to deal with addon, get the value from data source, set it by code.

Kind Regards

-Yatsea

Former Member
0 Kudos

hi Yatsea. thanks for the response. I already get the value from the data source in my code and my only problem is how can i set those values that I've got to another user defined fields to another table,also in code.do you have sample codes regarding this one?

thanks and best regards,

Oman

YatseaLi
Product and Topic Expert
Product and Topic Expert
0 Kudos

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

Answers (0)