Paul P
14th October 2002, 07:44
Dear all,

As part of the automation of update process of PBOM with EBOM, we wanted to automate Generate E-BOM copy data (multi level). In normal usage, we only need to fill in the e-item field and the rest of the fields in this session will be updated automatically, hence allowing continue button to be pressed right after. I use stpapi.put.field to enter e-item there then follow it right with a stpapi.form.command. I read from the AFS documentation that stpapi.form.command would execute the field sections if used on type 4 forms, hence it should've filled all the other fields based on the e-item field. However, the API program returns an error saying that one of the field (revision code) was not filled up. This means that some of the field sections are not executed

Is our API not configured properly or the documentation is wrong? We're on BaanERP SP7 with porting set 7.1.c.03. Thanks very much

Rgds,
Paul

mark_h
14th October 2002, 15:41
Sometimes you will have to fill fields that get defaulted when running in manual mode. It depends on how the session handles these fields. I would try giving it a revision to see if that solves the problem. There may be other fields that have problems also.

Good Luck!

Mark

NPRao
14th October 2002, 20:22
Most of the BaaN programs are not coded well to handle the AFS/API.

Hence you need to modify the script and add additional step to your script to clear that sessions defaults (AFS/API call to ttstpdeldeflt).


|****************************** group section **********************************
group.1:
init.group:
if not (api.mode or job.process or background) then
get.screen.defaults()
|* OR set.fields.default()
endif
if api.mode then
remove.sessions.defaults()
|* the afs/api call to ttstpdeldeflt
endif

I hope it helps you out.

Paul P
15th October 2002, 12:33
Thanks Mark and NPRao!
Guess trial and error would be required and I shouldn't simply trust the AFS manual. Thanks for your prompt reply

Rgds,
Paul