web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

FetchXML - "Expected type of attribute value: System.Guid. Exception raised: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)." Error while using lookup text as input value instead of GUID as input in condition

(0) ShareShare
ReportReport
Posted on by 105

Hi Experts,

I am getting error while using look up text as input value instead of GUID.

And I am getting error   

" Expected type of attribute value: System.Guid. Exception raised: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx)."

My requirement is to import data from Excel and I am checking if value exists in CRM before creating a record with data from excel as below.

Below is my code:

String query = @"<fetch distinct='true' mapping='logical' output-format='xml-platform' version='1.0'>
<entity name='lead'>
<attribute name='fullname'/>
<attribute name='companyname'/>
<attribute name='telephone1'/>
<attribute name='leadid'/>
<order descending='false' attribute='fullname'/>
<filter type='and'>
<condition attribute='new_projectnameid' operator='eq' value='Aparna Cyberlife'/>
</filter>
</entity>
</fetch>";

EntityCollection results = service.RetrieveMultiple(new FetchExpression(query));

Can you please tell me how to do it...

Thanks.

*This post is locked for comments

I have the same question (0)
  • Rajkumar Rajaraman Profile Picture
    on at

    Veer,

    Walkthrough the following blog:

    fixitsanta.blogspot.in/.../crm-2011-quick-find-error.html

    Hope this helps.

    Regards,

    R.Rajkumar

    "Please mark my answer as verified if you found it helpful"

  • Veer Balla Profile Picture
    105 on at

    Hi Rajkumar,

    Thanks for you reply.

    I followed as per your link and in quick find view Project Name lookup (new_projectnameid) is already unchecked

    by default as shown below. 

    3365.Capture.JPG

    It is not checked and I am still getting error.

    Any help please...

    Thanks. 

  • Verified answer
    Shantnu Sharma Profile Picture
    655 on at

    In the condition you have taken the attribute as projectnameid but you are equating it to a string. When a lookup is created, it's value is stored as (in your case) new_projectnameid of type guid and new_projectnameidname as text. Try, new_projectnameidname if it is exposed. You may try this else you will have to provide GUID.

    Please let me know for more clarity.

  • Abhishek Gupta Profile Picture
    2,003 on at

    Hi Veer,

    In your fetchXml Aparna Cyberlife is a text that's why you are getting that particular error. Just try to match with Data Types

  • Surmeet Singh Profile Picture
    3,075 on at

    Hi, the value has to be Guid.

    If the you want to query by name the you will have to use query with link entity like this:

    snap1.PNG

  • Veer Balla Profile Picture
    105 on at

    Hey,

    Your solution worked Shantnu.

    Thanks mate.

  • Shilpa Pahuja Profile Picture
    47 on at

    Hi Shantnu,

    Have you seen this error-

    { "error": { "code": "0x80040203", "message": "An exception System.FormatException was thrown while trying to convert input value 'rt_accountnumber='0003000722'' to attribute 'rt_account_rt_partner.accountid'. Expected type of attribute value: System.Guid. Exception raised: Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).

    We are getting this error in Muelsoft, while SAP is pushing this data to dynamics, muelsoft is throwing this error.

    Do you know what could be the origin of the issue, looks like exception is from CRM only.

    Any help would be appreciated.

    Thanks,

    Shilap Pahuja

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
SA-08121319-0 Profile Picture

SA-08121319-0 4

#1
Calum MacFarlane Profile Picture

Calum MacFarlane 4

#3
Alex Fun Wei Jie Profile Picture

Alex Fun Wei Jie 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans