Jump to content
Server Maintenance This Week. ×

Sequentially enter 1 of 3 numbers?


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

Recommended Posts

  • 3 weeks later...

Thanks Mr Vodka. Here is my question expanded:

I'm looking to create a script (performed when entering a quote layout) that automatically (sequentially) inserts 2, then next time a 3, then 9, then back to 2. This is for producer 2, producer 3, producer 9. This way the new business quotes are distributed evenly to each producer. 

Link to comment
Share on other sites

Here is my question expanded:

No, actually it's the same question repeated. And it makes very little sense. Why would you want this to happen whenever you enter a quote layout? If you want new business quotes to be distributed evenly among the producers, then this should only happen when you create a new quote. And no script would be required: you could simply auto-enter a calculated value, based on the quote's auto-entered serial number ID (hopefully you have one in place) =

Choose ( Mod ( QuoteID ; 3 ) ; 2 ; 3 ; 9 )

---

P.S. In the long run, randomly generated values as shown above will be just as evenly distributed among the producers as numbers assigned in strict sequence. This is known as the law of large numbers, one of the fundamental laws governing this universe.

Link to comment
Share on other sites

Because when we enter quotes I have a script that opens a new window and goes to the New Quote Layout. This layout is only for entering new quote information. After entered the user hits submit, the window closes and filemaker navigates to our main database layout.

So, the act of entering the quote layout automatically creates a new record and assigns it to a specific producer (evenly) 2, then 3, then 9. I currently have a random calculated value set in the calculation and its assigned the last 4 quotes in a row to producer 2. I have attached the calculation. You'll notice something else, If user Kim (producer 2) enters a quote, the code is set to 2, etc for Matt (2) and Bill (9). The only time a random or hopefully sequential number is entered is when Rose enters the layout. As she inputs all the online quotes.

 

bwi.tiff

Link to comment
Share on other sites

What happens if Kim creates 10 on her own, Matt 3, and Bill 5?  Does Matt keep getting assiged whenever Rose creates a new quote?  IOW is the quote being assigned to whoever has the least in the system to distribute evenly or should it just be distributed evenly only by Rose and indepedent of when the others enter in their own quote.

Link to comment
Share on other sites

Because when we enter quotes I have a script that opens a new window and goes to the New Quote Layout. This layout is only for entering new quote information.

IMHO, if something needs to happen every time you create a new record, then it should happen as a result of creating a new record. Today you create a record only by entering a specific layout - tomorrow you may want to add another way. Anyway, this is just a minor point in this discussion.

 

If user Kim (producer 2) enters a quote, the code is set to 2, etc for Matt (2) and Bill (9). The only time a random or hopefully sequential number is entered is when Rose enters the layout. As she inputs all the online quotes.

As I tried to explain earlier, you cannot enter the next number in a sequence without knowing what the last number in the sequence was. In this example, you would have to find out what the code was in the last record created by Rose. This could be determined by finding this record, or by defining a relationship that shows only records created by Rose (or not created by one of the producers). Alternatively, you would have to write this number in a preferences record somewhere where it can be easily retrieved. IMHO, no mater which method you choose, the resources required to implement it will far outweigh any advantage a strict sequence may have over a random assignment.

Edited by comment
Link to comment
Share on other sites

Mr Vodka,

If Kim takes 10 calls for quotes and inputs them into filemaker which automatically assigns them to her, it's 100% ok for her to have 10 and me to have 3 for example because our intent is if a new customer speaks to a particular agent over the phone, that agent should be assigned to them in perpetuity. If a web quote is entered by rose, the new customer hasn't spoken or built a relationship with any agent therefore we'd like it to be assigned evenly to one of currently 3 agents but more in the future.

Does that make any sense?

Comment, I'm trying to understand your suggestion but from what I gather you would suggest prior to executing the script, perform find for (most recent record created), set a variable for that number. Then create an If, else. If the number is 2, then set field as 3, else if number is 3, set field as 9.

Then proceed with the script and the numbers should be evenly distributed?

Thanks for all the help!

Link to comment
Share on other sites

Comment, I'm trying to understand your suggestion but from what I gather you would suggest prior to executing the script, perform find for (most recent record created), set a variable for that number. Then create an If, else. If the number is 2, then set field as 3, else if number is 3, set field as 9.

It's not really a suggestion, more like a warning...

Anyway, your description is correct, except: (1) you can do this within the existing script, and (2) you need to locate not the most recent record created, but the most recent record created by Rose.  I would also use a calculation instead of If, Else, but that's not essential.

Link to comment
Share on other sites

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