Page 1 of 1

Adding Custom Fields For Customer

Posted: Tue Mar 10, 2015 4:14 am
by mbartens
I'm creating a site that allows people to purchase subscriptions to the site which will give them member discounts.
When they subscribe I need to collect some information that I can query later. Adding product options isn't enough.
What is the best way to go about this? Will I be using the ac_CustomFields table? Thanks!!

Re: Adding Custom Fields For Customer

Posted: Tue Mar 10, 2015 6:23 am
by david-ebt
You can also use the ac_UserSettings table. It can store FieldName and FieldValue pairs of data for users.

You use

Code: Select all

string ValueToGet = AbleContext.Current.User.Settings.GetValueByKey("FieldToGet")
to get the value for a user.

And you use

Code: Select all

AbleContext.Current.User.Settings.SetValueByKey("FieldToSave", "ValueToSave")
to save the value for a user.

I hope that gets you pointed in the right direction.

Re: Adding Custom Fields For Customer

Posted: Tue Mar 10, 2015 8:58 am
by mbartens
Haven't tried saving yet but displaying is working great! Thank you for your help!