cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

variable in script logic to read property into another variable

Former Member
0 Kudos
281

Hi,

I've created property PARENT to dimension ENTITY and trying to read Interco value of every entity's parent in scriptlogic but it's not working out with below code.I've googled forums for many threads but surprisingly i still can't get a solution hoping someone could guide me in right direction.

*XDIM_MEMBERSET ENTITY = BAS(G_A)
*XDIM_MEMBERSET ACCOUNT = CYNI
*FOR %ENT% = ENTITY
*WHEN INTERCO
*IS "NO_INTERCO"  
// Select Value from PARENT property of "ENTITY= %ENT%" to %PARENT% variable
*SELECT (%PARENT%, "[PARENT]", ENTITY, "[ID]='%ENT%'")  
// Select Value from INTCO property of "ENTITY=%PARENT%" to %INTCO% variable
*SELECT (%INTCO%, "[INTCO]", ENTITY, "[ID]='%PARENT%'")  
*REC(FACTOR=1 , INTERCO = %INTCO%)
//REC(FACTOR=1 , INTERCO = %PARENT%.INTCO)  // this also not working
//REC(FACTOR=1 , INTERCO = "I_" + %PARENT%)  // this also not working
*ENDWHEN
*NEXT

Here is the error i'm getting

UJK_VALIDATION_EXCEPTION:Member "" not exist

if i replace *REC(FACTOR=1 , INTERCO = %INTCO%) with *REC(FACTOR=1 , INTERCO = I_B) I'm getting records generated. So, looks like SELECT is not storing variables. How could i do this? I made sure that ENTITY has values for PARENT and INTCO properties as shown below.

Accepted Solutions (1)

Accepted Solutions (1)

former_member186338
Active Contributor
0 Kudos

You need to understand some very basic things about script logic:

1. SELECT can't be used inside WHEN/ENDWHEN (and inside FOR/NEXT), it's executed only once at the beginning of script execution.

2. Instead of property PARENT create property PARENTINTCO and fill it with I_B for this sample.

Then:

*WHEN INTERCO
*IS "NO_INTERCO"
*REC(FACTOR=1 , INTERCO = ENTITY.PARENTINTCO)
*ENDWHEN

And remove FOR/NEXT loop for ENTITY - useless

No other way.

Former Member
0 Kudos

Thanks Vadim. I created the same way and got it working. Wanted to check if there is other way of achieving so asked.

former_member186338
Active Contributor
0 Kudos

There is now way to define destination member like:

DIMNAME1=DIMNAME2.PROPERTY1.PROPERTY2

Answers (0)