Re: [WebDNA] [thisautonumber] and [lastautonumber]

This WebDNA talk-list message is from

2011


It keeps the original formatting.
numero = 106588
interpreted = N
texte = This is a multi-part message in MIME format. --------------060700060104080602080907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I actually discovered the autonumber feature relatively recently (how did I miss this before?). [lastautonumber] and [thisautonumber] are only available inside of the [append] context, so a code should look something like this.. [append db=your.db&autonumber=IDfield]var1=[var1]&var2=[var3][text]lastID=[lastAutonumber][/text][/append] autonumbers are generated as simple numerical increments of 1 - the first record will be given a value of "1", the next "2", and so on. If you need to create record IDs in a custom format, I don't think this will work. On 4/28/11 3:21 PM, Steve Raslevich -Northern Sound & Light wrote: > Hi, > > Can anyone give me a sample of the syntax on how to use > [thisautonumber] and/or [lastautonumber] to assign it to a text or > math variable? I want to [append] to a db using "autonumber" and then > use that same autonumber within a replace further down my template. > > All I found in the online documentation was this: > > You can use [thisautonumber] tag from within an [append] or [replace] > context, to retrieve the current auto-generated number (if the > AUTONUMBER parameter was used). > > > > Is the code below safe to use with a heavily appended database? > > [append db=../../data/sku.db&autonumber=SEQNUM][formvariables > name=_&exact=F][getchars > start=2][name][/getchars]=[url][value][/url]&[/formvariables][/append] > [text]_sku=[lastautonumber][/text] > > Thanks, > Steve > --------------------------------------------------------- This message > is sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us --------------060700060104080602080907 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I actually discovered the autonumber feature relatively recently (how did I miss this before?).  [lastautonumber] and [thisautonumber] are only available inside of the [append] context, so a code should look something like this..

[append db=your.db&autonumber=IDfield]var1=[var1]&var2=[var3][text]lastID=[lastAutonumber][/text][/append]

autonumbers are generated as simple numerical increments of 1 - the first record will be given a value of "1", the next "2", and so on.  If you need to create record IDs in a custom format, I don't think this will work. 



On 4/28/11 3:21 PM, Steve Raslevich -Northern Sound & Light wrote:
Hi,

Can anyone give me a sample of the syntax on how to use [thisautonumber] and/or [lastautonumber] to assign it to a text or math variable?
I want to [append] to a db using "autonumber" and then use that same autonumber within a replace further down my template.

All I found in the online documentation was this:

You can use [thisautonumber] tag from within an [append] or [replace] context, to retrieve the current auto-generated number (if the AUTONUMBER parameter was used).



Is the code below safe to use with a heavily appended database?

[append db=../../data/sku.db&autonumber=SEQNUM][formvariables name=_&exact=F][getchars start=2][name][/getchars]=[url][value][/url]&[/formvariables][/append]
[text]_sku=[lastautonumber][/text]

Thanks,
Steve

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--------------060700060104080602080907-- Associated Messages, from the most recent to the oldest:

    
  1. Re: [WebDNA] [thisautonumber] and [lastautonumber] (Steve Raslevich -Northern Sound 2011)
  2. Re: [WebDNA] [thisautonumber] and [lastautonumber] (Brian Fries 2011)
  3. Re: [WebDNA] [thisautonumber] and [lastautonumber] (Steve Raslevich - Northern Sound 2011)
  4. Re: [WebDNA] [thisautonumber] and [lastautonumber] (Aaron Michael Kaczmarek 2011)
  5. [WebDNA] [thisautonumber] and [lastautonumber] (Steve Raslevich -Northern Sound 2011)
This is a multi-part message in MIME format. --------------060700060104080602080907 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit I actually discovered the autonumber feature relatively recently (how did I miss this before?). [lastautonumber] and [thisautonumber] are only available inside of the [append] context, so a code should look something like this.. [append db=your.db&autonumber=IDfield]var1=[var1]&var2=[var3][text]lastID=[lastautonumber][/text][/append] autonumbers are generated as simple numerical increments of 1 - the first record will be given a value of "1", the next "2", and so on. If you need to create record IDs in a custom format, I don't think this will work. On 4/28/11 3:21 PM, Steve Raslevich -Northern Sound & Light wrote: > Hi, > > Can anyone give me a sample of the syntax on how to use > [thisautonumber] and/or [lastautonumber] to assign it to a text or > math variable? I want to [append] to a db using "autonumber" and then > use that same autonumber within a replace further down my template. > > All I found in the online documentation was this: > > You can use [thisautonumber] tag from within an [append] or [replace] > context, to retrieve the current auto-generated number (if the > AUTONUMBER parameter was used). > > > > Is the code below safe to use with a heavily appended database? > > [append db=../../data/sku.db&autonumber=SEQNUM][formvariables > name=_&exact=F][getchars > start=2][name][/getchars]=[url][value][/url]&[/formvariables][/append] > [text]_sku=[lastautonumber][/text] > > Thanks, > Steve > --------------------------------------------------------- This message > is sent to you because you are subscribed to the mailing list . To > unsubscribe, E-mail to: archives: > http://mail.webdna.us/list/talk@webdna.us Bug Reporting: > support@webdna.us --------------060700060104080602080907 Content-Type: text/html; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit I actually discovered the autonumber feature relatively recently (how did I miss this before?).  [lastautonumber] and [thisautonumber] are only available inside of the [append] context, so a code should look something like this..

[append db=your.db&autonumber=IDfield]var1=[var1]&var2=[var3][text]lastID=[lastautonumber][/text][/append]

autonumbers are generated as simple numerical increments of 1 - the first record will be given a value of "1", the next "2", and so on.  If you need to create record IDs in a custom format, I don't think this will work. 



On 4/28/11 3:21 PM, Steve Raslevich -Northern Sound & Light wrote:
Hi,

Can anyone give me a sample of the syntax on how to use [thisautonumber] and/or [lastautonumber] to assign it to a text or math variable?
I want to [append] to a db using "autonumber" and then use that same autonumber within a replace further down my template.

All I found in the online documentation was this:

You can use [thisautonumber] tag from within an [append] or [replace] context, to retrieve the current auto-generated number (if the AUTONUMBER parameter was used).



Is the code below safe to use with a heavily appended database?

[append db=../../data/sku.db&autonumber=SEQNUM][formvariables name=_&exact=F][getchars start=2][name][/getchars]=[url][value][/url]&[/formvariables][/append]
[text]_sku=[lastautonumber][/text]

Thanks,
Steve

--------------------------------------------------------- This message is sent to you because you are subscribed to the mailing list . To unsubscribe, E-mail to: archives: http://mail.webdna.us/list/talk@webdna.us Bug Reporting: support@webdna.us

--------------060700060104080602080907-- Aaron Michael Kaczmarek

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:

WebCat2b15MacPlugin - showing [math] (1997) Max Record length restated as maybe bug (1997) WebCat2b15MacPlugIn - [authenticate] not [protect] (1997) PC Authorize & Webmerchant (1998) Wireless WebDNA available today! (2000) Fwd: checkboxes (2000) Execute Applescript (1997) Help-.html extention and Serial Number not working. (2000) Support ?? (1997) RE: Questions To Answer (1997) Add Unit Ship Cost to Cart (2000) Where is f2? (1997) [TaxableTotal] - not working with AOL and IE (1997) Why this code works from some places and doesn't from others? (2000) Formvariable won't update (1999) TIP of the DAY - to work or not work (2004) quantity minimum problem (1997) New Server? (2006) Multiple catalog databases and showcart (1997) Tax Rates (1998)