jsaltzman Posted October 15, 2003 Posted October 15, 2003 question is: can i have fm auto enter skus starting at 100038 and go up from there. and skip specific numbers i need to enter in some skus. i have a book shelf with a lot of books that i put online. they all have skus. i lost my harddrive so i am starting over. i have a list of those books in a db. they are in order from lowest sku (10038 is the first sku) to highest. however i do not have the numbers that are supposed to go in the sku field. i would run a script that would enter the numbers in and increase by one but the problem is, i sold some books before i lost my db. so the skus skip a number once in awhile. ie car book sku 100038 plane book sku 100039 cat book sku 100041 again my question is: can i have fm auto enter skus starting at 100038 and go up from there. and skip specific numbers
-Queue- Posted October 15, 2003 Posted October 15, 2003 You can change auto-entered values, even ones set to not allow modification, in a script. So set a global field with all skus that should not be used, separated by carriage returns. Then when your next record is created, test for the sku in the global field like this: Loop Exit Loop If [ not PatternCount( "
Fenton Posted October 16, 2003 Posted October 16, 2003 Another variation would be to not stop, but just skip the SKUs in the global: Freeze Window Go to Layout [ CreateSKUs.zip
jsaltzman Posted October 16, 2003 Author Posted October 16, 2003 i cannot get these to work right. instead. how could i set the field to not allow duplicates? i can import the list of skus that shouldnt be entered as seperate records then run a script that enters the skus +1 EACH TIME and if the error message appears it will +2 would that work?
Vaughan Posted October 16, 2003 Posted October 16, 2003 Make a database where each record has the sku you want to exclude. Make a relatyionship between the two databases based on the sku number. Every time you make a new record, see if it has a related record in the other file. If it does delete it and make another record. When you find you want to exclude more skus then add them to the other database.
-Queue- Posted October 16, 2003 Posted October 16, 2003 Hmm, what do you mean 'to not stop'? It just seems that you're complicating the process compared to mine. Maybe I'm missing something. Oh, and you don't need the initial If, just flip your Exit Loop If and your Set Field inside the loop.
-Queue- Posted October 16, 2003 Posted October 16, 2003 There's no need to delete the record. You can test the validity of the relationship, and when one is found not to be valid, use the Set Next Serial Value ["sku", "sku + 1"] to prevent duplicates.
Ugo DI LUCA Posted October 16, 2003 Posted October 16, 2003 Would this necessarily be scripted ? With a given ID structure set to auto-enter a text calc of type "ID"&Right("000000"&serial,6) and an auto-enter serial number.... So n_serial and t_ID We can identify a next missing serial with c_BooleanNextIsMissing =Case(not Patterncount(ValueListItems(Status(CurrentFileName),"IDsLists"),"ID"&Right("000000"&(n_serial+1),6) Case(not n_serial = Patterncount(ValueListItems(Status(CurrentFileName),"SerialLists"),"
Fenton Posted October 16, 2003 Posted October 16, 2003 Oops, I was somehow thinking he wanted to create a bunch of new records, but not those SKUs that already existed. But, as everyone else could see, he just wanted an auto-enter SKU. Sometimes I can't see the forest for the trees.
-Queue- Posted October 16, 2003 Posted October 16, 2003 Um, I think you're thinking the converse here. We want to ignore any of the numbers in the global, related file, or whatever, and not have any skus set with them. Your idea seems to be the opposite--using the numbers in the global or related file instead of skipping them. Nice setup though. Maybe you can tweak it to work for this situation.
-Queue- Posted October 16, 2003 Posted October 16, 2003 Aha! Now I see the reason for your Exit Loop If [
Recommended Posts
This topic is 8076 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 accountSign in
Already have an account? Sign in here.
Sign In Now