@SetProfileField problem

Hi!

I have a problem with the @SetProfileField command. I’m really new to the profile document stuff, but I’ve managed to create one with the command:

@Command([EditProfileDocument]; “Profildokument”)

I then created several fields, “AdmITInvest” among others. The field is suppose to be a counter so I make it a numeric field. Every time someone runs an specific action it is suppose to increased with 1 and the starting value for the field is 1001. The action I run is the following:

@SetProfileField(“Profildokument”; “AdmITInvest” ; (AdmITInvest +1))

which in my eyes should work perfectly, but I get a “ERROR: Incorrect data type for operator or @Function: Text expected”.

I’ve tried to change the field to a text field and convert the value to text before I update the field, but I still get error messages. Can anyone give me a hint how to make a counter using a profile document? How the field should be formatted and how the counter action should be coded?

Thanks in advance

Regards Frank

Subject: @SetProfileField problem

The problem is here:

(AdmlTInvest + 1)

In this context, AdmlTInvest is meaningless – it is interpreted as an unavailable value, which is the same as “”, and you can’t add a number to a string. Use @GetProfileField(“Profildokument”; “AdmITInvest”) instead of simply AdmlTInvest.

That, however, will just fix the formula error. You’ll still have a problem. Profile documents are cached by the client, so they make HORRIBLE counters. Each user will only see the changes they made to the profile doc, not changes other users have made. You should only use profile documents for data that is unlikely to change very often, like database settings or user preferences.

Subject: RE: @SetProfileField problem

Hello Stan!

Thanks a lot, all I needed was the @GetProfileField(“Profildokument”; “AdmITInvest”) command and it works like it should. The profile document I created is “database specific”, not “user specific”, so I hope I can use it as a counter for all the users of the database to use. If not I will have to come up with a better solution.

Thanks once again! =)

Regards

Frank