Skip to Content

variable in script logic to read property into another variable

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.

1.png (8.7 kB)
Add comment
10|10000 characters needed characters exceeded

  • Get RSS Feed

1 Answer

  • Best Answer
    Dec 24, 2017 at 03:49 PM

    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.

    Add comment
    10|10000 characters needed characters exceeded