Outlook custom forms "Phantom fields"

  • Thread starter Thread starter Dozer
  • Start date Start date
D

Dozer

Has anyone had any experience with "phantom fields" with
an Outlook custom contact form? I designed a custom
contact form and when I publish the form for the specific
contact folder it opens up exactly the way I designed and
layed it out. The problem I'm running into is after I
save the contact. The form is 5 pages long and the
second page keeps changing back to a version of that page
several revisions back. How is this form reverting back
to a previous layout? I also tried completely removing
all fields from the form and published it with nothing on
it and after it was saved, those fields just showed up
again on the 2nd page. Anyone know how to correct this?
I can't find any info in the knowledge base. Thanks.
 
At first glance - seems like your forms cache isn't cleared which you may
want to do right after you publish your form - suspect that would solve your
immediate problem.

As for "phantom fields" - one thing that we do know for certain is that
Outlook populates the UserProperty collection with fields that don't appear
on it's list of "User defined fields in this item". This will occur anytime
you add a field to a custom form using the "Field Chooser" - you will always
get two fields in the UP collection - one will be the field name you assign
and the other is the "Display Name" of the field you selected using the
Field Chooser. The UserProperty collection "count" and field list will no
longer match what you are expecting and there is no way to delete these
extra fields from the collection via the UI (leastwise no way that we've
found as yet since these fields don't appear anywhere). There is also no way
to determine from the UserProperty collection which of these fields is
actually legitimate and going thru the ItemProperties collection - both of
these field names will have "isUserProperty" set to TRUE. The same thing
holds true if you add a new custom field to the form and then change the
field it points to - to one of the standard fields found in the Field
Chooser list.

In addition - if you "add" the field again to the User Property collection
via code - the Outlook object model will re-add these types of "phantom"
fields (the ones referenced via the field's <display name>) a second time
giving you 2 fields with the same name in the collection (you can add it as
many times as you want - but will only be duplicated once which is in
keeping with how the "item.userproperties.add name, type, true/false" method
is supposed to work).

In short - to simply traverse the UserProperty collection (in VB/VBA for
instance) is highly unreliable unless you know and only use the actual
"property name" to do anything for the fields that you want to work with. It
seems that Outlook uses the user property field info as found in its hidden
message for user fields (message class IPC.MS.REN.USERFIELDS) but which
Microsoft has chosen to leave as "completely undocumented" for anyone else
to interrogate easily. From a UI perspective - it will never appear that
there is an issue for anyone using these forms "manually via the UI" and any
code that uses "explicit" user property "names" (by that I mean "hard
coding" of the property name) - will also never encounter a problem.

If someone has any information that's contrary to what I've described
above - would really like to find out about it.

Karl

--
__________________________________________
Karl Timmermans - The Claxton Group
ContactGenie - Importer 1.3 / DataPorter 2.0
"Power contact importers for MS Outlook '2000/2003"
http://www.contactgenie.com
 
Thanks for the reply Karl. I did try clearing the cache
prior to my posting and that does not work. What seems
to be happening is that the field that I created and then
deleted from the "user defined fields" is what seems to
be re-appearing even thought the initial contact form
does not display these fields or in that specific
layout. Its only when the contact is saved does the
layout revert back to a composition that was a previous
version of that contact form. Its seems to be displaying
the previous version as the saved format of the display
field for the form. I'm going to basically wipe out the
entire user defined fields and start over since you are
indicating that there's no way to erase or remove these
errant fields. Thanks.
-----Original Message-----
At first glance - seems like your forms cache isn't cleared which you may
want to do right after you publish your form - suspect that would solve your
immediate problem.

As for "phantom fields" - one thing that we do know for certain is that
Outlook populates the UserProperty collection with fields that don't appear
on it's list of "User defined fields in this item". This will occur anytime
you add a field to a custom form using the "Field Chooser" - you will always
get two fields in the UP collection - one will be the field name you assign
and the other is the "Display Name" of the field you selected using the
Field Chooser. The UserProperty collection "count" and field list will no
longer match what you are expecting and there is no way to delete these
extra fields from the collection via the UI (leastwise no way that we've
found as yet since these fields don't appear anywhere). There is also no way
to determine from the UserProperty collection which of these fields is
actually legitimate and going thru the ItemProperties collection - both of
these field names will have "isUserProperty" set to TRUE. The same thing
holds true if you add a new custom field to the form and then change the
field it points to - to one of the standard fields found in the Field
Chooser list.

In addition - if you "add" the field again to the User Property collection
via code - the Outlook object model will re-add these types of "phantom"
fields (the ones referenced via the field's <display name>) a second time
giving you 2 fields with the same name in the collection (you can add it as
many times as you want - but will only be duplicated once which is in
keeping with how the "item.userproperties.add name, type, true/false" method
is supposed to work).

In short - to simply traverse the UserProperty collection (in VB/VBA for
instance) is highly unreliable unless you know and only use the actual
"property name" to do anything for the fields that you want to work with. It
seems that Outlook uses the user property field info as found in its hidden
message for user fields (message class
IPC.MS.REN.USERFIELDS) but which
 
First thing I should do is correct something from the original post - was
tired when I wrote it. When you add a field to a custom form using the field
chooser - it does not add the field twice. However, the field will show up
in the contact's "user-Property" collection if you look at it thru code but
does/will "not" show up anywhere in the UI. Ergo, going thru the
User-Properties collection using the count and index properties cannot be
depended on to be correct for various kinds of application uses.

So far - the only time we've seen a field "re-appear" in the scenario you
described is if somewhere this same field has been re-added using the
item.properties.add name, type, TRUE setting - in which case it will show up
twice in the user-property collection and then appear when you view the
contact. Reason for saying this is just in case you have something coded
somewhere in your form that does this. Mind you, we're still going thru a
lot of the variations as we implement a more "bullet-proof" (hopefully)
work-around to this and some other "interesting idiosyncracies" we've run
across. Some of the forms submitted to us have shown this same issue even
when published into a brand new contact folder that has never been used for
anything else before - only solution we've found so date was to get the
customer to rebuild the form - our suspected cause of the problem in this
case is that the form was saved and re-published again from a contact that
already had the extra fields in it at the time the form was re-published (to
stress, that is still only a suspicion on our part at the moment but
rebuilding the form again seems to make this problem disappear).

BTW - for anyone following this - this applies to Outlook 2000, 2002 and
2003.

Karl

--
__________________________________________
Karl Timmermans - The Claxton Group
ContactGenie - Importer 1.3 / DataPorter 2.0
"Power contact importers for MS Outlook '2000/2003"
http://www.contactgenie.com
 
Back
Top