Local variable in button saveInto is not saving on one click.

Certified Senior Developer

A cancel button has to save one rule input and one local variable value. If we click on the button once only the rule input changes but the local saving happens only after 2 nd click. If we remove the rule input then it is working. But we need both ri and lccal variable to save its respective values at the first click of button. PFA for the code snippet. Help me on the solution

a!buttonWidget(
              label: cons!PHSREC_BTN_LBL_CANCEL,
              style: "NORMAL",
              value: 3,
              saveInto: {
                local!currentPage,
                a!save(ri!buttonAction,cons!PHSREC_BUTTON_ACTION[6])
               
              },
              validate: false,
              showWhen: local!currentPage = 1              
            ),

  Discussion posts and replies are publicly visible

Parents
  • The saveInto parameter looks correct in general.  However I would note that you have the button set to disappear after it's clicked, since it's set to show up when local!currentPage has a value of "1" and clicking it should save a value of "3" to that variable.  You should probably simplify the on-form activity a bit and then understand what's happening, then re-add things one at a time making sure they're behaving as expected with each iteration.  Whatever your issue is though, it shouldn't be the saveInto configuration in particular that's causing it.

Reply
  • The saveInto parameter looks correct in general.  However I would note that you have the button set to disappear after it's clicked, since it's set to show up when local!currentPage has a value of "1" and clicking it should save a value of "3" to that variable.  You should probably simplify the on-form activity a bit and then understand what's happening, then re-add things one at a time making sure they're behaving as expected with each iteration.  Whatever your issue is though, it shouldn't be the saveInto configuration in particular that's causing it.

Children