Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 5916 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

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.

Posted

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?

Posted

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.

Posted

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.

Posted

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.

Posted

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.

Posted

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:

This topic is 5916 days old. Please don't post here. Open a new topic instead.

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.