Jump to content

Random Staff Assignment Script


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

Recommended Posts

  • Newbies

Help - is anyone able to point me in the right direction?? The following script is not working for me in FM, we recently added the last loop for new staff. The same script worked before the additions:

Case(Request Number <= 99 and assign rep ="yes",

Case(Mod(Request Number,12)=0,"Karen",

Mod(Request Number,12)=1, "Lon",

Mod(Request Number,12)=2, "Lon",

Mod(Request Number,12)=3, "Romy",

Mod(Request Number,12)=4, "Lon",

Mod(Request Number,12)=5, "Lon",

Mod(Request Number,12)=6, "Alexandra",

Mod(Request Number,12)=7, "Lon",

Mod(Request Number,12)=8, "Lon",

Mod(Request Number,12)=9, "Ruth",

Mod(Request Number,12)=10, "Lon",

Mod(Request Number,12)=11, "Lon"),

Request Number <= 99 and assign rep = "no",

New Rep Name,

Request Number > 99 <= 330 and assign rep = "yes",

Case(Mod(Request Number,5)=0,"Karen",

Mod(Request Number,5)=1, "Romy",

Mod(Request Number,5)=2, "Alexandra",

Mod(Request Number,5)=3, "Lon",

Mod(Request Number,5)=4, "Ruth"),

Request Number > 99 <= 330 and assign rep = "no",

New Rep Name,

Request Number > 330 and assign rep = "yes",

Case(Mod(Request Number,2)=0,"Susan",

Mod(Request Number,2)=1, "Steve"),

Request Number > 330 and assign rep = "no",

New Rep Name)

Here's the original script that DOES work:

Case(Request Number <= 697 and assign rep ="yes",

Case(Mod(Request Number,5)=0,"Robert",

Mod(Request Number,5)=1, "Alexandra",

Mod(Request Number,5)=2, "Romy",

Mod(Request Number,5)=3, "Ruth",

Mod(Request Number,5)=4, "Karen"),

Request Number <= 697 and assign rep = "no",

New Rep Name,

Request Number > 697 <= 759 and assign rep = "yes", Case(Mod(Request Number,4)=0,"Alexandra",

Mod(Request Number,4)=1, "Romy",

Mod(Request Number,4)=2, "Ruth",

Mod(Request Number,4)=3, "Karen"),

Request Number > 697 <= 759 and assign rep = "no",

New Rep Name,

Request Number > 759 and assign rep = "yes", Case(Mod(Request Number,5)=0,"Alexandra",

Mod(Request Number,5)=1, "Romy",

Mod(Request Number,5)=2, "Ruth",

Mod(Request Number,5)=3, "Karen",

Mod(Request Number,5)=4, "Lon"),

Request Number > 759 and assign rep = "no",

New Rep Name)

Any help is greatly appreciated!!

Link to comment
Share on other sites

  • Newbies

The script assigns each new call/case to next rep on the list. The number categories separate different classes of reps. For example the first group of reps (names, Lon, etc.) take the major case loads, the last two reps take the easiest case loads (Susan, Steve). For instance, if you were to call our office, one of the secretaries would access the database. Upon pulling a new record in the appropriate number range, the database should automatically tell the secretary which rep should be assigned to your call.

Does that help?

Link to comment
Share on other sites

quote:

Originally posted by GuildGirl:

The script assigns each new call/case to next rep on the list. The number categories separate different classes of reps. For example the first group of reps (names, Lon, etc.) take the major case loads, the last two reps take the easiest case loads (Susan, Steve). For instance, if you were to call our office, one of the secretaries would access the database. Upon pulling a new record in the appropriate number range, the database should automatically tell the secretary which rep should be assigned to your call.

Whoa! This is WAAAAAAYYYYYYY too complicated a CASE. You are making things way to complex for yourself.

Break this up into more logical and smaller components.

I assume that this is a "SetField"?

Structure the script as follows:

If [Request Number <= 99 and assign rep ="yes"]

Set Field [your first CASE set]

End If

If [Request Number <= 99 and assign rep ="no"]

Set Field [New Rep Name]

End If

If [Request Number > 99 <= 330 and assign rep = "yes"]

Set Field [your second CASE set]

End If

and so on for each of your CASE breakpoints. This will probably take care of your problem, but will certainly make troublshooting the problem easier.

------------------

=-=-=-=-=-=-=-=-=-=-=-=-=

Kurt Knippel

Consultant

Database Resources

mailto:[email protected]

http://www.database-resources.com

=-=-=-=-=-=-=-=-=-=-=-=-=

Link to comment
Share on other sites

Thank you CaptKurt for your suggestion. I am the one who origially asked GuildGirl to post the information. I tried to change the script to your suggested format, but "There are too few separators in this function" error message was displayed. Suggestions.

Here is the revised script:

If (Request Number <= 99 and assign rep = "yes")

Set Field (Case(Mod(Request Number,12)=0,"Karen",

Mod(Request Number,12)=1, "Lon",

Mod(Request Number,12)=2, "Lon",

Mod(Request Number,12)=3, "Romy",

Mod(Request Number,12)=4, "Lon",

Mod(Request Number,12)=5, "Lon",

Mod(Request Number,12)=6, "Alexandra",

Mod(Request Number,12)=7, "Lon",

Mod(Request Number,12)=8, "Lon",

Mod(Request Number,12)=9, "Ruth",

Mod(Request Number,12)=10, "Lon",

Mod(Request Number,12)=11, "Lon"))

End If

If (Request Number <= 99 and assign rep = "no")

Set Field(New Rep Name)

End If

If (Request Number > 99 <= 330 and assign rep = "yes")

Set Field (Case(Mod(Request Number,5)=0,"Karen",

Mod(Request Number,5)=1, "Romy",

Mod(Request Number,5)=2, "Alexandra",

Mod(Request Number,5)=3, "Lon",

Mod(Request Number,5)=4, "Ruth"))

End If

If (Request Number > 99 <= 330 and assign rep = "no")

Set Field(New Rep Name)

End If

If (Request Number > 330 and assign rep = "yes")

Set Field(Case(Mod(Request Number,2)=0,"Susan",

Mod(Request Number,2)=1, "Steve"))

End If

If (Request Number > 330 and assign rep = "no")

Set Field(New Rep Name)

End If

Link to comment
Share on other sites

Occasionally our representatives change; therefore, the numbers (Request Number which is assigned as a serial number by FileMaker) just happen to be the breaking points when we needed to add different names to the rotation.

quote:

Originally posted by BobWeaver:

What is the significance of the breakpoints 99, 330, 697 adn 759?

Link to comment
Share on other sites

It looks like this calculation is so complex because it is constantly re-calculating legacy records. If you change this to an auto-enter type of field, the old records can have their old values unaffected, and the calculation for the new records will be much simpler.

Link to comment
Share on other sites

Thank you! That simplified things tenfold.

All is fixed and well!

quote:

Originally posted by BobWeaver:

It looks like this calculation is so complex because it is constantly re-calculating legacy records. If you change this to an auto-enter type of field, the old records can have their old values unaffected, and the calculation for the new records will be much simpler.

Link to comment
Share on other sites

This topic is 7880 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
 Share

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.