Re: SKU lookup
This WebDNA talk-list message is from 1997
It keeps the original formatting.
numero = 13114
interpreted = N
texte = >Heh Dan:>>I like your post! How about this hack which I think will work.>>>>[search db=yourdatabase.db&grskudata=0&deskusort=1&max=1]> [founditems]> [math]newsku=[sku]+1[/math]> [/founditems]>[/search]>>
Final value=[math]newsku[/math]
>>>>This will sort in decending order, find only 1 (so the highest number)>and then assign it to newsku plus one.Hey Olin,This is exactly what I was going to suggest in the first place! :) ... but then I didn't know if Damien really needed incremented skuvalues or not, so I thought I would show him the [cart] techniquefirst, since it's the easiest and fastest to code.But hey, if the goal is to append records with each new record's skuvalue incremented one higher than the highest existing sku in thedatabase, your code above can be modified just a little, and thenintegrated into an append context as follows:[append db=yourdatabase.db]sku=[searchdb=yourdatabase.db&grskudata=0&deskusort=1&max=1][founditems][math][sku]+1[/math][/founditems][/search]Sincerely, Ken GromeWebDNA Solutionshttp://www.hui.net/dna/webdna.html
Associated Messages, from the most recent to the oldest:
>Heh Dan:>>I like your post! How about this hack which I think will work.>>>>[search db=yourdatabase.db&grskudata=0&deskusort=1&max=1]>
[founditems]>
[math]newsku=[sku]+1[/math]> [/founditems]>[/search]>>
Final value=[math]newsku[/math]
>>>>This will sort in decending order, find only 1 (so the highest number)>and then assign it to newsku plus one.Hey Olin,This is exactly what I was going to suggest in the first place! :) ... but then I didn't know if Damien really needed incremented skuvalues or not, so I thought I would show him the
[cart] techniquefirst, since it's the easiest and fastest to code.But hey, if the goal is to append records with each new record's skuvalue incremented one higher than the highest existing sku in thedatabase, your code above can be modified just a little, and thenintegrated into an append context as follows:[append db=yourdatabase.db]sku=[searchdb=yourdatabase.db&grskudata=0&deskusort=1&max=1]
[founditems][math][sku]+1[/math][/founditems][/search]Sincerely, Ken GromeWebDNA Solutionshttp://www.hui.net/dna/webdna.html
Kenneth Grome
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:
For those of you not on the WebCatalog Beta... (1997)
WebDNA on OS X Tiger (2006)
[Sum] function? (1997)
more trouble with [showif] in [search] = busted [shownext] - SOLVED (2000)
Re:no [search] with NT (1997)
Line items in table cells (1997)
Erotic Sites (1997)
SKU (1997)
Execute Applescript (1997)
Webstar 1.3.1 PPC (1997)
Nav. 4 probs with cart (1997)
Shipping charges based on dollar level (1997)
WebCat editing, SiteGuard & SiteEdit (1997)
Hard Questions ? (1997)
emailer don't work (1998)
Ok here is a question? (1997)
Referrer field to header field conversion (1997)
[cart] not being interpreted inside [founditems] (1997)
RE: [WebDNA] sales tax on shipping (2008)
Problems with date math (1997)