Skip to main content

Possible solutions for ‘Failed to set value for profile property ’email_address’.’ and Object or data matching the name, range, or selection criteria was not found within the scope of this operation.

Last week I ran in to two issues, “Failed to set value for profile property ’email_address’ and “Object or data matching the name, range, or selection criteria was not found within the scope of this operation”

Following are the two exceptions.

An exception has occured.

ExceptionType: 'CommerceProfileSystemException'
ExceptionMessage: 'Failed to set value for profile property 'email_address'.'
StackTrace: ' at Microsoft.CommerceServer.Runtime.Profiles.ProfileProperty.set_Value(Object value)
at Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipProvider.CreateUser(String username, String password, String email, String passwordQuestion, String passwordAnswer, Boolean isApproved, Object providerUserKey, MembershipCreateStatus& status)
at Microsoft.Commerce.UI.WebParts.CommercePropertyBaseWebPart.CreateUser()
at Microsoft.Commerce.UI.WebParts.CommercePropertyBaseWebPart.OnBubbleEvent(Object source, EventArgs args)'
Source: 'Microsoft.CommerceServer.Runtime'
TargetSite: 'Void set_Value(System.Object)'
Inner exception:
ExceptionType: 'COMException'
ExceptionMessage: 'Exception from HRESULT: 0xC1004043'
StackTrace: ' at ADODB.Field.set_Value(Object pvar)
at Microsoft.CommerceServer.Runtime.Profiles.ProfileProperty.set_Value(Object value)'
Source: 'ADODB'
TargetSite: 'Void set_Value(System.Object)'

And

Object or data matching the name, range, or selection criteria was not found within the scope of this operation.
Stack Trace:
[COMException (0x80040e19): Object or data matching the name, range, or selection criteria was not found within the scope of this operation.]
Microsoft.CommerceServer.Interop.Profiles.IProfileObject2.GetInfo() +0
Microsoft.CommerceServer.Runtime.Profiles.Profile.Refresh() +166
[CommerceProfileSystemException: Failed to refresh profile state from underlying stores.]
Microsoft.CommerceServer.Runtime.Profiles.Profile.Refresh() +454
Microsoft.CommerceServer.Runtime.Profiles.UpmMembershipUser.ValidateUser(String password) +55
System.Web.UI.WebControls.Login.AuthenticateUsingMembershipProvider(AuthenticateEventArgs e) +75
   System.Web.UI.WebControls.Login.AttemptLogin() +152
System.Web.UI.WebControls.Login.OnBubbleEvent(Object source, EventArgs e) +124
System.Web.UI.Control.RaiseBubbleEvent(Object source, EventArgs args) +70
System.Web.UI.Page.RaisePostBackEvent(IPostBackEventHandler sourceControl, String eventArgument) +29
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2981

Following are the checkpoint which helped me to resolve the issue.

The connection string was having invalid provider.

clip_image002

Also check following possibility.

Check Ravi’s Blog for details

  • The reason is the guid passed already exists in the user object.

Check de-Hao’s Blog

  • check for all the custom attribute for the user object tables ( SQL and Commerce server Properties)
  • check and associate the properties to data source under commerce server manager
  • check you donn’t have case mistake in MetadataDefinitions.xml.

Get PageLayout Name in Sharepoint but having a performance issue

I googled and found one of the easy way to get the PageLayoutName.

if (PublishingWeb.IsPublishingWeb(web))
{
PublishingWeb publishingWeb = PublishingWeb.GetPublishingWeb(web);
PublishingPageCollection publishingPages = publishingWeb.GetPublishingPages();
PublishingPage publishPage = null;
var spfile = SPContext.Current.File;
Guid id = spfile.UniqueId;
if (publishingPages[id] != null)
{
publishPage = PublishingPage.GetPublishingPage(publishingPages[id].ListItem);
currentPageLayout = publishPage.Layout.Name;
if (currentPageLayout.EndsWith(".aspx"))
{
currentPageLayout = currentPageLayout.Substring(0, currentPageLayout.Length - 5);
}
}
}

The above code is having a heavy performance issue as I am getting all the PublishingPages and searching is in Pages.

One of the already ways is to use CAML Query in

SharePoint/MOSS Enter Key On Search Box Not Working In Firefox

I cam across a strange situation where the page of my SharePoint website just refreshes itself when I search on my site using the Enter key. I noticed this was only a problem when I use Firefox.

On Goggling I found following solutions

http://social.msdn.microsoft.com/Forums/en-US/sharepointecm/thread/87574c13-91d6-48fe-8346-01e77e0094b3

http://blog.drisgill.com/2009/08/firefox-doesnt-respond-to-enter-key-in.html

http://blogs.msdn.com/b/jjameson/archive/2009/10/01/enter-key-does-not-submit-search-in-moss-2007-from-firefox.aspx
I modified the solution by Jeremy Jameson, to suit my requirements.

    <script language="javascript"> function replaceOnKeyPress()
    {
    var theInputID = $("input[name$='InputKeywords']").attr("id");
    if(typeof(theInputID) != "undefined")
    {
    var theFunction=theInputID.replace("InputKeywords", "");
    var LastindextOf =theFunction.lastIndexOf("");
    if (LastindextOf >0)
    {
    theFunction=theFunction.substring(LastindextOf+1,theFunction.length);
    theFunction = theFunction + "_Submit();";
    var txt = document.getElementById(theInputID);
    var browser = navigator.appName;
    if (txt && (browser == "Netscape"))
    {
    txt.onkeypress = function(e)
    {
    var key = String.fromCharCode(e.keyCode);
    if (key == "\n" || key == "\r")
    {
    eval(theFunction);
    return false;
    }
    }
    }
    }
    }
    }
    replaceOnKeyPress();
    </script>

Extending Microsoft Commerce Server 2009 web part extensibility kit for SharePoint 2007

I found this article is very useful to Extends Out Of Box(OOB ) commerce server 2009 extensibility kit. It will take less then 10 minutes time to extend.

Original Source : http://blogs.msdn.com/commerce/archive/2010/04/21/using-microsoft-commerce-server-2009-web-part-extensibility-kit-for-sharepoint-2007-effectively.aspx

Full credit and Thanks to matin.larijani

Note: Creation of our own namespaces is not cover in this article.

Here you go.

If you have worked with a Commerce Server 2009 SharePoint site (Default Site aka Template Pack) you have probably noticed that the quickest and most efficient way of re-skinning this site is to create new XSLT templates for XSLT Web Parts and manipulating the style sheets (CSS) using SharePoint Designer. Using these tools will give you the ability to leverage the Content Management capability of Microsoft Office SharePoint Server 2007 to manage changes in your SharePoint site

Custom SharePoint 404 page works in IE but shows HTML tags in Firefox

A strange thing I noticed is My404Page was not working properly on Firefox, I then tested it on IE and it worked.

When I browse my website it shows the HTML tags on the page.

clip_image002

When I test the site using https://dewani.net/123.aspx My custom 404 page showed up correctly

When I test the site using https://dewani.net/123 My custom 404 page showed up HTML tags.

When I digging and goggling I found it