Discussion:
Accessing the "Organization" object??
(too old to reply)
jarrette
2006-09-19 15:31:02 UTC
Permalink
I've been able to add fields to the general userobject info, but now i'm
trying to expand the "Organization" object, if it even is an object. I've
noticed the UserObject in the object browser, but nothing on any of the other
groups that are listed in bizdesk.

I'm trying to build a separate page for "business" customers to fill in
business info. This page would access and update a organization object, i'm
assuming. Should I just give up and add the business info into the existing
userobject?
Jeff Lynch
2006-09-19 17:09:04 UTC
Permalink
All the various profile obejcts can be accessed in your site code including
the Organization profile.

CommerceContext.Current.OrganizationProfile.Properties["propertyname"].Value
--
Jeff Lynch
MVP Windows Server System - Commerce Server
http://codebetter.com/blogs/jeff.lynch
Post by jarrette
I've been able to add fields to the general userobject info, but now i'm
trying to expand the "Organization" object, if it even is an object. I've
noticed the UserObject in the object browser, but nothing on any of the other
groups that are listed in bizdesk.
I'm trying to build a separate page for "business" customers to fill in
business info. This page would access and update a organization object, i'm
assuming. Should I just give up and add the business info into the existing
userobject?
jarrette
2006-09-19 19:33:02 UTC
Permalink
my coworker is developing this page, so i asked her to compose a reply to you
Jeff....



i am not sure if i am doing it in a rightway being new in commerce server.



Let me put pointwise here,what i am doing:

a. i have added a new property group(say Business) inside "general
information" property group of the exisiting organization profile,through
profile defination manager.



b. Inside this new business group, i have added 5 new business specific
fields.



c. I get redirected to this new business page from another page.This new
page contains only those fields which are present in 'business' group,i added
in step(a).





d. i am trying to update the OrganizationObject table in DB with the values
user fills in the new page,on the button click.To achieve this,what i am
suppose to do?



Currently,Inside the button Click event handler: i am trying to set the
properties of organization object:



ProfileContext profContext = CommerceContext.Current.ProfileSystem;





Microsoft.CommerceServer.Runtime.Profiles.Profile orgProfile =
profContext.CreateProfile(primaryKey,"OrganizationObject");



<PrimaryKeyValue : formField1TextBox.Text >



-and then set the properties to the individual fields like;

ProfilePropertyGroup orgPropGroup =
orgProfile.PropertyGroups["GeneralInfo.Business"];



orgPropGroup["field2"].Value = formField2TextBox.Text;



orgProfile.Update();



Please suggest what i need to add modify to make this work,as its not
writing anything to the organizationObject table.
Jeff Lynch
2006-09-20 22:37:20 UTC
Permalink
Send me an email offline and I'll try to help. Just remove the nospam.

jtlynch@[nospam]houston.rr.com
--
Jeff Lynch
MVP Windows Server System - Commerce Server
http://codebetter.com/blogs/jeff.lynch
Post by jarrette
my coworker is developing this page, so i asked her to compose a reply to you
Jeff....
i am not sure if i am doing it in a rightway being new in commerce server.
a. i have added a new property group(say Business) inside "general
information" property group of the exisiting organization profile,through
profile defination manager.
b. Inside this new business group, i have added 5 new business specific
fields.
c. I get redirected to this new business page from another page.This new
page contains only those fields which are present in 'business' group,i added
in step(a).
d. i am trying to update the OrganizationObject table in DB with the values
user fills in the new page,on the button click.To achieve this,what i am
suppose to do?
Currently,Inside the button Click event handler: i am trying to set the
ProfileContext profContext = CommerceContext.Current.ProfileSystem;
Microsoft.CommerceServer.Runtime.Profiles.Profile orgProfile =
profContext.CreateProfile(primaryKey,"OrganizationObject");
<PrimaryKeyValue : formField1TextBox.Text >
-and then set the properties to the individual fields like;
ProfilePropertyGroup orgPropGroup =
orgProfile.PropertyGroups["GeneralInfo.Business"];
orgPropGroup["field2"].Value = formField2TextBox.Text;
orgProfile.Update();
Please suggest what i need to add modify to make this work,as its not
writing anything to the organizationObject table.
Loading...