Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5

Updating a record
#1

Hi - revisiting Appli to see how its coming along and hope to subscribe soon. It looks great by the way. I am running into a problem updating a record using submit_form_to_db. The form has the RecordID set via set_variable_from_context variable "selected" from a listings page, but the update never happens. What could it be that I'm missing?
Reply
#2

Hello Jose,

Thank you for checking in on Appli, we are working hard to create a great user experience.
Let me test the problem you are describing and I will get back to you.
We recently updated that action.
Thank you, 

Tom
Reply
#3

Jose,

Just a followup, on your other screen where the ID variable is set.  Are you using a table ? a layout?
Is the table or the layout setting the variable you are using?
Any additional info you may give me about the way the variable is set can help. 

Thank you,

Tom
Reply
#4

(12-29-2022, 09:34 PM)tomglod Wrote:  Jose,

Just a followup, on your other screen where the ID variable is set.  Are you using a table ? a layout?
Is the table or the layout setting the variable you are using?
Any additional info you may give me about the way the variable is set can help. 

Thank you,

Tom

Hi Tom -  it's a Layout and the row has a clickable button that just has set_variable_from_context variable "selected"  and then a 'go_to_screen xxx'
Reply
#5

Hello Jose,

Happy New Year.

I created a sample app with that setup and I was able to successfully update my records from the form as you describe.

Can you check your:
populate_form_data to make sure the variable is set correctly? (I used this on OpenScreen) on the screen that contains the form to update the record.

Please check that the same variable is selected on both the populate_form_data and submit_form_to_db

Let us know if that is correct, if so, we will have to try to diagnose your problem in another way.

Sorry for the inconvenience.

Tom
Reply
#6

(01-02-2023, 05:53 PM)tomglod Wrote:  Hello Jose,

Happy New Year.

I created a sample app with that setup and I was able to successfully update my records from the form as you describe.

Can you check your:
populate_form_data to make sure the variable is set correctly? (I used this on OpenScreen) on the screen that contains the form to update the record.

Please check that the same variable is selected on both the populate_form_data and submit_form_to_db

Let us know if that is correct, if so, we will have to try to diagnose your problem in another way.

Sorry for the inconvenience.

Tom

Hi Tom, any chance you can send or attach the sample app?
Reply
#7

Hello José,

Happy new year. I just wanted to let you know that there is a new tutorial at:

Database Tutorial

Which shows how to implement the workflow you describe, including going from a list of records into editing a single record and back.

- André
Reply
#8

(01-06-2023, 03:53 PM)agarzia Wrote:  Hello José,

Happy new year. I just wanted to let you know that there is a new tutorial at:

Database Tutorial

Which shows how to implement the workflow you describe, including going from a list of records into editing a single record and back.

- André

Hi Andre - thank you, this is the tutorial I tried. A subtle difference I notice is that the submit_form_to_db command now contains an argument for RecordID but it isn't shown in the tutorial. I tried both "selected_contact", "RecordID", and setting the variable manually for the form Save action to use but with no luck yet.
Reply
#9

(01-07-2023, 03:29 PM)rjose Wrote:  Hi Andre - thank you, this is the tutorial I tried. A subtle difference I notice is that the submit_form_to_db command now contains an argument for RecordID but it isn't shown in the tutorial. I tried both "selected_contact", "RecordID", and setting the variable manually for the form Save action to use but with no luck yet.

rjose,

I'll double check everything first thing on Monday. I'll update the tutorial if needed and get back to you here on the forum. Thanks a lot for checking the tutorial out :-)
Reply
#10

(01-07-2023, 03:29 PM)rjose Wrote:  Hi Andre - thank you, this is the tutorial I tried. A subtle difference I notice is that the submit_form_to_db command now contains an argument for RecordID but it isn't shown in the tutorial. I tried both "selected_contact", "RecordID", and setting the variable manually for the form Save action to use but with no luck yet.

rjose,

That second argument is a variable that will hold the RecordID of the saved or newly inserted record. It is Appli that fills in the value for that variable after it submits the form.

If you're inserting a new record and the form's RecordID property is empty, that second argument will be filled with the ID of the new record.

If you are editing an existing record — which means the form has its RecordID property set to the record you want to edit — then that second argument will be filled with the same RecordID as the one you set the form to.

We're working to make that argument optional in the next release of Appli, in the meanwhile you can simply set it to the selected_contact variable or create a new variable if you prefer, something like saved_record.

I've updated the documentation to account for that variable, thanks a lot for bringing it to our attention.

- André
Reply


Forum Jump:


Users browsing this thread: 3 Guest(s)