CodeDigger

Is it possible to simply UPDATE one item of information in a User Profile (UserObject row) while leaving the others intact (the way we simply are able to update one item of inform through the Catalog adapter) We have a huge number of items (columns) in the UserObject table and it doesnĄ¯t make sense to pull them all out and then update them again for no reason when we need to update only one item.

How else to achieve this I checked the web methods available for the Profiles Web Service ¨C none seem like a good candidate (something like UpdateItem or SaveProperty)

-------------------- context --------------

In general, you need to pass in ALL elements of the UserObject profile on update. Elements that are not passed in are set to NULL

---------------------------------------------




Re: Commerce Server 2007 Update one item of information through Profiles adapter

Joseph Johnson

CodeDigger,

It doesn't appear that there is a pre-packaged method capable of handling this, as all I see are GetProfile and UpdateProfile, and I think the BizTalk adapter will only work through those two methods.

Of course the easiest approach to take is to get the whole profile, update the single property, and save the whole profile back, but that's pretty ineffecient (as you pointed out).

If you want to optimize this, add a method to the existing profiles web service by inheriting from it. I'm pretty sure this web service has a runtime site context, so you should be able to use the ProfileContex.GetProfile and Profile.Update methods to persist changes back to your database. At this point, you wont be able to use BizTalk Profiles Adapter, so you'll have to write your own BizTalk code to call this web method.






Re: Commerce Server 2007 Update one item of information through Profiles adapter

CodeDigger

Thanks Joe.

This seems a rather oversized oversight to me.

For now, we will create another profile object and associate that with the user.  This way, when we need to update the one item of information, we don't have to worry about passing all of the information in.. just that item.






Re: Commerce Server 2007 Update one item of information through Profiles adapter

CodeDigger

If I wanted to use Profile.Update() web method to update the profile for one property, would I still need to get out all the other properties (there are over 60 of them!) (using GetProfile() I assue) and update ALL OF THEM back Or could I just update the 1 item I am interested in




Re: Commerce Server 2007 Update one item of information through Profiles adapter

Alan F- MSFT

 

Using the profiles web service, all items not passed into a update call will be set to NULL.

Does this answer your question

Thanks!

Alan






Re: Commerce Server 2007 Update one item of information through Profiles adapter

CodeDigger

We have 51 items in the User object table. Which means every time there is a transaction to and fro from this table to update one item, we will need to write out 51 items and back again. Doubtless it will cost in terms of performance and time to develop as well as be vulnerable to bugs, etc.

 

Any ways to get around this more intelligently