Discussion:
Problem in Fetching A User Profile
(too old to reply)
ukeu
2006-05-06 06:07:08 UTC
Permalink
Hi,
When I try to retrieve the profile information for a logged in user,
there is no profile returned.However, the User ID is fetched for this
logged on user. Please assist.

userProfile = profContext.GetProfile(ctx.UserID,"UserObject");

The result returned to userProfile is an <undefined value>

Please help.Thanks in advance
Jeff Lynch
2006-05-09 02:14:08 UTC
Permalink
This is the CS2002 code that I use to return a User Profile object.

private Profile GetUserProfile(string UserID)
{
return CommerceContext.Current.ProfileSystem.GetProfile("user_id",
UserID, "UserObject");
}

The user currently logged in is returned by this code:

string UserID =
CommerceContext.Current.AuthenticationInfo.AuthTicket.UserID;

Let me know if this helps.
--
Jeff Lynch
Ramblings from a [Microsoft] Connected Universe!
http://codebetter.com/blogs/jeff.lynch
Post by ukeu
Hi,
When I try to retrieve the profile information for a logged in user,
there is no profile returned.However, the User ID is fetched for this
logged on user. Please assist.
userProfile = profContext.GetProfile(ctx.UserID,"UserObject");
The result returned to userProfile is an <undefined value>
Please help.Thanks in advance
ukeu
2006-05-19 04:07:31 UTC
Permalink
Thanks a ton Jeff. Im now able to retrieve a profile but have the following
problem.
prof=profContext.GetProfile("user_id",GUID,UserObject");

string FirstName=prof.Properties
["GeneralInfo.u_first_name"].Value.ToString();

I use the above code to fecth the FirstName of the user, but I get an
exception when I run this code. Any inputs?
ukeu
2006-05-19 08:43:39 UTC
Permalink
Jeff. I found out the problem. Please ignore my previous post :) Thanks
once again.
Jeff Lynch
2006-05-19 13:54:12 UTC
Permalink
The profile property "names" are not the same as the SQL field names. Try
using "GeneralInfo.first_name".
--
Jeff Lynch
Ramblings from a [Microsoft] Connected Universe!
http://codebetter.com/blogs/jeff.lynch
Post by ukeu
Thanks a ton Jeff. Im now able to retrieve a profile but have the following
problem.
prof=profContext.GetProfile("user_id",GUID,UserObject");
string FirstName=prof.Properties
["GeneralInfo.u_first_name"].Value.ToString();
I use the above code to fecth the FirstName of the user, but I get an
exception when I run this code. Any inputs?
ukeu
2006-05-22 12:59:20 UTC
Permalink
Jeff. We have a problem in campaigns. Can we have a call on this. Please
furnish your number to ***@gmail.com if you dont mind so that I will
call you. Kindly specify the time when you can be contacted. Please dont
mind the trouble Jeff.

Just to explain our problem:
We need to target ads to certain types of users who land into our
site.Howewver, these users do not have any profile information. Is there
anyway to achieve this using Campaign manager? I would explain in detail
over the call.

Thanks in advance,
Waiting for your mail :)
Jeff Lynch
2006-05-22 14:47:28 UTC
Permalink
I haven't used the "marketing" system in CS2002 and all my work has been
done in B2B sites where all users must have profiles. Perhaps someone from
the Commerce Server team will respond to your request on using ads with
anonymous users.
--
Jeff Lynch
Ramblings from a [Microsoft] Connected Universe!
http://codebetter.com/blogs/jeff.lynch
Post by ukeu
Jeff. We have a problem in campaigns. Can we have a call on this. Please
call you. Kindly specify the time when you can be contacted. Please dont
mind the trouble Jeff.
We need to target ads to certain types of users who land into our
site.Howewver, these users do not have any profile information. Is there
anyway to achieve this using Campaign manager? I would explain in detail
over the call.
Thanks in advance,
Waiting for your mail :)
ukeu
2006-05-23 11:15:48 UTC
Permalink
Thats fine Jeff. Thanks anyways. I have one doubt in Order Processing
though. Is it possible for a userto view his order history?I also need to
display the line item details for him. Kindly assist
J.F. Larente
2006-06-28 20:31:39 UTC
Permalink
You can target users based on their user profile (which you don't have) or
other information by leveraging the TargetingContext.

That being said, you can store the user's profile identifier in a cookie and
load their profile (without logging them in). That way, as soon as they
arrive on the site you can actually target them based on known information.

J.F. Larente
Cactus Commerce
Post by ukeu
Jeff. We have a problem in campaigns. Can we have a call on this. Please
call you. Kindly specify the time when you can be contacted. Please dont
mind the trouble Jeff.
We need to target ads to certain types of users who land into our
site.Howewver, these users do not have any profile information. Is there
anyway to achieve this using Campaign manager? I would explain in detail
over the call.
Thanks in advance,
Waiting for your mail :)
Loading...