Hi Trent,
ok, what's happening here is a sort of recursive lookup type situation.
You're on the UpdateCustomers form
Which then goes to the UpdateInvoices form
And on this form is a "customers" field (which contains a lookup to the customers table.)
So in this lookup it's "loading the related customer record" (which is blank) and hence blanks the Customer session ID fields.
Hence by the time you get back to the Customer form, the cusomer record has been cleared.
The solution is to suppress the Customer field on the UpdateInvoices form. Now in theory this could be done "always" or it could be done based on some condition. Setting the condition though is tricky, and I don't have a perfect solution for that. So _maybe_ your best option (at least in the near term) is to have a different BrowseInvoices and UpdateInvoices for the UpdateCustomers form.
That said, let's see if a condition is possible. I think it might be, but with some small tweaks to the template (so you'll need build 8.58 or later for this (*).)
The condition, for the lookup field, is
p_web.GSV('UpdateCustomers:Active') = 0
where the UpdateCustomers bit is the "previous procedure" you want to check for.
Now of course there are ways to navigate around this setting. It's set when the form "starts" (in Insert, copy or Change) and is cleared when the user does a successful Save or Cancel.
But, as we know, it's possible to navigate away from a form without using Save or Cancel (menu item, address bar etc) and in that case the session value is not cleared. In a mobile context however this is likely to be much less of an issue.
cheers
Bruce