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 caffeine has kicked in....GK > >I think an excellent new WebDNA feature would be [duplicate]. To duplicate 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 the field > >names change. It would be much easier to remove fields I don't want from a > >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 of code > >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:

    
  1. Re: New Feature (now!) (Gary Krockover 2002)
  2. Re: New Feature (now!) (Kenneth Grome 2002)
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 caffeine has kicked in....GK > >I think an excellent new WebDNA feature would be [duplicate]. To duplicate 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 the field > >names change. It would be much easier to remove fields I don't want from a > >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 of code > >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:

Where's Cart Created ? (1997) Conveting Characters to Graphics (1997) Close Databases Crash? (1998) Strange Form Occurrence on Log In Pages (2005) Smith Micro SUPPORT? (2000) b12 cannot limit records returned and more. (1997) Include a big block of text (1997) Re2: frames & carts (1997) Setting up shop (1997) Great product and great job ! (1997) Missing something simple?? (1998) windows 95 netscape 3.01 browser bug? (1997) Database Helper missing? (2000) zip code vs tax rate database request (2002) Multiple prices (1997) form data submission gets truncated (1997) append db wierdness (1999) php vs WebCatalog (2000) protect tag on NT IIS (1997) Bug? (1997)