Jump to content

Script for Repeating Fields


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

Recommended Posts

Is it possible to create a script to populate all repitions of a repeating field? I am creating a bid sheet for an auction and need to create bid value increments based on a Value field. Example 30 is value. Rep 1=30, Rep 2=(Rep1+10), Rep 3 = (Rep2+10), etc.

Thanks

Novine in NC

Version: v6.x

Platform: Mac OS X Panther

Link to comment
Share on other sites

Define fields called BidValueBase and BidIncrement so you have more flexibility.

First script step: Set Field [""BidValueBase", "BidAmount"]

For each repeat n, where n > 1, define a script step:

Set Field ["BidValueBase"-n, "GetRepetition(BidValueBase, n-1) + BidIncrement"]

When you define Specify the field for Set Field, change the Repetition: box at the bottom appropriately.

Is this what you wanted?

There is a way to do this using calculations. Keep the two fields BidValueBase and BidIncrement. Define a new global number field named g.Index with the 3 of reps you'll need. Enter integer values in this field from 0 to (# repetitions -1).

Create a number calculation field named BidValue with the same # of repetitions. The calculation is:

Extend(BidValueBase) + (g.Index * Extend(BidIncrement))

Now BidValue will automatically start at BidValueBase and increment with BidIncrement

Is this understandable?

Link to comment
Share on other sites

This topic is 7334 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.