Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×
The Claris Museum: The Vault of FileMaker Antiquities at Claris Engage 2025! ×

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

Recommended Posts

Posted

I have these fields:

-----------

Customer ID

Name

City

State

------

I need the Customer ID to automatically populate with the first 3 letters of the name, first 3 letters of the city and the 2 state code(MT,ID,WA) so Walmart in Boise Idaho would show up as "WALBOIID" in the Customer ID after entered. And advice?

Posted (edited)

I just noticed a new issue with this. The code worked on all of my layouts, but in some it does not show up until I click on the field, but not all. I don't see any differences... :

Edited by Guest
Posted

I have these fields:

-----------

Customer ID

Name

City

State

------

I need the Customer ID to automatically populate with the first 3 letters of the name, first 3 letters of the city and the 2 state code(MT,ID,WA) so Walmart in Boise Idaho would show up as "WALBOIID" in the Customer ID after entered. And advice?

What happens if you have A Wallgreens or whatever in Boise Idaho? Then you have duplicate Customer ID's.

Posted

Futher, what happens when a company moves to a new location? It may not happen with the bigger retailers but if you deal with smaller retailers or distributors this is a big possibility. Right now I have headaches due to someone else initiating a poor ID scheme, that being using the telephone numbers for our customers.

You want to use a key that will never change and has no possibility of being duplicated.

  • 2 weeks later...
Posted

Ack! you missed the point. You want a value that:

a) can not change

: will not be duplicated

a) I just got finished telling you that not only can a Companies location change but so can their phone number.

: While it is somewhat unlikely that A Walgreen's and A Walmart in Billing, MO will have the same last 4 digits for their phone number it is not impossible!

Posted

Kevin,

You might want to take a few minutes out to consider the advice you have been given by Zero Tolerance and sbg2. They are spot on. You could be in for trouble with a numbering scheme like you have. If you are being forced to do it that is one thing but with database design, its really best to be looking further down the road.

Posted

I made the changes after looking at your advice. I decided to go with first 3 name, first 3 city, 2 state, and store number.

IE: WALBILMT6809 ( Walmart, Billings, MT, 6809) This way it is basically the same code each store goes by. What do you think?

Posted

There can be situations where having an "intelligent" ID is very useful (from the user perspective).

However, if that is what you choose to do, I would still use another field with a unique identifier (you can use an increment number or random). You can hide this field from your interface, but use this field to create your relationships with other tables.

If you run into the situation where the Company moves, change phone number, or whatever, the "intelligent" field can be changed without causing too much grief.

Posted

Using a random number for your primary key is like playing the lottery: the individual chances are very small, but given a large number of players (records), there will be "winners".

Posted

Again you could, for example, have three companies as follows:

Shoprite, Billings, MT, 53

Shop N Save, Bilko, MT, 53

Shop N Bag, Biloxi, MT, 53

All your doing at this point is reducing the chance that you will duplicate an ID rather than ensuring you will not duplicate one.

I think the real question is why do you feel you need an ID formatted this way rather than a serial incremented number ID?

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