Re: selectively replacing records within a [founditems]

This WebDNA talk-list message is from

2000


It keeps the original formatting.
numero = 26303
interpreted = N
texte = Ken this is music to my ears!! I hope you are right. I have been painstakingly making sure every db field was assigned its value in every [replace]- whether I wanted to change it or not, replace after replace, site-wide. The reason I did that and the reason I am even doubting your post (below) is because of this from the docs: http://www.smithmicro.com/WebDNAReference/ReplaceContext.html-...Any fieldnames that do not exist in the database are ignored, and any fields you do not specify are left blank in the new record....-JohnKenneth Grome wrote:> >If I want to replace a record of a db within a [founditems] context which finds that > >same record, and I have all the fieldname/value pairs in the [replace] context equal > >to themselves (i.e. the values of the db fields are set to equal those found by the > >search context), but I want to replace a few of the db field's values WITHOUT having > >to use names for the formvariables which are NOT the same as the db fieldname, then > >do you think using the following technique is reliable and recommended? - > > > >(extra carriage returns thrown in for readability) > > > >[Founditems] > >[replace db=Orders.db&eqOrderIDdatarq=[OrderID]] > >StaticVar1=[StaticVar1] > >&StaticVar2=[StaticVar2] > >&StaticVar3=[StaticVar3] > >&ChangingVarValue1=[URL][FormVariables > >name=ChangingVarValue1&exact=T][value][/FormVariables][/URL] > >[/replace] > >[/Founditems] > > > >Will that always ensure that I get the value that was passed from the form in for > >ChangingVarValue1, rather than the value for ChangingVarValue1 that was already in > >the db? > > Yes. > > But remember, if you're not changing StaticVar1 or StaticVar2 or StaticVar3, you don't need them in the replace context -- because webcat replaces only the fields named in the replace context, and it leaves the other fields as they are alone. So this is all the code you need: > > [Founditems] > [replace db=Orders.db&eqOrderIDdatarq=[OrderID]] > ChangingVarValue1=[URL][FormVariables name=ChangingVarValue1&exact=T][value][/FormVariables][/URL] > [/replace] > [/Founditems] > > ================================ > Kenneth Grome, WebDNA Consultant > 808-737-6499, http://webdna.net > ================================ > > ------------------------------------------------------------- > Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. > To end your Mail problems go to . > > 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 ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 Associated Messages, from the most recent to the oldest:

    
  1. Re: selectively replacing records within a [founditems] (PCS Technical Support 2000)
  2. Re: selectively replacing records within a [founditems] (Kenneth Grome 2000)
  3. Re: selectively replacing records within a [founditems] (John Butler 2000)
  4. Re: selectively replacing records within a [founditems] (Kenneth Grome 2000)
  5. selectively replacing records within a [founditems] (John Butler 2000)
Ken this is music to my ears!! I hope you are right. I have been painstakingly making sure every db field was assigned its value in every [replace]- whether I wanted to change it or not, replace after replace, site-wide. The reason I did that and the reason I am even doubting your post (below) is because of this from the docs: http://www.smithmicro.com/WebDNAReference/ReplaceContext.html-...Any fieldnames that do not exist in the database are ignored, and any fields you do not specify are left blank in the new record....-JohnKenneth Grome wrote:> >If I want to replace a record of a db within a [founditems] context which finds that > >same record, and I have all the fieldname/value pairs in the [replace] context equal > >to themselves (i.e. the values of the db fields are set to equal those found by the > >search context), but I want to replace a few of the db field's values WITHOUT having > >to use names for the formvariables which are NOT the same as the db fieldname, then > >do you think using the following technique is reliable and recommended? - > > > >(extra carriage returns thrown in for readability) > > > >[founditems] > >[replace db=Orders.db&eqOrderIDdatarq=[OrderID]] > >StaticVar1=[StaticVar1] > >&StaticVar2=[StaticVar2] > >&StaticVar3=[StaticVar3] > >&ChangingVarValue1=[url][FormVariables > >name=ChangingVarValue1&exact=T][value][/FormVariables][/URL] > >[/replace] > >[/Founditems] > > > >Will that always ensure that I get the value that was passed from the form in for > >ChangingVarValue1, rather than the value for ChangingVarValue1 that was already in > >the db? > > Yes. > > But remember, if you're not changing StaticVar1 or StaticVar2 or StaticVar3, you don't need them in the replace context -- because webcat replaces only the fields named in the replace context, and it leaves the other fields as they are alone. So this is all the code you need: > > [founditems] > [replace db=Orders.db&eqOrderIDdatarq=[OrderID]] > ChangingVarValue1=[url][FormVariables name=ChangingVarValue1&exact=T][value][/FormVariables][/URL] > [/replace] > [/Founditems] > > ================================ > Kenneth Grome, WebDNA Consultant > 808-737-6499, http://webdna.net > ================================ > > ------------------------------------------------------------- > Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. > To end your Mail problems go to . > > 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 ------------------------------------------------------------- Brought to you by CommuniGate Pro - The Buzz Word Compliant Messaging Server. To end your Mail problems go to .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 John Butler

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:

Register First (2000) [WebDNA] To be or not to be friendly (URLs) (2011) Getting it as [raw] (2004) Using Applescript to process WebCatalog functions (1998) Searching multiple Databases (1997) Shipping charges depending on tax rate? (1997) [WebDNA] writefile (2009) Hosts who have upgraded to v5.0? (2003) can pull down menu do a ONCHANGE= without Java script? (2000) Country & Ship-to address & other fields ? (1997) RE: New WebCatalog Version !!! (1997) no global [username] or [password] displayed ... (1997) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) Coding Technique (2000) [WebDNA] SWITCH/CASE or SHOWIF (2008) WebCat2b13MacPlugIn - [include] doesn't allow creator (1997) F3 crashing server (1997) NT beta ReadMe missing (b12-b15) (1997) WebDNA resources (Was: I am sorry...) (2004) Denying access by IP address (2000)