cancel
Showing results for 
Search instead for 
Did you mean: 

Auto increment value while Inserting data in User Defined Table?

mucipilbuga
Participant
0 Kudos

Hi,

I use below code to insert one recort in to User Defined Table (No Object) with B1 SDK

oUserTable = vCmp.UserTables.Item("BIRIMLER")
oUserTable.Code = "2"
oUserTable.Name = "Deneme2"
oUserTable.UserFields.Fields.Item("U_stok_kod").Value = "Deneme"
oUserTable.UserFields.Fields.Item("U_stok_birim").Value = "Deneme2"
oUserTable.UserFields.Fields.Item("U_ikinci_birim").Value = "Deneme3"
oUserTable.UserFields.Fields.Item("U_katsayi").Value = "333"
retval = oUserTable.Add()

I think when you create User Defined Table, Code and Name values has beem automaticly created.

How can arrange Code field autoincrement value? Because Code field is not important for me. But I need it to get exact line information.

Can I assign it auto increment value?

Regards,

Mucip:)

Accepted Solutions (1)

Accepted Solutions (1)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert

Hi mucipilbuga,

You can use the table of No Object with Auto. Increment type.

Hope it helps!

Kind regards,

ANKIT CHAUHAN

SAP Business One Support

mucipilbuga
Participant
0 Kudos

Dear Ankit CHAUHAN,

OK. Thanks...

Regards,

Mucip:)

Answers (1)

Answers (1)

mucipilbuga
Participant
0 Kudos

Dear Ankit CHAUHAN,

OK. But I can not update already created table. Should I delete table and re-create?

Regards,

Mucip:)

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi mucipilbuga,

Yes, since the option for Auto Increment is already available, you should use the same.

Kind regards,

ANKIT CHAUHAN

SAP Business One Support