• If this is your first visit, be sure to check out the FAQ by clicking the link above. You may have to register before you can post: click the register link above to proceed. To start viewing messages, select the forum that you want to visit from the selection below.

Announcement

Collapse
No announcement yet.

Enabling button on form only when something has Changed

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Enabling button on form only when something has Changed

    Scenario: I have a form with edit fields and save button. I want to enable the save button only when some filed has changed. I am using 'has changed' under link variable on the form but it is not working as expected.

    Please suggest if I need to configure differently.
    Attached Files

  • #2
    Is the button directly on the form widget? Assume the button has an app variable set for its disable property. Are you using the same app variable for the form widget's hasChanged property and the button's disable property?

    Providing more information or screenshots would help. Please embed screenshots directly in the post rather than attaching a document, as this makes it easier for users to view images without downloading.

    Comment


    • #3
      We are using appVariable which is assigned to hasChanged property. we have a feature which is equal to appVariable by expression. feature is assigned to the form button.
      But this is not the issue. Actually we are not loading the form, we are loading the form using program and on success we are showing the form using keep data. This way the appVariable is always set to true

      Comment


      • #4
        If I understand correctly, the default state of your form is blank. Then you apply values to it by calling some program (using SetValue and/or SetAppVar). This changes the values of the form so the hasChanged properly would be set on. Is this accurate?

        Comment


        • #5
          Yes, that’s correct. As a result, the hasChanged appVariable is always set to true in our case.

          However, from a technical standpoint, the data we load via the program initially is identical to what would be loaded if we had used a filter to open the form directly—meaning it's the original, unchanged record.

          What we’re aiming for is this: when the form is loaded via the program for the first time, the hasChanged state should remain false, since no actual user-driven changes have occurred yet. Only subsequent modifications made by the user should trigger the hasChanged variable to become true.?

          Comment


          • #6
            Why not just load your form automatically rather than programmatically setting each value?
            The hasChanged is being set to true correctly in that your default state is blank and then you are changing the values. If you load your from via the datasource then the hasChanged is reset to false until a value changes.

            Comment


            • #7
              We’re using the same form across multiple applications, and each application loads the form from different files depending on its specific functionality. Hence, we load the form programmatically.

              Comment


              • #8
                Maybe try explicitly setting your hasChanged app variable to false when programmatically loading the form.

                Comment


                • #9
                  This did not work. I tried setting the appVariable to false both programmatically and using SetAppVariable, along with the hide and show (keep data). In both cases, the appVariable remained set to true.?

                  Comment

                  Working...
                  X