Re: New Feature (now!)
This WebDNA talk-list message is from 2002
It keeps the original formatting.
numero = 42861
interpreted = N
texte = It must be too early in the morning, this is making no sense to me....What's the theDB=db=some.db part?Where are the values for duplicate coming from?:[include file=duplicate]arrgh, nevermind, I'll re-read it in a couple of hours after the caffeinehas kicked in....GK> >I think an excellent new WebDNA feature would be [duplicate]. Toduplicate a> >record now, i have to code all the fields that I want found, and code the> >fields to [append]. All this coding will have to be changed should thefield> >names change. It would be much easier to remove fields I don't want froma> >duplicated record.> >> >Maybe something like this:> >[duplicate SKU=[SKU]]SKU=[cart]&date=[date]&time=[time][/duplicate]> >where the fields you specify replace the duplicated ones, otherwise all> >other fields are duplicated. That sure looks simpler than the reams ofcode> >of doing now!>>>> Take the line breaks out of the example code below, then set the> theDB' value to the proper name=value path to your db, and it will> do exactly what you want to do now -- without waiting for someone at> SMSI to create a [duplicate] context.>> If you put everything in the below example (except the text context)> into an include file, it will work for any webcat db that uses a sku> field for the unique record identifier value simply by preceding the> include tag with the proper text context. Then your code gets very> simple, like this:>> [text]theDB=db=some.db[/text]> [include file=duplicate]>> ... and if you understand how to pass variables into an include file,> you can make your code even simpler by putting nothing more than this> into your template every time you want to duplicate a record in any> webcat db:>> [include file=duplicate&theDB=db=some.db]>> The following code appends a new record with a unique sku value> created via the cart tag, then it sets the formvariable values in the> new record (except for sku which has already been set), then it sets> the remaining listfields values which have not already been set. Of> course this work because (as you know) in append and replace> contexts, webcat only sets the FIRST occurrence of a value assigned> to a field name, then it ignores any others having the same field> name:>> [text]theDB=db=some.db[/text]>> [append [theDB]]> sku=[cart]&> [formvariables]> [name]=[url][value][/url]&> [/formvariables]> [search [theDB]&eqskudatarq=[url][sku][/url]&max=1]> [founditems]> [listfields [theDB]]> [fieldname]=[url][interpret][[fieldname]][/interpret][/url]&> [/listfields]> [/founditems]> [/search]> [/append]>> And if your form has a field in it for every field in the db -- and> if you are populated the form by searching for and retrieving the one> record you wish to duplicate (which seems to be the most effective> way to do what you want to do) -- then you can skip the entire search> context and everything inside it, and instead you can use nothing> more than this code (after removing the new line characters of> course):>> [text]theDB=db=some.db[/text]>> [append [theDB]]> sku=[cart]&> [formvariables]> [name]=[url][value][/url]&> [/formvariables]> [/append]>>> Sincerely,> Kenneth Grome>> ---------------------------------------------------> WebDNA Professional Training and Development Center> 175 J. Llorente Street +63 (32) 255-6921> Cebu City, Cebu 6000 kengrome@webdna.net> Philippines http://www.webdna.net> --------------------------------------------------->> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list
.> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to> Web Archive of this list is at: http://search.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Associated Messages, from the most recent to the oldest:
It must be too early in the morning, this is making no sense to me....What's the theDB=db=some.db part?Where are the values for duplicate coming from?:[include file=duplicate]arrgh, nevermind, I'll re-read it in a couple of hours after the caffeinehas kicked in....GK> >I think an excellent new WebDNA feature would be [duplicate]. Toduplicate a> >record now, i have to code all the fields that I want found, and code the> >fields to [append]. All this coding will have to be changed should thefield> >names change. It would be much easier to remove fields I don't want froma> >duplicated record.> >> >Maybe something like this:> >[duplicate SKU=[SKU]]SKU=[cart]&date=[date]&time=[time][/duplicate]> >where the fields you specify replace the duplicated ones, otherwise all> >other fields are duplicated. That sure looks simpler than the reams ofcode> >of doing now!>>>> Take the line breaks out of the example code below, then set the> theDB' value to the proper name=value path to your db, and it will> do exactly what you want to do now -- without waiting for someone at> SMSI to create a [duplicate] context.>> If you put everything in the below example (except the text context)> into an include file, it will work for any webcat db that uses a sku> field for the unique record identifier value simply by preceding the> include tag with the proper text context. Then your code gets very> simple, like this:>> [text]theDB=db=some.db[/text]> [include file=duplicate]>> ... and if you understand how to pass variables into an include file,> you can make your code even simpler by putting nothing more than this> into your template every time you want to duplicate a record in any> webcat db:>> [include file=duplicate&theDB=db=some.db]>> The following code appends a new record with a unique sku value> created via the cart tag, then it sets the formvariable values in the> new record (except for sku which has already been set), then it sets> the remaining listfields values which have not already been set. Of> course this work because (as you know) in append and replace> contexts, webcat only sets the FIRST occurrence of a value assigned> to a field name, then it ignores any others having the same field> name:>> [text]theDB=db=some.db[/text]>> [append [theDB]]> sku=[cart]&> [formvariables]> [name]=[url][value][/url]&> [/formvariables]> [search [theDB]&eqskudatarq=[url][sku][/url]&max=1]> [founditems]> [listfields [theDB]]> [fieldname]=[url][interpret][[fieldname]][/interpret][/url]&> [/listfields]> [/founditems]> [/search]> [/append]>> And if your form has a field in it for every field in the db -- and> if you are populated the form by searching for and retrieving the one> record you wish to duplicate (which seems to be the most effective> way to do what you want to do) -- then you can skip the entire search> context and everything inside it, and instead you can use nothing> more than this code (after removing the new line characters of> course):>> [text]theDB=db=some.db[/text]>> [append [theDB]]> sku=[cart]&> [formvariables]> [name]=[url][value][/url]&> [/formvariables]> [/append]>>> Sincerely,> Kenneth Grome>> ---------------------------------------------------> WebDNA Professional Training and Development Center> 175 J. Llorente Street +63 (32) 255-6921> Cebu City, Cebu 6000 kengrome@webdna.net> Philippines http://www.webdna.net> --------------------------------------------------->> -------------------------------------------------------------> This message is sent to you because you are subscribed to> the mailing list .> To unsubscribe, E-mail to: > To switch to the DIGEST mode, E-mail to> Web Archive of this list is at: http://search.smithmicro.com/-------------------------------------------------------------This message is sent to you because you are subscribed to the mailing list .To unsubscribe, E-mail to: To switch to the DIGEST mode, E-mail to Web Archive of this list is at: http://search.smithmicro.com/
Gary Krockover
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:
Sorting a Search... (1998)
Resume Catalog ? (1997)
RE: counters from other site? (1998)
(2000)
corrupted jpgs (2003)
Trouble with PIXO and Welcome Plugin (1999)
taxTotal, grandTotal (1997)
[WebDNA] test 2 (2009)
Error Log.db --however (1997)
Linebreak as a delimiter in listwords? (2003)
RE: [WebDNA] I'm stuck... :-( (2009)
[format 40s]text[/format] doesn't work (1997)
WebCatalog [FoundItems] Problem - LONG - (1997)
WebCat2: Found Items syntax, etc. (1997)
search form problem.. (1997)
Max Record length restated as maybe bug (1997)
No more misunderstanding ... yay! :) (1997)
WebCatalog can't find database (1997)
WC Database Format (1997)
[WebDNA] Encode cookies ONLY via "method=Base64" (2008)