Pass the values

HI team ,

I have a main Parent Interface having multiple Interface in "CHOOSE" function --> (eg : Int A , Int B , Int C)

Int C --> shows error message based on Int B ( Int C knows it by api call) . 

1.When I load the main parent Interface . 
2. Then Select Int C.
3. I press "Save Button " --> it displays error message based on api call and Conditions (which I achieved already as expected).

4.Then I goto int B. , --> then made necessary changes . 
5.I return back to Int C --> but the error message still shows (as Int C doesn't know that necessary changes are already made by Int B )

[because API call is in save BUTTON ].

Now if I press , save Button --> api call is made and necessary condition are satisfied by API value so , error message disappers.



My requirement is : Everytime I press Int C , I don't want to show error message . 
                               Error message should only be displayed after I press the Buttton . 

So , how do I make Int C aware of the Int B changes ?
Any Suggestion expect the use of "with" ?

Kind Regards

  Discussion posts and replies are publicly visible

  • It's a little hard to tell without the full SAIL code. Do you have any shared variables between your interfaces? The easiest way to me would be to save a value into a local variable in the parent interface from interface B. Then, Interface C could check the value of that local variable to determine if B is complete or not. Here's an example of the top level interface:

    a!localVariables(
      local!validationVariable: false,
      local!chooseVariable: 1
      choose(
        local!chooseVariable
        rule!InterfaceA(),
        rule!InterfaceB(local!validationVariable),
        rule!interfaceC(local!validationVariable)
      )
    )

    Then, in interface B you would need to save into the validationVariable when the appropriate changes in B have occurred. When you go to interface C, it will include the variable you have used to make the changes, so you can easily use an if() function to show the validation correctly.

  • Hi Peter ,
     Parent Interface:

    load(
    local!validationVariable: false,
    local!chooseVariable: 1
    choose(
    local!chooseVariable
    rule!InterfaceA(),
    rule!InterfaceB(),
    rule!interfaceC(displayerror : false())
    )

    Interface C

    load(
    .......,
    {
       a!buttonLayout(
       a!buttonwidget(
       label:"save",
       saveInto : if(api call=certain value,
       { 
         //neccessary changes then
         a!save(ri!displayerror,false())
       },
       {
         a!save(ri!displayerror,true())
       }
       ))),
       
       a!richTextDisplayField(
              label: "",
              value: a!richTextItem(
                text: "Please add necessary details in Interface B",
                color: "NEGATIVE"
              ),
              showWhen: (ri!displayerror)
    })



    getting the error :  The save target must be a load() variable, process variable, or node input (or a rule input passed one of those three), but instead was: false

  • 0
    Certified Lead Developer
    in reply to kasiss0001

    Your issue is that the rule input for displayError you're passing in from the parent into Interface C is not a variable (you're passing "displayError: false()", which is fine if you need ri!displayError to just hold a literal value in the sub interface, but will not work if you try to save a value into it).  You should be declaring a local variable at the parent interface and passing that into interface C.

  • You'll also need to pass the same variable into interface B so that you save whether the validation has been triggered in B (and view the result in interface C).