Creating Sequentially Numbered Revisions

I’ve been working on a program for a media company that sends out bids to various creative agencies. The bid creation itself is very straightforward but, all of a sudden, the client threw me a curveball and it took a little while to figure out a solution.

The scenario is this. Sometimes the agencies themselves want multiple versions of a bid which is easy enough to do, but the catch is that they needed the bid #s to reflect a version #, as per below

Duplicating the original bid is pretty simple but how do you get the numbering correct?

The 1st thing we need to do is add a field called basedOn_BidID and this will have the ID field of the original bid entered into it, with a relationship called Bid_BasedOn

From this relationship, we can get the # of revisions

And then we write a script to insert the next revision #

We’ve now created the new bid record and have tied it back to the original bid as well as adding the word Revision to the bid name.

We just need to add a calculation field (c_bid#) to display the correct # for each bid and revision which we will then use to sort the portal so that all revisions are grouped together with the original bid.

The script also requires the creation of several sets of related records and there are many ways to accomplish this; exporting and importing, looping through each record and then creating a new record based on it but using the new id field. My personal favorite is to build a variable ($values) with the different values that I need, separating each value with a pipe (|) character and each record with a carriage return (¶).

This is very similar to the technique used to create a virtual list, except that we’re not going to place the contents in a global field at the end of it.

On Line 63 of the above script, we are setting a global with the 1st value of our variable ($values) and we are replacing the pipes (|) with carriage returns, creating a list of values and then we set the relevant fields with the value #. (This method is much faster, and considerably easier, than trying to figure out the positions of each pipe and then get the text between them).

The great thing about this technique is that once you’ve written the script, you can duplicate and repurpose it whenever you need to do something similar elsewhere.

I hope you find these two techniques useful in your FileMaker™ development. I’d love to hear how you use them!

I hope you find this article interesting and, even better, useful to you in your efforts.

WIN A COPY OF MY NEXT  EBOOK, FILEMAKER™ & YOU, VOLUME 2

After you’ve read the post, please take a moment to add a comment.  (It helps me to know if I’m hitting the target with what I’m posting about).  Anybody who comments will automatically be entered into a monthly drawing for a copy of my new book, due for release by the end of 2018.  (1 out of 10 people will win a copy)

If you have bought either of my two previous books and haven’t yet written a review on the iTunes store, please do so and then email me a copy of the review (so I know your email address) and you’ll also be entered into a different monthly drawing where 1 out of 10 will also get a free copy).

Thanks and please don’t hesitate to get in touch if I can help you.

Michael Rocharde
(303) 856-5778

$14.99 at the iTunes store.

Click cover to order.

Money Back Guarantee

$14.99 at the iTunes store.

Click cover to order.

Money Back Guarantee

Leave a Reply

Subscribe To Our FileMaker Tips & Tricks

Join our mailing list to receive the latest FileMaker tips, tricks and video how tos from Michael Rocharde

You have Successfully Subscribed!

Subscribe To Our
Video Posts

Join our mailing list to receive info on new videos as we post them

You have Successfully Subscribed!

Website Apps