How to retrieve pre-defined lookup ID in javascript
How to retrieve pre-defined lookup ID in javascript
Hi there,
I am wondering if anyone has some idea how to retrieve a pre-defined or pre-selected lookup field ID in AppGini.
Let me explain...
When you want to add a new record from a child table (in DV) with Add New button like this... a modal window will appear with the lookup field pre-defined or pre-selected with the parent record value...like this How can I retrieve the ID of the pre-defined lookup field in javascript?
Thanking you in advance.
I am wondering if anyone has some idea how to retrieve a pre-defined or pre-selected lookup field ID in AppGini.
Let me explain...
When you want to add a new record from a child table (in DV) with Add New button like this... a modal window will appear with the lookup field pre-defined or pre-selected with the parent record value...like this How can I retrieve the ID of the pre-defined lookup field in javascript?
Thanking you in advance.
Zala.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Re: How to retrieve pre-defined lookup ID in javascript
Any help offered comes with the best of intentions. Use it at your own risk. In any case, please make a backup of your existing environment before applying any changes.
Re: How to retrieve pre-defined lookup ID in javascript
Yes I tried, but nothing returned. I believe it is because the record is not created yet because it is initiated from Add New button from the child tab.
Zala.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Re: How to retrieve pre-defined lookup ID in javascript
In a multiuser environment, you won't know the running number before record is created, unless you lock the table.
Normally I just make the field non-required, leave it blank, and add in the value right after insert (in the hook's after insert portion).
Alternatively, you can use the running number from another table. When init, you insert a record of that table to get the number. However, there will be unused running number in case you don't save the new record.
Normally I just make the field non-required, leave it blank, and add in the value right after insert (in the hook's after insert portion).
Alternatively, you can use the running number from another table. When init, you insert a record of that table to get the number. However, there will be unused running number in case you don't save the new record.
Re: How to retrieve pre-defined lookup ID in javascript
In a single user environment, you can use SQL select max to get the current maximum running number, then +1 to it.
Re: How to retrieve pre-defined lookup ID in javascript
Let me explain again, i am not looking for the id of the child, but the parent
Zala.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Re: How to retrieve pre-defined lookup ID in javascript
Re: How to retrieve pre-defined lookup ID in javascript
Hi ppfoong,
thanks for the suggestions. However, they did not answer my question, yet
thanks for the suggestions. However, they did not answer my question, yet
Zala.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Re: How to retrieve pre-defined lookup ID in javascript
When the modal is being opened, there should be request parameters named something like:
...for example (depending on your table)
Maybe this is what you are looking for.
This should work for lookups, if modeled correctly in parent-children settings of master-table.
filterer_FIELDNAME
...for example (depending on your table)
filterer_client_id=17&filterer_account_id=423
Maybe this is what you are looking for.
This should work for lookups, if modeled correctly in parent-children settings of master-table.
Kind regards,
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
AppGini 25.10 + all AppGini Helper tools
<js />
My AppGini Blog:
https://appgini.bizzworxx.de/blog
You can help us helping you:
Please always put code fragments inside
[code]...[/code]
blocks for better readabilityAppGini 25.10 + all AppGini Helper tools
Re: How to retrieve pre-defined lookup ID in javascript
Yes!! Thank you so much Jan.
Zala.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.
Appgini 24.19, MacOS 15.2 Windows 11 on Parallels.