VishalMistry
10th September 2015, 07:36
Hello,

I am trying to insert item group record through stpapi functions but getting error "record already exists". following is my code:

string error(100)
long ret
stpapi.put.field("tcmcs0123m000","tcmcs0123.citg","ITMG1")
| ret = tirouf1102m000.find(error)
| stpapi.synchronize.dialog("tcmcs0123m000", "add" , error) )
stpapi.put.field("tcmcs0123m000","tcmcs0123.dsca","ITMG1 desc")
stpapi.put.field("tcmcs0123m000","tcmcs0123.ccur","INR")
stpapi.insert("tcmcs0123m000",true,error)
stpapi.end.session("tcmcs0123m000",error)

Can anybody help what is wrong with this code ?

Vishal

kevalghelani
10th September 2015, 08:07
Hi Vishal,


Second argument of stpapi.put.field() should be field on form.(i.e. form field or table field). It's not like 'tcmcs0123.citg' instead it should be 'tcmcs023.citg'.

So you have to replace same in all subsequent stapi.put.field() calls.

manish_patel
10th September 2015, 08:25
Two things need to be check here
1..If a record must be inserted with a synchronized single-occurrence dialog box, the dialog box must be synchronized .

2..Correct field name in stpapi.put.field() call. It should be tcmcs023.xxxx instead of tcmcs0123.xxxx

VishalMistry
10th September 2015, 11:13
Hi KevalGhelani,

Thank you very much. Now I am able to insert record.

Vishal