sathasivan
27th April 2005, 03:55
Hi all

we are using BaaN Vc.

Can we use or call one constraint into other constraint in BaaN PCF constraint definition?

This is required to split the lengthy constraint into two or three constraint wherein the repeated validations or codes can be defined as one constraint and the same can be called into other many constraints. It saves lot of time and need not write the same code repeatedly.

If so, what is the syntax for the same?

Thanks in advance.
Sathasivan

Andreas
27th April 2005, 08:38
Hi Sathasivan,
fom a technically point of view this should be possible. You have to know how the constraints are converted into functions in the pcf-object.
Compile constraints with flag 'delete source' set to 'no'. After that you can see the generated sourcefile in the source-file path maintained in the compile session.
You should be able to call the constraint via function-name.
Nevertheless i would advise you to put your reused code into a dll and call this from out of your constraints.
That's the way we did it and it works fine for us.

Hope this helps,
Andreas

steveauckly
27th April 2005, 15:18
I agree with Andreas, use a library. Then when you compile your generic item, use the "-d libraryname" compile option. We had to modify the Baan standard tipcf2201m000 to add a compile options field to the form.

p.cole
27th April 2005, 21:10
I agree with Andreas, use a library. Then when you compile your generic item, use the "-d libraryname" compile option. We had to modify the Baan standard tipcf2201m000 to add a compile options field to the form.

This is not a requirement. it is still possible to use a dll from within a constraint without modifing standard Baan sessions. Use the dll functions in the programmers manual, load_dll(), get_function() and exec_function() from within the constraint.

steveauckly
27th April 2005, 21:14
depends how often you want to use a library function. If every constraint loads a dll, gets a function, etc, it slows down quite a bit. Most of our constraint code is in libraries which is why we do it the way I described.

sathasivan
29th April 2005, 05:07
Thanks to all

I will try with dll functions and call them whereever it is required.

Thanks once again
Sathasivan K

Eddy G
5th July 2006, 10:30
Folks,

You could also use (example):

!#pragma used dll "otcmcsdll0010"
![f2] = tcmcsdll0010.test.function()

in the constraint-text.

Regards,
Eddy

sathasivan
6th July 2006, 02:42
Thanks Eddy
I will try your method also.
regards
Satha