jatin_sanghi
27th January 2010, 09:18
Dear All,

I'am trying to create JV entries in session tfgld1105s000 using AFS in LNFP2.

I have created a batch in tfgld1101m000 and then I run the form.command to start the session tfgld1105s000.

However, I have not been able to insert the records here and keep ending up getting the error "Command Disabled". This could be because the line entries have to be maintained on the form 2 of session and by default all fields on the form are disabled until you press the new button.
How do I go about this situation. Has anybody worked on AFS on this session, can I get any help here.

regards,

Jatin sanghi

_Ralph_
27th January 2010, 13:49
The correct forum for AFS question is this one http://www.baanboard.com/baanboard/forumdisplay.php?f=59

And post all of your script please. We'll be more able to help

tnitwahn
13th February 2010, 01:19
AFS doesn't work with session with multi main table window type( session with header and line together ). What I did to make this work is first create the financial batch and then call session tfgld1101m100.

function create.journal.voucher.trans()
{
domain tcmcs.s300m error.msg
domain tcmcs.long ret_val

stpapi.put.field( "tfgld1101m100", "tfgld101.year", str$( fyer ) )
stpapi.put.field( "tfgld1101m100", "tfgld101.btno", str$( fin.btno ) )

ret_val = stpapi.find( "tfgld1101m100", error.msg )

stpapi.put.field( "tfgld1101m100", "tfgld101.ttyp", val.ttyp )

ret_val = stpapi.find( "tfgld1101m100", error.msg )

if ret_val = 1 then
ret_val = stpapi.mark( "tfgld1101m100", error.msg )
stpapi.form.command( "tfgld1101m100", 5, "enter.transactions", error.msg )
ret_val = stpapi.change.view( "tfgld1115m000", error.msg )

stpapi.put.field( "tfgld1115m000", "tfgld102.tcom", str$( get.compnr() ) )
stpapi.put.field( "tfgld1115m000", "tfgld102.leac", val.leac )
stpapi.put.field( "tfgld1115m000", "tfgld102.dim1", val.dim1 )
stpapi.put.field( "tfgld1115m000", "tfgld102.dim3", val.dim3 )
stpapi.put.field( "tfgld1115m000", "tfgld102.dim4", val.dim4 )
stpapi.put.field( "tfgld1115m000", "tfgld102.amnt", str$( val.amnt ) )
stpapi.put.field( "tfgld1115m000", "tfgld102.dbcr", str$( etol(val.dbcr) ) )
stpapi.put.field( "tfgld1115m000", "tfgld102.refr", tccom991.sdoc )
ret_val = stpapi.insert( "tfgld1115m000", true, error.msg )

if not ret_val then
ret_val = stpapi.recover( "tfgld1115m000", error.msg )
stpapi.end.session( "tfgld1115m000" )
endif
endif
}