Hi.
I’m sure I can’t be the first to face this issue, but I’ve been searching for a solution for weeks and have found absolutely nothing.
Here is the situation, very basic description:
- my main App is a grid with client info (let’s say “client_id”, “cli_name”, “cli_birthdate”, …)
- I created an application link to open a From Application that contains several tabs (this is a Form Application with Master-Details where each detail is in a block that is defined as a tab in the Layout). Let’s call this Form app “ClientEditForm”.
- from the main grid app, I pass the “client_id” to the ClientEditForm through a global variable defined as “input” named “[glo_client_id]”.
- in the ClientEditForm, one of the tab is the addresses of the client. This is a grid with several addresses for the client. To open this Grid app, it’s done throught the master-detail feature from ClientEditForm and I pass along the “client_id” through another global named “[glo_client_id_add]”.
- So at this point, the addresses grid has a SQL with a “WHERE add_client_id = [glo_client_id_add]” which works perfectly fine.
- From this addresses grid, I can use the “Edit” feature (application link) to open the Address From applciation to update an address. This works perfectly fine too because the link is based on the record row and the “add_client_id” is passed to the form.
- In the Address Form, in the “OnLoad” event, I have the following code to handle the INSERT. This works perfectly fine too IF I OPEN ONLY ONE CLIENT AT A TIME.
if ({address_id} > 0) {
// EDIT MODE
sc_btn_display(“new”,“off”)
} else {
// INSERT MODE
{add_client_id} = [prm_client_id_add_frm];
} - Now let me expalin the issue. From the Main Grid app (grid with client info), I open the client #1. This opens a new Form in my Menu App and I can open the Addresses Tab.
- I now open client #2 from the main grid app and I also go into the Addresses tab.
- Right now, the [glo_client_id_add] global variable is set to “2” because the last tab I open was the one of client #2
- If I go back to client #1 and I click the “Insert” button, the code mentioned above in the “OnLoad” event will take the id of client #2 to perform the INSERT. What a mess.
- I know about GLOBAL variables. They are shared between all applications
- I know about ATTRIBUTES variables. They are shared between all instances of the same application.
- I haven’t found anything about variables that are local to one instance of an application, which would solve this issue.
SO MY QUESTION IS: how do you guys have solved this big issue?