Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...Update/Insert UserProfile Record based on value in another UserProfile fieldUpdate/Insert UserProfile Record based on value in another UserProfile field
Previous
 
Next
New Post
6/7/2015 5:18 PM
 

I am trying to work through a way to update a custom profile field based on the value in the Region field.  In this case, if they live in Texas, they below to Region 1, if they live in NY then Region 2.

It makes it more difficult since the values stored in the UserProfile for Region are ID and not names...which makes linking a bit cumbersome...but that can be worked around...

Does anyone have any ideas?  For most of my users this UserProfile row does not exists...so it has to be inserted....if it does exist, it has to be updated.

Any help out there from someone doing something similar?

TIA

 
New Post
6/7/2015 5:29 PM
 
DNN 7.4 uses EntryID from Lists table, you may use to lookup the value (ISO code) and text (English Region Name).
If you need to assign a different ID, you need a translation table (EntryID >> your code) and maybe a Trigger to set/update it automatically

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
6/7/2015 5:34 PM
 

Understood...and as I said...that part of the code is very straight forward.

I guess what I am looking for are examples of coding....probably using a cursor to step through each user and look up their region and then update/insert the value into a custom profile field I have created.

But thank you VERY much for the quick response!!!!

 
New Post
6/8/2015 3:45 AM
 
a Cursor is never a good idea in SQL, unless really needed.
In general, you have the Option of either using an (after insert) Trigger or a scheduled job

Cheers from Germany,
Sebastian Leupold

dnnWerk - The DotNetNuke Experts   German Spoken DotNetNuke User Group

Speed up your DNN Websites with TurboDNN
 
New Post
6/8/2015 8:36 AM
 

Understood...but this is a one off so I am not needing to run more than once...but again thanks for you reply!

 

Roy

 
Previous
 
Next
HomeHomeDevelopment and...Development and...SQL and SQL Ser...SQL and SQL Ser...Update/Insert UserProfile Record based on value in another UserProfile fieldUpdate/Insert UserProfile Record based on value in another UserProfile field


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out