NetTalk Central

Author Topic: Static link to form  (Read 3711 times)

Matthew51

  • Full Member
  • ***
  • Posts: 152
    • View Profile
    • Email
Static link to form
« on: June 03, 2016, 03:09:53 PM »
I want to send out emails that have a link to an invoice, and I'm trying to figure out the best way to do this.  I don't want users to be able to look at the link and guess at links to other invoices.  So including the primary key in the link is not an option.  I looked into the AddBrowseValue function, but the value created does not look to persist on the server long enough for use in an email.

What I am considering is to add a key to the invoice header that contains a GUID.  I could put code in the PreUpdate embed that would read in the record and call StoreMem.

If anyone has a better idea please let me know.

Thanks
Matthew
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template

Bruce

  • Global Moderator
  • Hero Member
  • *****
  • Posts: 11250
    • View Profile
Re: Static link to form
« Reply #1 on: June 06, 2016, 10:50:48 PM »
Hi Matthew,

>> So including the primary key in the link is not an option.

well, depends on your primary key. If you are using auto-numbering then I completely agree. (Personally I don't like using auto-numbering for primary keys.)

>>  I looked into the AddBrowseValue function, but the value created does not look to persist on the server long enough for use in an email.

agreed. BrowseValues are session related so don't last long.

>> What I am considering is to add a key to the invoice header that contains a GUID. 

You could then use _that_ key as the identifier key on your browse and form.

>> I could put code in the PreUpdate embed that would read in the record and call StoreMem.

You could, or if you just set it to use that key all the time then you save yourself some work.

Incidentally an alternative is to have a table in your dict that assigns "one time" mapping from a random string to your auto-numberd ID. This approach has the advantage that you can "time limit" your link, or limit the number of times the link can be used. Which may, or may not, be advantageous.

cheers
Bruce




Matthew51

  • Full Member
  • ***
  • Posts: 152
    • View Profile
    • Email
Re: Static link to form
« Reply #2 on: June 07, 2016, 03:14:45 PM »
Some good suggestions.

Thanks
Matthew
Contractor with 10+ years of NetTalk experience looking for work.
www.linkedin.com/in/matthew-leavitt
BisWare.ca
Check out my free EasyTime Template