Link to home
Start Free TrialLog in
Avatar of HJohnson
HJohnson

asked on

Outlook newbie question - Modifying a customer form/fields.

I'm trying to open and modify a custom Outlook Form on a different machine than the one it was developed on. When I try to modify the "Initial Value" field and refer to another field on the form, it give me the error that there is an invalid field.. It doesn't seem to know anything about the other fields on the form ?!  
How do I tell Outlook that there are other valid fields that I can reference?

e.g. Initial Value field =   [TripStartDte] ? (error?)
Where [TripStartDte] is a valid field in another part of the form.  

thnx in advanced. Please email ha_johnson@yahoo.ca

Avatar of rjcpjc
rjcpjc

You need to use the proper syntax.  

Try:

Item.UserProperties.Find("TripStartDte").Value

You should get an email notification when this question is updated.  
Avatar of HJohnson

ASKER

Thanks for the reply - I'll try it tonight.  I am using this syntax in VBScript, which works fine, however, why did the [field] syntax work when the form was first created?  
This "Item.UserProperties.Find" syntax will work in the properties fields, such as the Initial Value field?
Item.UserProperties.Find syntax is for all custom fields.  The other syntax only works for standard fields of the item.

The code I gave you was for VBScript.  It will work in VBA as well though.
Thanks for the reply - I'll try it tonight.  I am using this syntax in VBScript, which works fine, however, why did the [field] syntax work when the form was first created?  
This "Item.UserProperties.Find" syntax will work in the properties fields, such as the Initial Value field?
Well, I tried this and I found that some fields work both with the [field] syntax AND the item.userprop.. syntax.  

Other fields don't work with either type of syntax, but give the "Error in initial value formula for 'field1' - unknown field" message.  In some items, it seems that the other items on the form don't exist.

e.g. field1 is a custom item where a formula is being entered in the Initial Value box.  I want to put in an initial value that comes from another field, (field2).
Like "Item.UserProperties.Find("Field2").Value.

I'm somewhat baffled by this...

thnx

Well, I tried this and I found that some fields work both with the [field] syntax AND the item.userprop.. syntax.  

Other fields don't work with either type of syntax, but give the "Error in initial value formula for 'field1' - unknown field" message.  In some items, it seems that the other items on the form don't exist.

e.g. field1 is a custom item where a formula is being entered in the Initial Value box.  I want to put in an initial value that comes from another field, (field2).
Like "Item.UserProperties.Find("Field2").Value.

I'm somewhat baffled by this...

thnx

Well, I tried this and I found that some fields work both with the [field] syntax AND the item.userprop.. syntax.  

Other fields don't work with either type of syntax, but give the "Error in initial value formula for 'field1' - unknown field" message.  In some items, it seems that the other items on the form don't exist.

e.g. field1 is a custom item where a formula is being entered in the Initial Value box.  I want to put in an initial value that comes from another field, (field2).
Like "Item.UserProperties.Find("Field2").Value.

I'm somewhat baffled by this...

thnx

When creating an initial value formula, you should be able to use the [field] syntax.  

One thing to check is to see if the fields that are giving you a problem are fields that are NOT in the "User Defined Fields in Folder" list.  If they are not, you might try to add them.  
None of the fields are in the User Defined Fields in Folder list  (only in the User Defined Field in Item list), as I am attempting to modify the form on a different machine than the one that it was developed on.  I don't have access to the orignal machine any longer.  Does this mean that I have to add all the fields on my form back into the list manually?

It might...not entirely sure though.  Have you published the form on this machine?
Yes I have published it to Personal Forms.  I thought that I could bring in the form on the Field Picker and all of the fields would be there, but the list is blank for this form.
I put the code into VPScript (moved from the Initial Value box), but there is quite a bit if it and it has really slowed down the form.
ASKER CERTIFIED SOLUTION
Avatar of rjcpjc
rjcpjc

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
OK, I tried publishing, but the fields still do not show up.  However, they always seem to be available when referencing them in the VPScript.  According to some documentation that I found, the fields must be associated with a related folder in order for code in boxes like the Initial Value box to work, not just the form itself, but it didn't reference how to do that.
I created the fields in the field chooser and now the Initial Value box (and others, like the Validation box) works with either syntax.  
This has gotten me past the block, but it seems to be real failing in the product - what if I want to give this .OFT form to a client on some other machine and they want to make modifications?  They'll have to enter all the custom fields on the form by hand back into the chooser???

I must be missing something.

Thanks a lot for your help.
I thought that publishing the form in the folder added the fields to the folder.  It seems from your testing that this is not the case.  

I admit that I don't use the Initial Value functionality very often, prefering to set things like this in code.  I do this so that I can set values based on certain conditions.  

That isn't the best or cleanest solution, but it should work.  

Sorry I don't have more advise for you )-:  I will do a little more looking though.
OK, I tried publishing, but the fields still do not show up.  However, they always seem to be available when referencing them in the VPScript.  According to some documentation that I found, the fields must be associated with a related folder in order for code in boxes like the Initial Value box to work, not just the form itself, but it didn't reference how to do that.
I created the fields in the field chooser and now the Initial Value box (and others, like the Validation box) works with either syntax.  
This has gotten me past the block, but it seems to be real failing in the product - what if I want to give this .OFT form to a client on some other machine and they want to make modifications?  They'll have to enter all the custom fields on the form by hand back into the chooser???

I must be missing something.

Thanks a lot for your help.