You can use a FetchXml or linked entities. This will return using RetrieveMultiple, but you can still get a single result.
// Put this in a string variable (Field Names are only examples):
string fetchXml - "<fetch version='1.0' output-format='xml-platform' mapping='logical' distinct='false'>
<entity name='quote'>
<attribute name='name' />
<attribute name='customerid' />
<attribute name='opportunityid' />
<filter type='and'>
<condition attribute='quoteid' operator='eq' value='{A73F6DF6-7F85-E711-80D8-0050569B3FA1}' />
</filter>
<link-entity name='opportunity' from='opportunityid' to='opportunityid' visible='false' link-type='outer' alias='a_c6cc66c9ea83e71180d80050569b3fa1'>
<attribute name='title' />
</link-entity>
</entity>
</fetch>"
EntityCollection totalCount = service.RetrieveMultiple(new FetchExpression(fetchXml));
if (totalCount.Entities.Count > 0)
{
// Get attribute value from linked entity
}
// Option 2 use linked entities
QueryExpression query = new QueryExpression
{
ColumnSet = new ColumnSet(true),
EntityName = "quote",
LinkEntities =
{
new LinkEntity()
{
LinkToEntityName = "opportunity",
LinkToAttributeName = "opportunityid",
LinkFromEntityName = "quote",
LinkFromAttributeName = "opportunityid",
LinkCriteria =
{
Conditions =
{
new ConditionExpression("quoteid", ConditionOperator.Equal, quoteid),
}
},
}
}
};
EntityCollection entities = service.RetrieveMultiple(query);