Skip to main content
Inspiring
Apr 28, 2022 5:23 AM UTC
Solved

Submit Link - functionality for cancel button

Hi,

Can we include logic so that when we click cancel, the other local variable logic changes?

a!localVariables(
  local!val:2,
  a!linkField(
    links: {
      a!submitLink(
        label: "Delete Request",
        saveInto: a!save(local!val,local!val+1),
        confirmHeader: "Warning!",
        confirmMessage: "This request will be permanently deleted. Do you want to continue?",
        confirmButtonLabel: "Delete Request",
        confirmButtonStyle: "DESTRUCTIVE",
        cancelButtonLabel: "Cancel"
      )
    }
  )
)

harshitb6843
Brainy
Apr 28, 2022 12:41 PM UTC

No. If you're talking about the buttons on the confirmation message, then no, you cannot do it. Rather place two buttons on the screen itself? 

3 replies

harshitb6843
Brainy
Apr 28, 2022 6:18 AM UTC

I didn't get the quite well but the code you have attached works well. 
Each time you click on the button, the value of the local variable increases by 1

Inspiring
Apr 28, 2022 6:21 AM UTC

yes [mention:ef600ff8f5d2497eb2def2126dc89484:e9ed411860ed4f2ba0265705b8793d05]

for example. when I click on cancel button it should decrease the value by 1.

I want to include both logic, when the update or cancel buttons is clicked. Is that possible using submit link?

harshitb6843
Brainy
Apr 28, 2022 12:41 PM UTC

No. If you're talking about the buttons on the confirmation message, then no, you cannot do it. Rather place two buttons on the screen itself?