User properties

Questions and answers on designing your Servoy solutions, database modelling and other 'how do I do this' that don't fit in any of the other categories

User properties

Postby steve1376656734 » Sat Aug 19, 2017 5:53 pm

I am using application.setUserProperty and application.getUserProperty to store and retrieve some information in the local storage f the NG client. This all works perfectly but I now need to delete one of the properties I previously set so that it is no longer in the local storage. Any idea how to do this as there does not seem to be any sort of application.deleteUserProperty() or application.removeUserProperty() method????

Thanks
Steve
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 327
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: User properties

Postby mboegem » Mon Aug 21, 2017 12:09 pm

Hi Steve,

just use:
Code: Select all
application.setUserProperty('myProp', null)


You will see that:
Code: Select all
application.getUserPropertyNames()

Will no longer contain the myProp value.

Hope this helps.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam

Re: User properties

Postby steve1376656734 » Mon Aug 21, 2017 6:51 pm

Thanks Marc - I will try that and see how I get on.

If it works I guess it means that you cannot have a user property set with a specific NULL value.

Thanks
Steve
Steve
SAN Developer
There are 10 types of people in the world - those that understand binary and those that don't
steve1376656734
 
Posts: 327
Joined: Fri Aug 16, 2013 2:38 pm
Location: Ashford, UK

Re: User properties

Postby mboegem » Mon Aug 21, 2017 10:28 pm

steve1376656734 wrote:If it works I guess it means that you cannot have a user property set with a specific NULL value.


Correct, but you can consider a property to have a null value as soon as it doesn't exist.
I never got into a situation where this was blocking.
Marc Boegem
Solutiative / JBS Group, Partner
• Servoy Certified Developer
• Servoy Valued Professional
• Freelance Developer

Image

Partner of Tower - The most powerful Git client for Mac and Windows
User avatar
mboegem
 
Posts: 1743
Joined: Sun Oct 14, 2007 1:34 pm
Location: Amsterdam


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 7 guests

cron