Code not behaving same when I used localVariable with fixed number, expressionrule

Hi Experts,

Below Block-A code line is working fine, whereas Block-B is not working even though "tointeger(index(rule!AB_getReviewKey(key: 100),"reviewkey",null()))" is returned 2.

Any comments please.

----------------------- Block-A -------------------------

a!localVariables(
local!reviewkey: 2,
local!excludeKeys: if(
local!reviewkey = 2,
{ 1, 3, 4},
if(local!reviewkey = 5, { 1,3,4,5,6 }, {1,2,3 })
),
local!excludeKeys
)

----------------------- Block-B -------------------------

a!localVariables(
local!reviewkey: tointeger(index(rule!AB_getReviewKey(key: 100),"reviewkey",null())),
local!excludeKeys: if(
local!reviewkey = 2,
{ 1, 3, 4},
if(local!reviewkey = 5, { 1,3,4,5,6 }, {1,2,3 })
),
local!excludeKeys
)

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Associate Developer

    Can you please provide us with more info like the error message or something like output so that so that we can tell what wrong is going on.

  • In the first, second screen shots I am getting the required o/p where as in last screen shot, instead of getting an array o/p, I am just getting 1 as an o/p and which is of type List of Number (integer).

    a!localVariables(
    local!reviewkey: 2,
    local!excludeKeys: if(
    local!reviewkey = 2,
    { 1, 3, 4},
    if(local!reviewkey = 5, { 1,3,4,5,6 }, {1,2,3 })
    ),
    local!excludeKeys
    )

    o/p: 

    -------------------

    a!localVariables(
    local!reviewkey: 5,
    local!excludeKeys: if(
    local!reviewkey = 2,
    { 1, 3, 4},
    if(local!reviewkey = 5, { 1,3,4,5,6 }, {1,2,3 })
    ),
    local!excludeKeys
    )

    o/p: 

    ----------------------

    a!localVariables(
    local!reviewkey: tointeger(index(rule!AB_getReviewKey(key: 100),"reviewkey",null())),
    local!excludeKeys: if(
    local!reviewkey = 2,
    { 1, 3, 4},
    if(local!reviewkey = 5, { 1,3,4,5,6 }, {1,2,3 })
    ),
    local!excludeKeys

    )

    O/P:

Reply
  • In the first, second screen shots I am getting the required o/p where as in last screen shot, instead of getting an array o/p, I am just getting 1 as an o/p and which is of type List of Number (integer).

    a!localVariables(
    local!reviewkey: 2,
    local!excludeKeys: if(
    local!reviewkey = 2,
    { 1, 3, 4},
    if(local!reviewkey = 5, { 1,3,4,5,6 }, {1,2,3 })
    ),
    local!excludeKeys
    )

    o/p: 

    -------------------

    a!localVariables(
    local!reviewkey: 5,
    local!excludeKeys: if(
    local!reviewkey = 2,
    { 1, 3, 4},
    if(local!reviewkey = 5, { 1,3,4,5,6 }, {1,2,3 })
    ),
    local!excludeKeys
    )

    o/p: 

    ----------------------

    a!localVariables(
    local!reviewkey: tointeger(index(rule!AB_getReviewKey(key: 100),"reviewkey",null())),
    local!excludeKeys: if(
    local!reviewkey = 2,
    { 1, 3, 4},
    if(local!reviewkey = 5, { 1,3,4,5,6 }, {1,2,3 })
    ),
    local!excludeKeys

    )

    O/P:

Children