Hi folks,
So here is my question, we have 2 table
Quote 1 :N Quotelineitem
So in the table quotelineitem we have many rows that are related to the quote.
For now, I need help on the coding. I want to retrieve all rows in a subgrid where the quoteid = the actual form we're on and then I want to add some text to a specific field call arb_lineitemsid
The code below is able to get me the guid of the actual form I am on which is good but the rest doesn't really work... I need guidance.
EntityReference mfpquotelookup = (EntityReference)entity.Attributes["new_mfpquote"];
Guid QuoteID = mfpquotelookup.Id;
var mfpquotelookupID = mfpquotelookup.Id;
var mfpquotelookupname = mfpquotelookup.Name;
// entity.Attributes.Add("arb_lineitemsid", mfpquotelookupID + "HEY");
QueryExpression qe = new QueryExpression("new_mfpquotelineitem");
qe.Criteria.AddCondition("new_mfpquote", ConditionOperator.Equal, QuoteID);
EntityCollection Colmfpquotelineitems = service.RetrieveMultiple(qe);
foreach (var targetEntity in Colmfpquotelineitems.Entities)
{
entity.Attributes.Add("arb_lineitemsid", mfpquotelookupID + "HEY");
}