zakir_h
2nd April 2007, 11:18
Hello,
Can any one tell me how i can refer to the Generic BOM item code in the validation constraint section .i.e; i want to use the item code in the constraint while validating the BOM item .
thanks,
Zakir
Andreas
3rd April 2007, 08:29
Can any one tell me how i can refer to the Generic BOM item code in the validation constraint section .i.e; i want to use the item code in the constraint while validating the BOM item .
Have a look on these threads
http://www.baanboard.com/baanb... (http://www.baanboard.com/baanboard/showthread.php?t=12507)
http://www.baanboard.com/baanb... (http://www.baanboard.com/baanboard/showthread.php?t=6487)
Hope this helps,
Andreas
zakir_h
3rd April 2007, 10:28
Hi Andreas,
I had already taken a look at the above threads... unfortunately they do not serve my purpose... all i want to do is get hold of the generic BOM component at the time of validating it, because my validation is based on the certain characters of the item code. like if u see in the attachment the item code
[ 3G20AB0G0200] contains the material code , the thickness of gasket and etc.. and i need to validate the BOM component based on the features the customer selects.
Pls .take a look at the attachement for clear explanation.
The script of the validation constraint which i am using is as follows
string gmtl global
string gins global
string gthk global
if tipcf310.sitm(14;2) = gmtl then
if tipcf310.sitm(16;1) = gins then
if tipcf310.sitm(18;2) = gthk then
validate = true
endif
endif
else
validate = false
endif
the above three variables are being stored in the respective validation constraints of the product features.
hope i am clear now.
Regards
zakir
Andreas
4th April 2007, 10:06
Hi zakir,
i really understand your needs.
But your code is wrong. You can't use tipcf310.sitm directly but have to import it to a local variable.
Something like
string gmtl global
string gins global
string gthk global
domain tcitem testitem
import("tipcf310.sitm", testitem)
if testitem(14;2) = gmtl then
if testitem(16;1) = gins then
if testitem(18;2) = gthk then
validate = true
endif
endif
else
validate = false
endif
Hope this helps,
Andreas
zakir_h
4th April 2007, 14:32
Hi Andreas,
I have tried with your code... but it gives an error.. i have attached a screen shot for you to take a look. The code after changing is like this which is same as yours.
string gmtl global
string gins global
string gthk global
!domain tcitem testitem
!import("tipcf310.sitm", testitem)
if testitem(14;2) = gmtl then
if testitem(16;1) = gins then
if testitem(18;2) = gthk then
validate = true
endif
endif
else
validate = false
endif
can't figure out why is the compilation error coming.
In one of the threads which u mentioned in your earlier mail, i saw that exclamation marks is not required in 5.0c but if i remove it then gives the error "cannot execute command".
regards
zakir
Andreas
11th April 2007, 10:22
Hi zakir,
the message that you attached is normal because the configurator tries to execute the constraint in interpreter mode. By the way, have you set the pcf-parameter version of pcf to object-version? This is necessary if you wan't to use the whole bunch of 3-gl functions.
After that you have to compile the generic item and it should work.
Oh, and the possibility of importing tipcf310.sitm was not there from the beginning because initially the pcf sources where capsulated. Then there was a solution where they defined the variables as extern so they can be used in constraints. I'm sorry but i can not find the solution number at the moment. Have a look on the support site. Maybe you will find it there.
Hope this helps,
Andreas