Refresh Form in Tab Application

I have a tab application with 3 forms. One form (closing balance) has the detail. The sum value of closing balance gets updated into the reconciliation form field called closing balance.

The detail application is properly updating the database. However the form does not update unless you refresh the page.

Is there a way to have the Reconciliation form refresh after the Closing Balance form has been updated/inserted etc?

Re: Refresh Form in Tab Application

Has someone figured out a way to do this? Other than reloading the whole tab application…

Re: Refresh Form in Tab Application

Hi,
you should be able to reload just the iframe by calling a javascript method.
Find out the id of the iframe. It looks like “nmsc_iframe_liga_form_mb” where “nmsc_iframe_liga_” is always the same followed by the name of the form or grid.

Create a javascript method i. e. reload_iframe

parent.frames[“nmsc_iframe_liga_form_mb”].window.location.reload(); //There are other options for reloading an iframe so you might have to tinker a bit.

Once again you have to put the iframe id of your page between the brackets!

In the onAfterUpdate/onAfterInsert event use the sc_javascript() macro to call the method.

I hope this points you in the right direction. At least this works in a Master/multiple Detail scenario where the details update each other without reloading the page.
As I said, you probably have to tinker a bit.

jsb

Hi jsbinca,

I’m trying to use what you suggested but nothing happens. I found the correct iframe id that starts with nmsc_iframe_liga_… and used the simple javascript code you provided but it’s not reloading. I have a form with a detail grid and a button on the form that links to another form to add stuff to the detail grid. The form that adds to the grid pops up modal and I put the call of the javascript in event onAfterInsert. After you insert a record the modal closes but the detail grid on the other form doesn’t reload. Is it because I’m using a linked modal app and not on the same page when I make the javascript call. How do I differentiate between different pages and iframes within them?

Dear jsbinca,

How can I find out the id of the iframe? I tried to look in the <my_project form>.php but could not find it.

Start your app and hit <F12> in IE10 or chrome and look … That is an html issue, not php.