Skip to main content
1-Visitor
July 19, 2021
Solved

Repeat Region Relation and Cagec issue

  • July 19, 2021
  • 1 reply
  • 1217 views

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.

Best answer by TomU

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

1 reply

TomU23-Emerald IVAnswer
23-Emerald IV
July 19, 2021

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
kspabs1-VisitorAuthor
1-Visitor
July 19, 2021

Awesome, this fixed it exactly and makes sense why I was seeing this behavior. Thank you!