You are viewing limited content. For full access, please sign in.

Discussion

Discussion

How to Refresh a DB Lookup in a Table

posted on March 23, 2018

I've been successful in using the following to update a Lookup on a field when working with standalone field(s) on the form that have the css class "DbRefresh" using the following JS and an HTML Button.

$(document).ready(function(){
                                                    
  $(".RefreshBTN").click(function(){
        $(".DbRefresh input").attr("vo", "e");
        $(".DbRefresh textarea").attr("vo", "e");
        $("Field24").trigger('change');
  });
});

This does not work thou when the fields to be updated are contained in a table. Can any of you JS Guru's provide an answer on how to target the fields in a table to refresh the DB Lookups when a button is clicked.

Thanks

0 0
replied on October 3, 2022

Steve did you ever figure out a way to refresh an autofill on page load with a HTML button?  I have a sql view on load it loads a schedule.  I currently just have users hit submit and reload the page but that creates an instance in forms every time.  I'd like just a refresh button at the bottom to reload the autofill.

0 0
replied on October 3, 2022

Hi Wesley, can you show me what your lookup rule looks like that filling in the field?

0 0
replied on October 3, 2022

0 0
replied on October 4, 2022

Hi Wesley, I've not been able to do it with a lookup that has no condition

1 0
replied on March 23, 2018 Show version history

Hi Steve,

 

You can try using the following method to trigger a lookup:

$(".RefreshBTN").click(function(){
$('.autofill').trigger('click');
})

If you're still having issues, another thing you can do is first, populate values into hidden multi-value fields and then map those values to the table. 

 

0 0
replied on March 23, 2018

Hi Ken

Doesn't appear to work. Could it be because my lookups do not have an Autofill Button? (either displayed or hidden)

 

0 0
replied on March 23, 2018

No that shouldn't be an issue. I have a Form without the Autofill Button and it's still working. Can you explain to me what these fields are and what you are trying to accomplish with them: $(".DbRefresh input") and  $(".DbRefresh textarea")

0 0
replied on March 23, 2018

Hi Ken

DbRefresh is a css class we put on the fields we wanted to be refreshed by the data lookup.

When I tried you code I used it as 

$(document).ready(function(){
                                           
     $(".RefreshBTN").click(function(){
     $('.autofill').trigger('click');
     })

})

0 0
replied on March 23, 2018

Is there a specific reason why you are using classes here?

Can't you just set up your Lookup rules so that it populates those fields? 

0 0
replied on July 20, 2023

@████████ I have a situation where the customer hits save as draft. Once they do that the look up will not refresh. How can I get the looks-up to work every time in modern forms?

0 0
You are not allowed to follow up in this post.

Sign in to reply to this post.