Alan Judi

0

votes
0

answer
5

views

DISTINCT based on multiple columns

I have a groupby in linq that looks like this: var grouped = from all in Allergies.Entities.AsEnumerable() group (Guid)all.GetAttributeValue("allergy.new_foodsensitivityid").Value by new { group = all.GetAttributeValue("new_group"), time = all.GetAttributeValue("new_time"), desc = all.GetAttributeVa...
Alan Judi
0

votes
0

answer
14

views

Left outer join in linq to entites on two entitycollections:

I have two entitycollections that have 3 common attributes. The first entitycollection is called Replacements with attributes of new_time, new_serving, new_desc and other attributes. I have a second entitycollection called NoReplacements which has a bunch of attributes including new_time, new_servin...
Alan Judi
2

votes
1

answer
49

views

System.InvalidCastException (“Specified cast is not valid.”) in a FetchXML query for an OptionSet Attribute

I am trying to retrieve the numeric value of each OptionSet returned by a FetchXML Query. The value retrieved is aliased and I want to cast the aliased value into an integer and store each value into a list. The system gives me an InvalidCastException each time, what should I do to fix this ??? Here...
Alan Judi
1

votes
2

answer
65

views

Why won't records delete?

I wrote a plugin that gets the GUID IDs through fetchXML and uses Batch delete to delete the records in batches of 1000. I debugged the plugin and it shows that the plugin executes all the way through to service.RetrieveMultiple(new FetchExpression(fetchxml)), however, the fetched records are not g...
Alan Judi
1

votes
2

answer
159

views

System.NullReferenceException: Object not set to an instance of an object?

I am writing a plugin that deletes records between two dates when a contract is cancelled... The records to be deleted are from the cancellation date to the end of the contract. Here is the code I am using: using System; using System.Linq; using System.ServiceModel; using Microsoft.Xrm.Sdk; using M...
Alan Judi
3

votes
1

answer
54

views

Plugin Execution Halts After exactly 33 records created, What is the cause?

I have a plugin that creates records in an entity called "Alter Unit Order". It is supposed to create records for each day from contract start date to contract end date. No matter what, the plugin will only create 33 records. I'm thinking its probably because of how many FetchXML queries are being m...
Alan Judi
2

votes
1

answer
263

views

FetchXML vs Query Expression vs LINQ Query: What should I use here?

I need help from those kind enough to provide help! I am running an instance of Dynamics 365 and I need help deciding whether to use FetchXML, LINQ Query or Query expression to query an entity I have called contract lines.... Let me explain the project: Inside the contracts entity, I have contract...
Alan Judi
1

votes
2

answer
61

views

Server Returns Bad Request 400 On REST POST CALL, even though uri is correct

I am trying to add an option label and option value to an optionset field(new_contractserving) found on an entity called new_servingtime. Not sure if I am doing this correctly, but the server throws a 400 Bad request, what's the issue?! var entity = { "new_contractserving": String(OptionValue), "n...
Alan Judi