Re: SKU lookup

This WebDNA talk-list message is from

1997


It keeps the original formatting.
numero = 13100
interpreted = N
texte = At 12:38 AM 8/21/97, you wrote: >Hello > >Hey how would one write an expression to lookup the last SKU entry made >in a given db, and then add 1 to it, and enter that automatically in the >SKU field? >-- As Ken mentions, the [cart] is great for generating unique skus. However, sometimes you might require a unique sku which is not a random number such as 8721054256023 which is the sort of number you get by using [cart]. For example, what if you are making an employee database and you want to track it using a logical progression (1, 2, 3 etc.) with each new employee's number being one higher than the last.Here is a snippet of code to take the highest sku value from a database and then increment it by one: [search db=yourdatabase.db&grskudata=0&skusort=1] [founditems] [name][math]newsku=[sku][/math] [/founditems] [/search] [math]newsku=(newsku+1)[/math]

Final value=[math]newsku[/math]

To hide the output from a [math][/math] context just enclose it like so This lets the code get parsed without displaying the results. To call the newsku value elsewhere in the template just use [math]newsku[/math] ..................................................................... W O R L D P O I N T I N T E R A C T I V E DANIEL CAMERON web engineer Honolulu San Francisco 2800 woodlawn drive 222 sutter street dcameron@worldpoint.com suite 170 sixth floor www.worldpoint.com honolulu, hi 96822 san francisco, ca 94108 voice.808.539.3932 fax.808.539.3943 cell.808.291.1610 ..................................................................... Associated Messages, from the most recent to the oldest:

    
  1. Re: SKU lookup (Damien Joldersma 1997)
  2. Re: SKU lookup (Kenneth Grome 1997)
  3. Re: SKU lookup (Olin 1997)
  4. Re: SKU lookup (Kenneth Grome 1997)
  5. Re: SKU lookup (Daniel Cameron 1997)
  6. Re: SKU lookup (Damien Joldersma 1997)
  7. Re: SKU lookup (Kenneth Grome 1997)
  8. SKU lookup (Damien Joldersma 1997)
At 12:38 AM 8/21/97, you wrote: >Hello > >Hey how would one write an expression to lookup the last SKU entry made >in a given db, and then add 1 to it, and enter that automatically in the >SKU field? >-- As Ken mentions, the [cart] is great for generating unique skus. However, sometimes you might require a unique sku which is not a random number such as 8721054256023 which is the sort of number you get by using [cart]. For example, what if you are making an employee database and you want to track it using a logical progression (1, 2, 3 etc.) with each new employee's number being one higher than the last.Here is a snippet of code to take the highest sku value from a database and then increment it by one: [search db=yourdatabase.db&grskudata=0&skusort=1] [founditems] [name][math]newsku=[sku][/math] [/founditems] [/search] [math]newsku=(newsku+1)[/math]

Final value=[math]newsku[/math]

To hide the output from a [math][/math] context just enclose it like so [math]newsku=[sku][/math]> This lets the code get parsed without displaying the results. To call the newsku value elsewhere in the template just use [math]newsku[/math] ..................................................................... W O R L D P O I N T I N T E R A C T I V E DANIEL CAMERON web engineer Honolulu San Francisco 2800 woodlawn drive 222 sutter street dcameron@worldpoint.com suite 170 sixth floor www.worldpoint.com honolulu, hi 96822 san francisco, ca 94108 voice.808.539.3932 fax.808.539.3943 cell.808.291.1610 ..................................................................... Daniel Cameron

DOWNLOAD WEBDNA NOW!

Top Articles:

Talk List

The WebDNA community talk-list is the best place to get some help: several hundred extremely proficient programmers with an excellent knowledge of WebDNA and an excellent spirit will deliver all the tips and tricks you can imagine...

Related Readings:

Multiple prices (1997) AppleScript question (1997) [WebDNA] Basic Search (2008) RE: problem with applets embedded in tpl files (1997) RE: WebCatalog2 for NT Beta Request (1997) WebCat2 Append problem (B14Macacgi) (1997) This list needs a digest: rant, rave... (1997) Rename folder under WC3 (2000) Initiating NewCart (1997) NT Manual (1997) Will webdna execute before a [redirect]? (1999) Summing fields (1997) Help with Repost Data msg from form (1997) Rendering out a page (1997) my price won't move (1997) RE: WebCat: Access denied, but why? - The solution. (1997) Sorting Numbers (1997) My slower response (1997) syntax question, not in online refernce (1997) Thankyou.tpl (2000)