September 8, 200817 yr I wrote a simple script: Show All Records Delete All Records Set Next Serial Value (I set the Specify target field to my ID field and specified the calculation = 1) After running the script the first new record has a blank ID, the second record has an ID of 1. If after running the script I go into Define Database and open the field ID and don't change anything and then go to the layout and add a new record it start with the ID = 1. I assume I am missing something easy here. Thanks.
September 8, 200817 yr The only time that I have seen something strange with Set Next Serial Value is during 1 record imports. In your case, it doesnt seem like it should be an issue. Have you tried with a new file?
September 9, 200817 yr Author I am not importing any data in this layout, so a new file wouldn't help. Thanks for the suggestion. I did figure it out though. I wasn't properly setting the ID field in the script. I now realize you just make the calculation =1.
September 9, 200817 yr Author I spoke too soon. Now the ID field is not reseting at all. How do I specify the ID field = 1 in the script. I added the Set Next Serial Value[] script step. Then I double clicked the step, selected the correct TO and field ID, hit the Specify ... button, put 1 in the calculation box and hit OK. Thanks.
September 9, 200817 yr Then I double clicked the step, selected the correct TO and field ID, hit the Specify ... button, put 1 in the calculation box and hit OK. Not quite. That 'specify' which appears of the bottom where you select your target field is for specifying the REPETITION number and not the value. Select your ID then say OK. Then right below, select Specify Calculated Result. Put your 1 in there.
September 12, 200817 yr Author Thanks. It is working now. I thought I had tried that method but obviously not. How come all of the portal records are not deleted with the script? When the script is complete and a new record is added, the portal records previously in that ID show up. I suppose I need to delete the portal records, but how in ScriptMaker? I see a Delete Portal Row script step, but don't see how that would delete all of the portals.
September 12, 200817 yr This would be a business decision. Would it be true that, if you delete a parent record, you would always want to delete all of its children? Usually that is what you would want but not always so I want to be sure. If so, then you can 'Allow Deletion' of the children by checking the checkbox within the relationship dialog (at the bottom). That is same place you would define your relationship using the =. :wink2:
Create an account or sign in to comment