jholdrid
1st March 2002, 18:24
I am new to using Baan API calls. My users have requested that
they have a single key stroke to execute tipcf5280s000.

My buffer is filled correctly and the session starts correctly wtih the following code.

stpapi.put.field("tipcf5280s000", "proj.code", tdsls041.cprj)
stpapi.put.field("tipcf5280s000", "pvar.code", tdsls041.cpva)
stpapi.put.field("tipcf5280s000", "item.code", tipcf500.item)

stpapi.continue.process("tipcf5280s000", o.mess)

After the user would hit the continue button of the session, several question dialog boxes
pop up. THe api script appears to blow right by these questions (I have used the
debugging tools to analyze). My Bill of materials consequently does not reflect any
configurator modifications.

I have placed the following code both before the stpapi.continue.process and after
with the same results. The stpapi.enum.answer scripts change the default answers -
but I have removed these calls and modficied the questions to be the ones that I
want and the api session still by passes these questions.

stpapi.enum.answer("tipcf5280s000", "tipcf52805", tcyesno.no)
stpapi.enum.answer("tipcf5280s000", "tipcf51208", tcyesno.no)
stpapi.enum.answer("tipcf5280s000", "tipcf52806", tcyesno.yes)

Can anyone make a suggestion as to how I get the questions to be asnwered and
the process to work. I do not have access to Baan code to review what is happening
within this session.

Thanks

mark_h
1st March 2002, 19:45
The stpapi.enum.answer scripts change the default answers - but I have removed these calls and modficied the questions to be the ones that I
want and the api session still by passes these questions

Not sure I understand that statement. Could you clarify this? When I read this it sounds like you have removed the stpapi.enum from the function server script AND changed the questions(where?) to the ones you want, not the ones the session uses. So I got a little lost on this.

First the stpapi.enum.answer must be before the question is asked. So I usually put these first, before I even do stpapi.put.field.

Also since this is a subsession I assume it activates correctly from the main session your are using? Sorry bout all the questions. Also we do not own source and we do not use this session, so I do not know how it works.

You could always try defaulting the answers to what you want. Not my choice, but that may also give you a solution.

Mark

jholdrid
1st March 2002, 21:37
Mark

I di try defaulting the answers. I removed the stpapi.enum from the function server script after
using standard Baan -> Tools -> Application Development ->
messages and questions -> Questions maintenance session to change the default of the three
questions that this session presents to the interactive user.

However, the session still did not perform the way that it should. THe Bill of materials of the custom item should have been rebuild and it was not.

When the session is run it prompts for the 1.) project 2.) the Variant and the 3.) the generic Item. Then the user would hit
<continue>. The user is then prompted with three questions-
1.) tipcf52803 Activate Product Configurator ? (default = yes)
2.) tipcf51208 Calculate Sales PRice for Prduct Variant ? (default = yes)
3.) tipcf52806 Generate Product Varaint structure ? (default = no)

I have done a tools dump and the session does appear to activate correctly from a custom session that I wrote.

Thanks for your help

mark_h
1st March 2002, 23:45
Just remembered that I once tried to change a default value on the question and because Baan had coded ask.enum(question,tcyesno.yes), I could not change it using the maintain questions session. I bet that is the same problem you are running into.
If that is the case then I am not sure how you would get this to work, at least not without source code. Hopefully one of the real gurus will come to your rescue. :)

Maybe someone with the source can confirm this?

Sorry I am no help at all.:(

Mark

dbclark79
5th March 2002, 05:04
The "ask.enum" function is being used in tipcf5280:

| Activate product configurator?
if ask.enum("tipcf52805",empty) = tcyesno.yes then . . .

| Generate product variant structure?
if ask.enum("tipcf52806",empty) = tcyesno.yes then . . .


-David

mark_h
5th March 2002, 15:05
With what David has posted, when you changed the default answers it should have carried across to your function server. When you changed the default answers did it carry across to running the session manually? If it did then I do not know why the function server did not pickup these answers. Or have you already solved it?

Mark

jholdrid
5th March 2002, 16:23
Mark and David

Thanks for you help.

I have not as yet solved my problem. I believe that I will need to know how to answer an ask.enum per an API call in order to
make this work.