Form Title based on Designer Form name. Sounds Easy Enough?

Man I feel lame for asking what appears to be such a simple question, but I figure out how to do it.

So in designer if I create a new form and save it as “Form1”, what do I put in my Window Title object to programatically have the same name when used in the Client? I could hard code it, but the idea is that the title will change with the form when it is renamed.

I tried $Title, Title, $Form, Form among others but it always shows as “(Untitled)” in the client?

Subject: Sounds Easy Enough?

Form should do it - without quotes - sometimes you have to force the issue by putting a computed field on your form named “Form” and have the formula be the form name (in quotes) - ecspecially for new docs - I usually code something like:

WinTitle := CompanyName + Contact + …whatever

@If(@IsNewDoc; “New” + Form; WinTitle)

Subject: RE: Sounds Easy Enough?

I added a computed field and named it “Form” with your formula but it still doesn’t work. It produces the "New " but no form name after it. You said I might have to force the issue by putting the form name in quotes, but this is hard coding and would not change with the Designer form name thus defeating its whole purpose of being flexible and changing programmatically.

Surely there has to be a way of accessing the form name?

Here is what I used, maybe I did somthing wrong:

@If(@IsNewDoc; "New " + Form; "Old "+Form)

Subject: RE: Sounds Easy Enough?

You won’t have much luck on a new document – the Form field value will not be assigned early enough to be used as a window title.

Subject: RE: Sounds Easy Enough?

Yeah I’m finding that out the long way. It does work if its saved then closed and reopened, but it would really look better if it could show the form name before having to save without having to hardcode it, I mean the form is already named before creating a new document, why cant it reference the name?

Do you think I can I maybe set the window title name with an event formula or script after its opened (ie in the post open event), If so how? I unsuccessfully tried in PostOpen:

FIELD $Title := Form;

@Command( [ViewRefreshFields] )

Subject: RE: Sounds Easy Enough?

The form field doesnt exist until the document has been saved.

What I do is create a computed field called Form, that contains the form alias.

This means

a) Your window title will work

b) Prevents a user from switching form, saving document and leaving an incorrect form field

Worth making this a standard imo.

Simon

Subject: RE: Sounds Easy Enough?

Hmm, Is the alias somehow accessible programmatically or do you have to hard code it each time also? If so, it doesn’t do me much good. For example, I am adding forms to an existing database. It already has about 50 forms in it and I’m adding 15 or 20 more.

Unless I can access the forms name or alias programmatically before the doc is saved then I would have to manually update the 50 previous forms in designer one at a time. If done Programmatically, I could simply add it to my subform one time and be done with it.

Since I have already named the form in Designer I don’t understand how the form (when being used in the Notes Client) cant retrieve its own name prior to saving?

For example, in Designer open any form and look at the window title tab at the top, That’s the name I want!!! There has to be some way of accessing it programmatically?

Subject: RE: Sounds Easy Enough?

Not that I am aware of, Form is just another text field that is set to the current form alias whenever the document is saved. If a document has never been saved, there is by default, no form field.

If you have control over how the form is created, e.g. they hit a button that you created, you could maybe create a environment var to store the form alias, and pick that up in your subform. But I can see hideous bugs arising that way.

No easy answer I think

Simon