Quantcast
Channel: Microsoft Dynamics CRM Forum - Recent Threads
Viewing all articles
Browse latest Browse all 82002

Querying a guid field for related record

$
0
0

Hello,

I have two entities, lets say E1 and E2. In E1, there is a lookup field to the E2. I am storing the Guid of the E2 record selected as lookup in a field in the E1. (Converting Guid to string). Now , in another function I want to retrieve the E2 record by querying the field in which guid is stored in  E1. I am doing the following :

string GuidOfE2record = e1["field in which guid is stored"].ToString();

 var E2record = crmService.Retrieve(schemanameofE2, GuidOfE2record, new ColumnSet("name"));

However, I am facing issues because of string conversion. However , if I remove ToString(), (Tried Guid GuidOfE2record = e1["field in which guid is stored"];)I am facing error that it cannot convert object to guid. How do I solve this issue?


Viewing all articles
Browse latest Browse all 82002

Latest Images

Trending Articles



Latest Images