October 31, 200619 yr I want to have a script that takes me to a main record (a random one), then it should go to the portal in that record (the portal are related records, each record having a date), create a new child record in the portal and put todays date in it. There doesn't seem to be a script command that allows you to create a new child record in a portal. If you're in the portal at the last record created you can do the command, go to next portal record, but if you're in the main layout you'll only get to the first portal record, not a new one. Thanks Mike
October 31, 200619 yr Hi there I do not know how (or for that matter why) you choose a random main record but rather than go to the portal to create your new child record instead go to a layout that displays fields from the relationship that the portal uses. When there you can issue a new record script step and then go back to original layout. this will all happen so fast that you shouldn't need to issue a freeze screen step although you can if it helps. If you format one of your child fields to be an auto entry of Get(Current date) that will put the required data in the new record. Once back at your original layout with records committed the new record should show up in the portal HTH Phil Edited October 31, 200619 yr by Guest
October 31, 200619 yr Author Thanks. The random record is for a flash-card type system for testing. It picks a random test item aqnd you have to know the answer (or click on the answer button).The dates are in order to keep ttrack of the dates that question came up. Anyway, thanks. Your idea should definitely work. Mike
November 2, 200619 yr Author Now I guess I'm gonna sound stupid. How do I go to another screen and create a new "portal" record that will relate to the main record that I have on the other screen? Table 1 let's say has flash card type questions Table 2 is related to Table 1 and only contains dates. When I bring up a random record from table 1 I want Table 2 to create a new record with todays date. Screen 1 has the Table 1 record with the question and a portal of Table 2 records, each with a date. The recommendation was to go to a separate screen 2 and create a new Table 2 record and put todays date into it and return to Screen 1. I tried that but it just creates an orphan record. Hope I'm making some sense. Any help? Mike
November 2, 200619 yr Hi Mike Sorry, I didn't point out that you would have to pass across the key field data in a script parameter. I have prepared a small dem file for you to look at. the auto entry field in the child record is time instead of date but it will demonstrate better that way. If you look at the button setup you will see at the bottom that the script parameter is set to the record ID. In the script the new records id is set to this by the Get(scriptparameter) step. Sorry for this omission first time round Phil new_child_record.zip
Create an account or sign in to comment