November 24, 200520 yr Newbie Question: I want to create a new record in a related database and populate its fields with some of the values from the current record displayed. How do I do this, if it's even possible? The ScriptMaker seems very basic. Thanks Graham Edited November 25, 200520 yr by Guest
November 24, 200520 yr You surely can do it plus other wonderful things using FM scriptmaker. The power of scripmaker rests on the user. To cut a long story short...From your current screen, create a button with the following: Go to layout [yourrelateddatabase] New Recdord [] Set field [foreignKeyID;get (scriptparameter)] Set field [some other...] Go to layout [originallayout] Make sure your button scripparameter is set to the current records primary key ID. In your related database you can have the field lookup using the forein key and they will populate as soon as the "Set field [foreignKeyID;get (scriptparameter)]" Hope this helps Edited November 24, 200520 yr by Guest
November 25, 200520 yr Author I just can't seem to get the exact syntax of the 'Go To Layout' correct. It never switches to the other database. If my other db name is "Nursery Products" and it contains a table called "Plant Catalog" and a lyout called "Form View", exactly what should I put as the parameter to the 'Go To Layout' function. Many Thanks.
November 25, 200520 yr Go to Layout will only go to layouts defined in the current file. If you need to go to a layout in another file then you need to make a go to layout script in the other file and call that script from the current file.
November 25, 200520 yr Author Thanks. It seems like I cannot create a new record on the other table either - I guess this all has to go in the other database's script?
November 25, 200520 yr Earlier you said that the table in the other file is related. If so, you can create a layout for it in the current file. Either way, you can create records in related tables directly - if the relationship is defined to allow creation of records.
November 25, 200520 yr Let's go back to your original post. You say that you want to create a new record in a related database and populate its fields with values from the existing record. Does this mean that you are trying to create a new record related to the current record? If that is the case then a portal into your related file is probably the answer to your problem. In fact the fields that you wish to duplicate can be made into match fields and they will be automatically duplicated whenever you enter data into a non-match field in a empty portal row,
Create an account or sign in to comment