Load and With with local variable

Hi ,

I know it could be an silly question but as i am learner so for me need to understand Why ??

Why with is not accepting load variable and throwing Could not display interface. Please check definition and inputs. Interface Definition: Expression evaluation error : Cannot add incompatible operands of type Number (Integer) and type Null.

load(
local!c:10,

with(

local!a:10, local!b:20,

local!a+local!b+local!c)
)

 

But if we do reverse its working.

 

load(

with(
local!c:10,
local!a:10, local!b:20,

local!a+local!b+local!c)
)

Could not display interface. Please check definition and inputs. Interface Definition: Not a valid component. Received: 40

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Hi sauravk,

    Looks like you are trying to use an expression in the interface design instead of rule design.

    Same code you have shared will work good in rules.

    It throws an error in interface because interface expects a SAIL Components as an output.

    Below code works in interface because this contains Integer SAIL Component as an output

    load(
      local!c: 10,
      with(
        local!a: 10,
        local!b: 20,
        a!integerField(
          value: local!a + local!b + local!c
        )
      )
    )

Reply
  • 0
    Certified Lead Developer

    Hi sauravk,

    Looks like you are trying to use an expression in the interface design instead of rule design.

    Same code you have shared will work good in rules.

    It throws an error in interface because interface expects a SAIL Components as an output.

    Below code works in interface because this contains Integer SAIL Component as an output

    load(
      local!c: 10,
      with(
        local!a: 10,
        local!b: 20,
        a!integerField(
          value: local!a + local!b + local!c
        )
      )
    )

Children
No Data