Solved

Script to check consecutive numbering sequence

Posted on 2012-04-05
4
317 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
ID: 37814895
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
ID: 37831374
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
ID: 37832832
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
ID: 37841858
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Pop up windows can be a useful feature of any Filemaker database.  Though best used sparingly, they can be employed in a multitude of different ways, for example;  as a splash screen at login, during scripted processes to control user input, as pick…
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…
Internet Business Fax to Email Made Easy - With  eFax Corporate (http://www.enterprise.efax.com), you'll receive a dedicated online fax number, which is used the same way as a typical analog fax number. You'll receive secure faxes in your email, f…
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…

910 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

23 Experts available now in Live!

Get 1:1 Help Now