Skip to main content
Question

Pick List

  • February 28, 2017
  • 0 replies
  • 68 views

This is sort of two questions, though I only need one answer.  We use QB as our CRM.  One of the items we include for each new customer is a code name.  Each codename is required to be unique in the field properties.  I would like to do one of the following:

1) Create a self-deleting pick-list whereas once a codename is selected, it is no longer available on the list; or

2) Create a script where every new Customer record is automatically assigned a randomly generated alpha-numeric code name.

Any help is greatly appreciated.

Mike
This topic has been closed for replies.

  • Registered
  • February 28, 2017
You could do this through a "Code Name" table and relationship (Each Code has Many Customers).  Then you need to set the record picker to only show ones where the code has "0" customers.

YOu then have a simple form rule, that will copy that code name to your unique code name field.

can you give an example of some of your code names?

  • Registered
  • March 1, 2017

Just use script and don't even worry about collisions. Here are two methods:

Pastie Database
https://haversineconsulting.quickbase.com/db/bgcwm2m4g?a=dr&rid=558

The first method just generates a random 8 character "password" while the second method generates a ob32 encoded string based on the current time. FWIW, ob32 encoding is the encoding used to generate dbid's.

I seriously doubt you will have to worry about two people having the same code or that someone would attempt to discover the ob32 string by regenerating it through code based on the timestamp.