sandeepsharma
15th April 2009, 09:09
Hi friends,

I am getting an error "Insert not allowed for this group" while inserting the data through afs.
I am using the following code:

stpapi.put.field( "tfcmg2120s000", "tfgld102.cono", str$(comp) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.year", str$(yr) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.btno", str$(btno) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.ttyp", ttyp )
stpapi.put.field( "tfcmg2120s000", "tfgld102.docn", str$(docn) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.lino", str$(1) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.serl", str$(1) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.srno", str$(1) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.tcom", str$(comp) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.leac", tficc962.leac )
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim1", tficc962.dim1 )
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim2", tficc962.dim2 )
stpapi.put.field( "tfcmg2120s000", "tfgld102.dim3", tficc962.dim3 )
stpapi.put.field( "tfcmg2120s000", "tfgld102.amnt", str$(tficc962.amnt) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.dbcr", str$(etol(tficc962.dbcr) ))
stpapi.put.field( "tfcmg2120s000", "tfgld102.fyer", str$(yr) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.fprd", str$(period) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.vyer", str$(yr) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.vprd", str$(tax.period) )
stpapi.put.field( "tfcmg2120s000", "tfgld102.refr", str$(tficc962.refr) )
ret = stpapi.insert( "tfcmg2120s000", do.update, error )
if isspace(error) then
ret = stpapi.save( "tfcmg2120s000", error )
else
message("%s",error)
endif
stpapi.end.session( "tfcmg2120s000" )




regards,
Sandeep

mark_h
15th April 2009, 15:11
Are you calling this session directly or through a main session? Can you get the message number and maybe track it to a specific field? I am just wondering if cono, year and btno are needed - should come from the main session.

sandeepsharma
16th April 2009, 07:00
Hi,

Yeah i am calling this session from session tfcmg2100s000 which in turn is called from tfgld1101m000.


Sandeep

mark_h
17th April 2009, 23:06
What happens if you remove those fields? Have you tracked the error to one specific field on the form? I see nothing else out of the ordinary.

sandeepsharma
18th April 2009, 10:15
Hi Mark,

Actually i am facing a different issue now. AFS recognises TAB command, but in tfcmg2100s000 we need to do a mouse click if we want to generate new document in the same batch.

Is this possible?????


thanks
Sandeep

mark_h
21st April 2009, 15:52
As far as I know AFS does not recognize a tab command. There is not a api command to simulate tab - so you can't enter a field and execute a tab. Certain events are just not processed in AFS. As for "a mouse click" - are you clicking a button? If you click on a button then you should be able to activate that button with an API command or in some cases just a continue.

sandeepsharma
22nd April 2009, 06:58
Hi,

By recognisation of TAB, i mean to say that we can only fill all those fields through AFS which we TAB through while navigating through a session .

Now in tfcmg2100s000, when i want to enter a new document in the same batch in order to get the new document number i have to go to field Document(tfcmg204.docn) and do a mouse click over there otherwise the session by default gives me the 2nd line of the previous document of the same batch.


Please suggest is there a way to do this through AFS?


Thanks
Sandeep

mark_h
22nd April 2009, 16:56
Lots of things to try, but without know the session I am not sure what will help. First only put those fields that you would normally put. docn will be generated. After putting the fields try the insert. If that does not work try update, followed by a save. If you have source it makes it easier since you can debug the session to see which command would work. In my case I just play with the various commands until I figure out the correct sequence.