May 21, 200223 yr This is a problem that I run into with almost every data base I create. In my latest database I actually have 2 related databases. The first is "Clients" and is a basic contact manager. The second is "Policies" which holds all the policy information for all my clients (in case you haven't figured it out this is for an insurance agency). In my Client DB I have a button that creates a new policy. The script is supposed to copy the client id, open the policies DB, request a new record, past the client id and based on the id the pertinent demographic data from Client DB is shown in related fields (like last name, first name, etc.). Then back in my Client DB I have a portal that shows each policy a client has in a repeating field. Here is where the problem starts. If I am looking at the layout in my Client DB that shows the policies portal, the policies DB must be open. If I then hit the Create new policy button, instead of opening policies (cause it is already open), copying the client id, etc. the Policies DB just pops up with the record/policy I last created. I then have to manually create a new record and enter the client id. This defeats the whole purpose of my "Create Policy" button and script. Is there a better way to achieve this? Would a look up work better?
May 21, 200223 yr Why not just check the "allow creation of related records" in the relationship so that creating new related records is a simple as typing into the blank row at the bottom of the portal? To fix your script (if you still want to do it this way) don't use the Open [] step. Use the Perform Script [] step and call the "Make new related record" script in the related database as an external script. It never fails.
May 21, 200223 yr I'd add a file: you've Clients and Policies; add a ClientPolice file (a so-called join file) in which you'll create a record for any combination of Client and Policy you may have, while the Policies file holds one record per Policy Relate Clients to ClientPolice by ClientID and relate Policies to ClientPolice by PolicyID; in ClientPolice make similar ("reverse") relationships towards Clients and Policies by whcih you can look up client and policy data Create new policies for a client either using the option "allow creation of related records" or with a script like yours (copy clientID, go to ClientPolice, create new record, paste clientID ...) ...
May 21, 200223 yr Author In reply to: Why not just check the "allow creation of related records" in the relationship so that creating new related records is a simple as typing into the blank row at the bottom of the portal? One reason I didn't do it this way was because I'm a newbie and didn't know that I could! The main reason is because each Policy record will contain a lot more info than what would be shown in the portal.
May 21, 200223 yr Author Oh, and thanks to both of you for the info. I will try both and see if I can get it to work.
May 24, 200223 yr Author Yes! Your idea worked Vaughan. Your a genius, thanks a million! This has been bugging me for so long, you have no idea. Joe
Create an account or sign in to comment