Community Tip - You can Bookmark boards, posts or articles that you'd like to access again easily! X
I have the following relation in my relations for a BOM that simply removes the specified cage code:
IF exists("asm_mbr_cagecode")
IF asm_mbr_cagecode == "12345"
my_cagecode = " "
ELSE
my_cagecode = asm_mbr_cagecode
ENDIF
ENDIF
Which has worked as intended, EXCEPT I am now noticing that there are a few parts in my BOM that are pulling the incorrect cage code from another unrelated part. Without the relation, I don't have this issue. Not sure where this issues may be coming from.
Solved! Go to Solution.
Makes sense. "my_cagecode" is a repeat region level parameter and it's value is static unless something changes it. When "asm_mbr_cagecode" doesn't exist, there is nothing to change "my_cagecode" to some other value. You need to either pre-initialize "my_cagecode" or add an extra ELSE statement.
my_cagecode = " "
IF exists("asm_mbr_cagecode")
IF asm_mbr_cagecode == "12345"
my_cagecode = " "
ELSE
my_cagecode = asm_mbr_cagecode
ENDIF
ELSE
my_cagecode = " "
ENDIF
Makes sense. "my_cagecode" is a repeat region level parameter and it's value is static unless something changes it. When "asm_mbr_cagecode" doesn't exist, there is nothing to change "my_cagecode" to some other value. You need to either pre-initialize "my_cagecode" or add an extra ELSE statement.
my_cagecode = " "
IF exists("asm_mbr_cagecode")
IF asm_mbr_cagecode == "12345"
my_cagecode = " "
ELSE
my_cagecode = asm_mbr_cagecode
ENDIF
ELSE
my_cagecode = " "
ENDIF
Awesome, this fixed it exactly and makes sense why I was seeing this behavior. Thank you!