October 4, 200718 yr To put it simply: There are 2 tables: #1 Payments Table Date Amount ... etc FK_VendorID #2 Vendor Table Name Street ... etc PK_VENDORID There is a portal based on Payments. One of the fields is FK_VendorID. In the portal it is a popup based on the Vendor ID & Vendor Name. Problem: When there are no vendors in the vendor table is the best way to direct a user to add a vendor something like "if RecordNumber(Vendors)=0 then customdialog "There are no vendors. Please add a new one" ; GOTO "VendorLayout"; Return to Portal layout. Or is there better logic I can use? Thanks for your help. Ron
October 4, 200718 yr How about just adding a vendor name field to the dialog so the user can quickly make a new vendor and then get back to what they were doing.
October 5, 200718 yr Author The Vendor information includes: street, city, state, zip, phone, account number etc. Way too much information to put in a dialog. Right now I am stuck on how best to activate a script when there are no vendors in the popup FK_VendorID field. I know I can put a button above the field "Add Vendor" and run a script but it seems like there should be a more automatic way to look at the Vendor table and if it is empty, to run a script that will take me to a layout for new vendor data. However, if I make the Vendor field (FK_VendorID) a button then it won't update with the new data. If it is *NOT* a button, then there does not seem to be a way to run the script. Any ideas? Thanks Ron
October 6, 200718 yr The Vendor information includes: street, city, state, zip, phone, account number etc. Way too much information to put in a dialog. Understood. What I pictured was just vendor name in the dialog, and the details could be added later. First of all, the test for zero vendors in the portal would be: Count(Related::Vendor ID) // where "Related" is your portal relationship Second, it sounds like you need your script to do two things: go to a screen where the user adds the vendor info, and then actually adds that vendor to your portal. I still like the idea of popping up a new window, even if it's not a dialog. That way the user doesn't feel like they've lost their place. You could make the new window with status area closed and locked, and then put the script into a loop that is only exited with a Cancel or Done button. The Cancel button would simply exit the loop and close the window; the Done button would exit and close, plus grab the new vendor ID and set it into the portal.
Create an account or sign in to comment