Subject: RE: Profile Document - Validation (grr)
And again: If you’re using only @getprofilefield and @setprofilefield, you don’t even need to create a form. (And if you do create a form, it will never be used, and its validation code will certainly never fire.)
“a big no-no is a button”
If you’re not using a button to launch the profile form, then what does launch it, and couldn’t that code use @setprofilefield instead?
“My understanding of profile documents is you get 1 per form and is forever associated with that form (even the command to edit the profile document uses the formname). But you are saying I can create a separate form, and have it’s profile associated to a separate form? I may be making it much more complicated than it has to be.”
Yes, you are, and I think I see how. It looks like you think that a profile document must be based on a form that has been used to create a regular, non-profile document, and that it can only be used to store defaults for the fields in new instances of that normal data document. You seem to think that if you have code in a form that uses @command([editprofile]; formname), then that code must use the current form name as the formname argument. And that’s completely incorrect. The faster you disabuse yourself of that misconception, the sooner you’ll be more comfortable with profile docs.
Since they’re invisible, the use/function/value of profile docs can be hard to grasp. Understand that they are just like regular old documents, except they don’t show up in any view. Like any other document, they can contain any data you want to put in them, for whatever reason. Common uses of database-type profile documents (as opposed to keyed, or user-specific, profile docs) are to store keyword lists for list field choices, file names of databases that need to be accessed by code in this database, database preference settings, etc. Note that none of these have to do with the default values of fields, although you certainly can do that. You can even store more than one commonly-used value for each field, and provide all the choices when entering new data.
So hopefully you understand now why Stan suggested in his first post in this thread that not only do you want another form for your profile doc to get rid of the validation formulas, you also want another form for your profile doc so that the user isn’t confused by the identical appearance as to whether he’s working on a data document or a profile document. (Also, you probably don’t want to store defaults for every field in the data form, do you?)