link to a page, and handling tips-in-fields ?

I have a couple of questions.

I'm building an app that helps me manage some client intake forms that works fairly simply. The main form has a grid that works like a TListview. I'll get an order in and I'll ADD CLIENT. It will add their name, phone# and email to the DB and update it on the grid.

Then I want to get a link to that user's Intake data / Form and send it to them, with something like their phone# or email as a querystring arg to select their record. (I'll hash the value so it's not readable.) They'll click the link and it will find their record then open the Intake Form and populate it with whatever data is there, then open the form for them to view and edit the data.

How do I get a link (URL) to the app and make it work?

How do I test it using Localhost?

Initially, their data record will be empty, except for an ID and maybe the field I use to identify them with (phone or email).

I'm noticing a lot of webs these days are putting text into input fields that are hints as to what to put there. They're a little lighter, and it's not like "real text", so when you click in the field (OnEnter) it sometimes will clear the field, and sometimes will just put the cursor at the front and clear after you type in the first character.

How can I do that? I'm talking about Edit and Memo fields.

When the user has filled out the form, they can hit the Submit button and the data is saved to their record in the DB and a status flag is set to record the timestamp when they returned the form. That will be displayed in the grid as well. Since the form is part of the app, it will just save or update the fields in the DB.

Then I'll see it was updated and look over the form, dispense with with the data, and then click a button to Archive the entry so it is hidden. If there's anything wrong, I'll just send them the link again and tell them what needs to be addressed, and the earlier process will repeat.

This is just for my own use, it's very light-duty, and hopefully it's temporary until a vendor make something similar work in their app.

For TWebEdit and TWebMemo, check out the TextHint property. I think that's what you're after?

1 Like

That's probably what I'm looking for. :)

1 Like

It's not showing up on a TWebMemo

Current Version?

Yes. It doesn't show up in the Designer, but it does show up at run time.

Was supposed to be fixed.... I see it in mine?

I've got all the latest stuff in D10.4.2

Any ideas on the link part (first question)?

You can assign the placeholder text manually if it isn't in the object inspector. I'm on TMS WEB Core 2.6.something but not the very very latest, maybe it got left out somehow. I'll update a bit later and see if it's still there. The link above has an example of that.

As for the links, you can handle this by using "query parameters" as part of the URL. So for example, http://mypage.com/project.html?ClientID=1234 can be sent to someone as a link. When they click on it, this parameter can be retrieved in your app and then used to locate a record or do whatever. Naturally, you'd want it to be a bit obscure, so have some encoding or a random number assigned to the record as the link field, so they don't guess links to other users, that sort of thing, and so you can check whether it is a valid ClientID.

I was thinking of hashing the email or just generate 6 random digits that will only work for a few minutes.

I guess I could put the digits into the email and have a field at the top to enter them.

How can I pull up a specific page? I seem to recall seeing something about that last year... since the URL never changes, it takes some magic to make it happen.

No magic necessary.

In your FormCreate or wherever you initialize things, you can check for the query parameter and then load a form or do whatever. The TMS WEB Core app will start the same way with the regular URL, but the bit after the ? is passed as parameters, like:

?Param1=123&Parm2=abc&Param3=xyz

So when your app starts, you can check for these and decide what to do. Either load a form or locate a record or switch tabs in a pagecontrol.

There is another use for QueryParameters where the parameter can automatically load a particular form (autoloading I think is what this is called in the docs?) but that's assuming you have a bunch of forms and don't want to do this yourself.

As for the encoding bit, if you've got a table or a list or something with the records in it, I'm just suggesting you create a unique random number to go in there as well, and then send that to the person so that it is a bit more tamperproof. GUIDs work well for this, but a bit overkill and makes for really long URLs. Lots of companies do that anyway, but not really necessary. Just create the random ID when you create the record, and then use that as the parameter to lookup or to email them. Better than passing around things like email addresses as keys.

1 Like