Hello, I have a screen that updates a code cross-reference table which contains a code-type field. That code-type field has a master table. What I want to do is validate the cross referenced codes in the code cross reference table against various master tables depending on the value of the code-type field. For instance:
This is the code cross-reference: <https://lh3.googleusercontent.com/-UbT5EDpO6gM/WUgsmiToqcI/AAAAAAAAAoo/EyoGuLWX56YyJYnQdrNS4ncoiAitnQTRgCLcBGAs/s1600/Screenshot%2Bfrom%2B2017-06-19%2B14-55-48.png> Values: code_type source_system_id source_code target_code target_source_system_id code_type_id source_system_dwid target_system_dwid id TM V UPS 3 DAY SELECT 3DS PS 8 (null) (null) 797 TM V UPS NEXT DAY AIR NDA PS 8 (null) (null) 798 DT V COD - COLLECT Collect MG 9 (null) (null) 799 DT V COLLECT Collect MG 9 (null) (null) 800 This is the code type table: <https://lh3.googleusercontent.com/-YAfoQhPgJC8/WUgt-gPn_wI/AAAAAAAAAo0/Ki_rEmhW490Q3zgepwWk1wKtNf0X23aUwCLcBGAs/s1600/Screenshot%2Bfrom%2B2017-06-19%2B14-58-10.png> Values: code_type code_description id ML UNKNOWN 1 PT Payment Terms 2 CT Country 3 PC Profit Center 4 DP Department 5 SL Ship Location 6 SM GP Ship Method 7 TM Transport Mode 8 DT Delivery Terms 9 TC Transport Carrier 10 PlantCust Plants to Customers 12 II Ignore Inventory Plant 13 MC Shipping Country 11 What I would like is for the source and target code fields to be validated against different master tables based on the value of the code-type field. For instance, if the code-type were "CT", I'd like the source and target codes validated against the country code master, but if the code-type field were "PC", then I'd like the source and target codes validated against the GL Profit Center table (ie... IS_IN_DB()). Thanks, Carl -- Resources: - http://web2py.com - http://web2py.com/book (Documentation) - http://github.com/web2py/web2py (Source code) - https://code.google.com/p/web2py/issues/list (Report Issues) --- You received this message because you are subscribed to the Google Groups "web2py-users" group. To unsubscribe from this group and stop receiving emails from it, send an email to web2py+unsubscr...@googlegroups.com. For more options, visit https://groups.google.com/d/optout.