cancel
Showing results for 
Search instead for 
Did you mean: 
cancel
Showing results for 
Search instead for 
Did you mean: 

Community Tip - Have a PTC product question you need answered fast? Chances are someone has asked it before. Learn about the community search. X

get_user_property function

carolynherlin
1-Newbie

get_user_property function




I have a user-defined option in the Preferences dialog box that writes a value to the epic.wcf file. The entry in the epic.wcf file looks like this:



<properties>
<property>
<name>Application1Preference1</name>
<value><string>false</string></value>
</property>



I want to be able to read the value of the <string> element from another .acl file and act on it depending on whether the value is true or false. I'm guessing that I need to use the get_user_property function, but I'm not sure how to use it. Specifically, I don't know what to put as the key. Can anyone enlighten me?



Thanks,

Carolyn Herlin
2 REPLIES 2

Hi Carolyn—



The online help for this function seems pretty straightforward. The key should be the name you’ve assigned to the property, viz. the content of the <name> element in the <property>. Try this:



$pref1 = get_user_property(“Application1Preference1”);

if ($pref1 == “true”) {

# do something

}

else {

# do something else

}



HTH.



--Clay




Thanks, Clay.



I just thought that I needed to put something more complicated as the argument for get_user_property. Just putting Application1Preference1 worked. I didn't realize it was so simple.



Thanks again.

Carolyn

Announcements