baanprog
17th January 2007, 17:28
Hi,

Iam trying create Patch automatically from "Components by patch Code" and "cont.process". My code is as below


ret = stpapi.find("ttiex4110m000",errmsg)
stpapi.put.field("ttiex4110m000", "ttiex410.paco", "DF12345")
ret = stpapi.find("ttiex4110m000",errmsg)
if ret = 1 then
stpapi.set.report("ttiex4110m000", "rttiex128001000", spool.dev, errmsg)
stpapi.enum.answer( "ttiex4110m000", "ttiex41101", tcyesno.yes )
stpapi.form.command( "ttiex4110m000", 1, "exec.cont.process", errmsg )
stpapi.end.session("ttiex4110m000")
endif


Also the AFS Log is as below, which also doesnt raise a trigger


>ttiex4110m000 Find
79->get.fields
79<-get.fields0ttiex410.paco1ttiex410.comp1ttiex410.cpac1ttiex410.code1ttiex410.clan1ttiex410.clan(2)1ttiex410.clan(3)1ttiex410.clan(4)1ttiex410.clan(5)1ttiex410.clan(6)1
79->def.find
79<-def.find01
<ttiex4110m000 record found (1)
>ttiex4110m000 put.field:ttiex410.paco DF12345
>ttiex4110m000 Find
79->def.find
79<-def.find01
<ttiex4110m000 record found (1)
>ttiex4110m000 set.report
79->set.reportrttiex128001000D
79<-set.report0
<ttiex4110m000
>ttiex4110m000 enum.answer ttiex41101:1
79->enum.answerttiex411011
79<-enum.answer0
>ttiex4110m000 form.command command type: 1 command prog: exec.cont.process
79->form.command1exec.cont.process
80<-api.child.startedttiex1280s00079
79<-form.command0
<ttiex4110m000
>ttiex4110m000 end.session
79->end.program
79<-end.program0
79<-exit.child


Unfortunately still the patch does NOT get created.
Thanks for your help

mark_h
17th January 2007, 18:09
Are you are baan 4 or 5? You profile says 4 - I would expect stpapi.continue instead for the form command.

baanprog
18th January 2007, 14:30
Hi,

Sorry for missing it out...

Iam on BaanVb SP8

Regards

mark_h
18th January 2007, 16:47
Okay - then form command is correct. I really do not know anything about these sessions, but here is a stab.

You might want to make sure ttiex1280s000 is launched and controlled by tties4110m000. Also is the report on ttiex4110m000 or is it on ttiex1280s000. From the number it looks like the report is actually on ttiex1280s000 - so your report would be set on that session. I can not promise this will work. There have been problems when a main session launches a subsession that processes data. Since these are tools sessions I can not even recommend a work around.

Good Luck!

mark_h
18th January 2007, 23:14
Had a few minutes to look at some of these ttiex session - it looks like there is a ttiex1280m000. Can you just read what is in the patch and pass it to ttiex1280m000 to create a patch? To me it looks like ttiex4110m000 just feeds the components to ttiex1280. Maybe that is another solution.

RobertB
6th March 2007, 11:44
Looks like your second parameter (command.type) in your form.command call is wrong: it should be 5, not 1:

stpapi.form.command( "ttiex4110m000", 5, "exec.cont.process", errmsg )

From the AFS help:

SYNTAX

void stpapi.form.command(string session, long command.type,
string command.prog, ref string err.mesg)

ARGUMENTS

session Name of the session this command is executed on.
command.type The type of form command to be executed. The following
values apply:
2 - session
5 - function
command.prog The code of the session or the name of the function to be
executed.
err.mesg This parameter will contain the text of the error message if the
function cannot complete normally.
In your case, you are calling the "exec.cont.process" function.

HTH, Rob