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:

Caching problem... (2000) Performance Issue (2000) popups, netscape vs explorer (1997) ShowNext for method=POST (1997) customizing the color of user's pages (1997) WebDNA to Apache RewriteMap (2005) Webcatalog acgi conflict? (1999) taxTotal, grandTotal (1997) WebCat 5 Intranet Question (2003) Submit a Form to a Selected URL (2003) Where is f2? (1997) Stumpted Again (1997) Text data with spaces in them... (1997) The IBC root beer has arrived! (1997) [WebDNA] Some code inside a large loops fail ... but why? (2010) Software & Sites (1998) Limit on nested [ShowIf]'s? (1997) Problems getting parameters passed into email. (1997) RE: includes and cart numbers (1997) How to find 100 most recent additions. (1997)