Solved

Script to check consecutive numbering sequence

Posted on 2012-04-05
4
315 Views
Last Modified: 2012-04-13
I Have a several  portal rows and the number of rows can vary from 1 to a max of 12.
The user needs to set the Task Sequence manually via a value list numbered 1.2.3.4.5. etc..12.
Task abdc, the first portal row and firt task  is numbered...1
Task bdcf..the second portal row is the second task and is numbered ...2(selected by the user)
Repeat until the total numbered of tasks have been sequenced.
The Sort Portal Records is set to Task Sequence ascending.
This all works well.
If the User in error selects a sequence ranging from 1  to 4 as  1... 2.. 3..5 instead of 1 2 3 4  
I need a script triger to alert the user to the incorect sequence.
I have a script that is based on :
  Go to Portal Row First ,If Task Sequence > 1 ..Show Custom Dialogue
Go to Portal Row Next    If Task Sequence > 2 then show custom dialogue
Again this is ok but the script will end at the last portal row each time which is not what I want.
Is there a shorter way  where the script will evaluate all the sequences entered per portal row and evalauate  if the sequences are in sequence ?
0
Comment
Question by:Krisraychris
  • 2
  • 2
4 Comments
 
LVL 24

Expert Comment

by:Will Loving
Comment Utility
I'd like to offer an alternate, and i think more elegant, way of going about this - one that I have used on multiple occasions - that completely bypasses the need for the error message. Instead of having the user have to select the Sequence number for each portal record, just have a "next in sequence" area to click on in each portal row. When the user clicks the button area, a script calculates what the next sequence number would be using the Max() function and adding one. So for example:

Max( TaskItems::TaskSequence ) + 1

All the user has to do is select the items in the order that they want them and the next higher sequence number is assigned for them automatically. Clicking a task that is already numbered clears the Sequence number and let's it revert to an unordered state.

If you want to go further you can add a renumbering routine to the "click" script, so that if a user clears the Sequence value - in particular for a task in the middle of the sequence - the script simply runs a loop through all the portal rows that are numbered so far and renumbers them starting with 1. That way if the user clears a Sequence value on any record, the remaining sequence records will be renumbered and the gap eliminated.
0
 

Author Comment

by:Krisraychris
Comment Utility
Hi
Pleasde have alook at the script I am using to get the sequences to increment by one.
It is doing the right things sometimes.On the second click the  highest sequence is plusses a 1.
I have tried go to Record/ Request/Page and this cuases some problems as I may have two sets of sequences open soi I opted for Go to portal row next.
I would appreciate your advice on this.I have changed the filed names of the script for simplicity. The fieedTask Sequence Monday is located in a Table Task  Monday

Go to Layout [ “ Day Monday”  ]
Go to Portal Row [ Select; First ]
If [ IsEmpty( Task Sequence Monday ) or Task Sequence Monday < 1 Task Sequence Monday> 1 ]
Set Field [ TaskSequenceMonday ; 1 ]
End If
Loop
Go to Portal Row [ Select; Next ]
Set Variable [ $TaskSequenceMonday; Value:  TaskSequenceMonday]
 
Set Variable [ $TaskSerquenceplus1; Value:Max(TaskSequenceMonday)+1 ]
 
 
Set Field [ TaskSequenceMonday; $TaskSequenceplus1]
 // Go to Record/Request/Page [ Next; Exit after last ]
Exit Loop If [ PROD ORDER FinishTime Monday::Count Records Total = 10 ]
End Loop
0
 
LVL 24

Accepted Solution

by:
Will Loving earned 500 total points
Comment Utility
To clarify, are you trying to do my suggested method or your original method? Assuming you are trying to do my suggested method I think you may be doing more than necessary. Take a look at the attached example file which shows a simple setup for assigning sequence numbers to records in a portal. It includes a script attached as a button to each portal record and a relationship that is sorted to first put sequence portal rows first, followed by unassigned (though you could certainly to the opposite and put unassigned at the top by changing the sort order applied to the relationship).

I have not added a renumbering sequence do deal with removing ones out of order but it's not difficult and could easily be added to the script.

Portal Row SequencingClick-to-Sequence.fp7
0
 

Author Closing Comment

by:Krisraychris
Comment Utility
Thank you for your sample file.I have used elements of this example and used it fully in another table.Much appreciated !!
0

Featured Post

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Conversion Steps for merging and consolidating separate Filemaker files The following is a step-by-step guide for the process of consolidating two or more FileMaker files (version 7 and later) into a single file with multiple tables. Sometimes th…
Having just upgraded from Filemaker 11 to Filemaker 12 over the weekend, we thought we would add some tips for others making the same move.  In general, our installation went without incident. Please note that this is not a replacement for Chapter 5…
It is a freely distributed piece of software for such tasks as photo retouching, image composition and image authoring. It works on many operating systems, in many languages.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

762 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now