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
steve1376656734
 
Posts: 177
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

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 SAN Developer

Image
User avatar
mboegem
 
Posts: 1382
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands

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
steve1376656734
 
Posts: 177
Joined: Fri Aug 16, 2013 2:38 pm
Location: Lanzarote

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 SAN Developer

Image
User avatar
mboegem
 
Posts: 1382
Joined: Sun Oct 14, 2007 1:34 pm
Location: Hoofddorp, The Netherlands


Return to Programming with Servoy

Who is online

Users browsing this forum: No registered users and 2 guests