lsatenstein
15th September 2002, 19:39
Hi,
I would like to be able to emulate what the makejob function in baan does.
Given a variable name in a form or program script, (ex. date.f, orno.f, or enum_var, as examples) I would like to be able to assign a value to it, or to fetch it's value. It should handle all domain types.
Note:
Here are two examples:
return.code = get.value.of("orno.f",string_var)
and
return.code = set.value.to("orno.f", string_var)
In both cases, string_var should be of type string reference variable.
günther
16th September 2002, 13:03
I think you sould have a look at the online manual (http://www.baanboard.com/programmers_manual_baanerp_help_functions_expressions_runtime_expr_compile), especially at expr.compile("a:=3").
günther
lsatenstein
16th September 2002, 19:01
Hello Gunther and others
I read the details of the function before I wrote my note. It does not tell me though, what the domain is of the variable, and how I have to convert it. For example, if the variable is an enum, I would have to have the following:
a := ltoe(lval(string_val_of_enum))
I want to be able to just do the function call, without being concerned about data conversions.
To simplify matters, each variable is a member of a form. In the form the datatype(domain) is given. This information is kept in tables, and it would be most helpful to know the table names.
I could then build the fetch and assignment functions quite easily, but with some coding effort to handle all cases.
Efficiency of code is not too much of a concern. The importance is accuracy.
lbencic
16th September 2002, 20:28
Not sure what you are trying to do overall. Have you checked into the AFS programming? You can simulate session actions, including placing fields on a form and get values back. It's all done in string format, where the conversions are done by the AFS preprogrammed functions. You just need to know what session and what form field - does that sound like what you need?
This link leads to the latest AFS documentation.
<<http://www.baanboard.com/baanboard/showthread.php?s=&threadid=6211>>