hardei
18th February 2008, 12:39
Dear frnds,

I am working on baan 5.Writing a AFS Script to add record in conversion Factor(tcibd0103m000).It is a Form Type 3 session.It is not giving any error but record is not adding

Please see the following AFS script and also find attached Screenshot of session

stpapi.put.field("tcibd0103m000","tcibd003.item",tcibd001.item)
stpapi.put.field("tcibd0103m000","tcibd003.basu","NOS")
stpapi.put.field("tcibd0103m000","tcibd003.citg",tcibd001.citg)
ret1 = stpapi.change.view("tcibd0103m000",error)
stpapi.put.field("tcibd0103m000","tcibd003.unit","KG ")
stpapi.put.field("tcibd0103m000","tcibd003.conv",str$(1/tcibd001.wght))
stpapi.insert("tcibd0103m000",0,error)
stpapi.save("tcibd0103m000", error)
stpapi.end.session("tcibd0103m000")

Please Revert Guys

Regards,
Hardei

mark_h
18th February 2008, 14:10
Your code says tcibd0103m000 and yet the screen shot is for tcibd0103mc01? Does this have something to do with synchronized sessions and such? I do know anything about 5 or higher, yet I would not expect the above code to work if the session number is not correct.

hardei
19th February 2008, 05:06
Hi Mark,

Thanks for your reply.Session tcibd0103mc01 and tcibd0103m000 is same.There is no synchronized session.

Please find attached screen shot of tcibd0103m000

Regards,
Hardei

mark_h
19th February 2008, 16:32
Have you tried the insert with a 1 instead of 0? Have you tried putting all the fields after doing the change view? After you tried putting all the fields on the form? All are possibilities - do you have source code to debug the session?