Hi all i have a odd issue. I'm trying to get a value from a field in the quote form and then check agnist it but i can't seem to get it to work. any ideas
Here's my code. I trimmed it just to cut down space. I have highlighted in red where i think the issue is. I have a field that is a whole number called sb_900mhc
Entity CurrentQuoteEntity = new Entity("quote");
var id = context.PrimaryEntityId;
CurrentQuoteEntity = service.Retrieve("quote", id, new ColumnSet("quoteid"));
//CurrentQuote.Get<EntityReference>(executionContext).Id, attributes);
Guid quoteid = CurrentQuoteEntity.Id;
// Create New Price List
Entity newquote = new Entity("quote");
newquote.Id = CurrentQuoteEntity.Id;
// newquote["MH900"] = MH900.Get<string>(executionContext);
service.Update(newquote);
decimal qant = 0m;
string mh900str = MH900.Get<string>(executionContext);
string mh1050str = MH1050.Get<string>(executionContext);
string mh1200str = MH1200.Get<string>(executionContext);
string mh1350str = MH1350.Get<string>(executionContext);
string mh1500str = MH1500.Get<string>(executionContext);
string mh1800str = MH1800.Get<string>(executionContext);
string mh2100str = MH2100.Get<string>(executionContext);
string mh2400str = MH2400.Get<string>(executionContext);
string mh2700str = MH2700.Get<string>(executionContext);
string mh3000str = MH3000.Get<string>(executionContext);
int MHC900 =CurrentQuoteEntity.GetAttributeValue<int>("sb_900mhc");
//return;
{
Entity newQuoteproductsEntity = new Entity("quotedetail");
QueryByAttribute queryun = new QueryByAttribute("uom");
queryun.AddAttributeValue("name", "Primary Unit");
var unittype = service.RetrieveMultiple(queryun).Entities.FirstOrDefault();
//MH900
if (mh900str == "Yes")
{
goto add900;
}
else if (mh900str == "No")
{
goto test1050;
}
add900:
if (MHC900 == 1)
{
goto test1050;
}
does stuff which it should skip if MHC = 1
test1050:
Regards
Dan