Expand my Community achievements bar.

SOLVED

How to refresh data fetch from database

Avatar

Level 3

Hi everybody

I have an Adaptive Form and I populate a dropdown list with a get-service defined in a Form Model in Data Integration section

I made a rule on an input text field ( on Value Commit -> call the service and get data -> populate the dropdown list with data )

If I update a record in the database and I call again the service, the json that I receive doesn't update! :-(

I checked on the db and the data are updated, but I can't figure out how to see the update in my service

Any suggestion??

Thank you everyone!!

Fabio

1 Accepted Solution

Avatar

Correct answer by
Employee Advisor

Can you please test the same in FDM UI, does the test for Get service refreshes the result or not? Next thing to validate in your form would be the event i.e 'Value Commit '.

Value commit in case of textbox would require you to exit the field, if you want the dropdown to be preloaded in the form you can just call the service on form initialise and if the values in the case of the dropdown are so dynamic that list can refresh anytime, you might require some better event handling,

Thanks,

Mayank

View solution in original post

6 Replies

Avatar

Correct answer by
Employee Advisor

Can you please test the same in FDM UI, does the test for Get service refreshes the result or not? Next thing to validate in your form would be the event i.e 'Value Commit '.

Value commit in case of textbox would require you to exit the field, if you want the dropdown to be preloaded in the form you can just call the service on form initialise and if the values in the case of the dropdown are so dynamic that list can refresh anytime, you might require some better event handling,

Thanks,

Mayank

Avatar

Level 3

Hi Mayank

Yes, I first checked in FMD UI before posting the question...in fact, I thought some kind caching-problem but I think it's not!

Probably you're right...I need an EventHandler more specific...maybe in the Javascript-side of the Form!

Thank you anyway!

Your suggestions are always useful!

Avatar

Employee Advisor

Np! Fabio, Let me know if you need any further suggestion.

Avatar

Level 3

Hi Mayank

I noticed something "strange":

if I make some changes in the database (for example I have a table called "companies" and I add a new record),

FDM UI doesn't notice the change if I test the service getAllCompanies

...but if I shutdown my AEM Instance and I re-run and test again...the record shows up!

I can't define what kind of problem it is! Can you help me?

Thanks from now on

Fabio

Avatar

Employee Advisor

Hi Fabio,

Though I have tested this scenario previously, let me test this again and confirm you back. Kindly confirm what is the forms-add package deployed on your instance,

Thanks,

Mayank

Avatar

Level 3

adobe-aem-forms-pkg-6.1.6

Other add-ons

forms-foundation-qs-content-2.1.2

adobe-lc-forms-runtime-pkg-6.1.6

adobe-lc-forms-content-pkg-6.1.6

forms-offline-service-package-3.2.4

forms-foundation-content-2.1.2

forms-dashboard-content-1.1.4