dual field lookup from links

The recommended method of customizing your AppGini-generated application is through hooks. But sometimes you might need to add functionality not accessible through hooks. You can discuss this here.
Post Reply
jnewtcomp
Posts: 27
Joined: 2019-07-25 08:05

dual field lookup from links

Post by jnewtcomp » 2019-08-01 00:01

Hello

I have two fields under consumables that are look up fields from inventory. Both fields cross reference each other. One is a bar-code ITEM field, one is a manufacturing part number field. How can I lookup MFG P/N field or bar-code field and auto fill one or the other from lookup?

Thank you in advance.

jnewtcomp
Posts: 27
Joined: 2019-07-25 08:05

Re: dual field lookup from links

Post by jnewtcomp » 2019-08-03 13:46

I have two fields i need to populate based on the information placed in one of the two fields.

Consumable_Tools
Item:
MFG_Part_Number:

Both fields are important and need to be cross referable. If I scan a bar code one of two numbers comes up. Item number is often a bar code number and not the part number. The part number is how everyone orders the tools. If i have only the part number and not the item number how do i populate the item number. Hope this makes my question a little more understandable.

there is only one item number per part number and only one MFG_Part_Number per item number.


Thank you!!!!

Jim

User avatar
jsetzer
AppGini Super Hero
AppGini Super Hero
Posts: 1807
Joined: 2018-07-06 06:03
Location: Kiel, Germany
Contact:

Re: dual field lookup from links

Post by jsetzer » 2019-08-03 14:57

1) On save you can use TABLENAME_before_insert() function in hooks/TABLENAME.php to get the other value from database and fill $data

2) if you want to read the other value immediately after barcode scan or input, you can use $j.ajax(...) in TABLENAME-dv.js to call a server side php script. Pass the existing value from $j("fieldname1").val() to the server script, in php get missing value from DB, return both values as JSON back to client and put the values into your input fields using $j("#Fieldname1").val(data.value1); for example.

Regards,
Jan
Kind regards,
<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 readability

AppGini 24.10 Revision 1579 + all AppGini Helper tools

jnewtcomp
Posts: 27
Joined: 2019-07-25 08:05

Re: dual field lookup from links

Post by jnewtcomp » 2019-08-05 20:17

Thank you for the reply, I would love to say i know what your talking about but that would be a lie. I am learning the hard way by failing over and over. Is there any way to break that down to laymen's terms? I build these computers and support them not program them. :) thank you for all your help

Post Reply