Skip to content
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion Helper/entity.partial.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,13 @@ public static string GetFormattedAttribValue(this Entity entity, string attribut
{
try
{
if (null != entity && entity.Attributes.Contains(attributeLogicalName))
// Guard on the collection being indexed, not on Attributes. An attribute can
// be present with no formatted value beside it, and then this indexer throws.
// associatedentitytypecode is the one that bites: Dataverse only sends a
// formatted value for it when it can resolve the table, so a template whose
// table was deleted, or that came from another organization, arrives as
// 'none' with nothing formatted and takes the whole load down with it.
if (null != entity && entity.FormattedValues.Contains(attributeLogicalName))
{
return entity.FormattedValues[attributeLogicalName];
}
Expand Down