lua script to disable save button?

Hello - we have a list of items that a user can tap on and view details inside a form. We want to make it so a user cannot save the form if it has been reviewed (attribute of a specific field). I beleive we can do this with filter fields and have two nearly identical screens setup but is there a way to do this in lua? We could have a cancelSave() script setup on Save but it would be nice to hide the Save button all together if the form has already been reviewed.


Thanks!

Have more questions? Submit a request

1 Comments

  • 0
    Avatar
    Sebastian.Woodland

    I'm not sure about using lua if you're using the save on the screen's menu (would probably have to do the filter field, or cancelSave() if that's the case).  But if you use a button control to do the save action all you'd have to do is something like this in the view's onLoad event:

     

    if thisview:getControl:("isReviewed"):getValue() == true

    then

       thisview:getControl("MySaveButton"):setVisible(false)

    end

     

    Hope that helps!

    -Seb

Please sign in to leave a comment.
Powered by Zendesk