Conversation
File and Image attributes report AttributeTypeCode.Virtual, distinguished only via AttributeTypeName ("FileType"/"ImageType"), the same way MultiSelectPicklistType is distinguished. The Virtual case in AttributeSelectionForm's constructor only special-cased MultiSelectPicklistType, so File and Image attributes fell through with addattribute == false and were silently dropped from the filtering attributes list before the dialog rendered. This adds FileType/ImageType checks alongside MultiSelectPicklistType, and extracts a GetDisplayTypeName helper so the Type column shows "File"/"Image" instead of the generic "Virtual" AttributeTypeCode.
|
Really excited to see this one! Missing File and Image columns in the Filtering Attributes picker has been a pain point for a long time, and it's great to finally see a fix. 🎉 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
File and Image attributes never appear in the "Filtering Attributes" picker (opened from Step Registration), for Update or any other message that supports filtered attributes. They are silently excluded before the selection dialog even renders.
Root cause
AttributeSelectionForm's constructor builds its selectable attribute list from an explicit allow-list keyed onAttributeTypeCode:Dataverse doesn't give File or Image (new-style) columns their own
AttributeTypeCode. Both reportAttributeType = Virtual(the same code multi-select picklists use), and the concrete subtype is only distinguishable viaAttributeTypeName.Value("FileType"for File columns,"ImageType"for Image columns) - the exact mechanism already used here to special-case"MultiSelectPicklistType".Because the
Virtualcase only checkedIsPrimaryIdand"MultiSelectPicklistType", every File and Image attribute fell through withaddattribute == falseand was dropped fromm_attributesListbefore the form loaded.CrmAttribute(Wrappers/CrmAttribute.cs) is unaffected - it passes through whateverAttributeType/AttributeTypeNamethe metadata service returns. The bug is isolated to the allow-list inAttributeSelectionForm.Fix
"FileType"and"ImageType"to the existingTypeNamecheck in theVirtualcase, alongside"MultiSelectPicklistType", so File and Image attributes are included in the selectable list.GetDisplayTypeNamehelper and extend it to show"File"/"Image"in the Type column, instead of the generic"Virtual"AttributeTypeCode- consistent with how"MultiSelect Picklist"is already shown instead of"Virtual".No other files needed changes; the
CrmAttribute[]flowing into this form already carries the correctAttributeTypeName.Testing
This is a .NET Framework 4.8 WinForms project, so it wasn't feasible to build/run it in the environment used to prepare this change. The change was reviewed by hand: it only extends an existing allow-list with two additional
AttributeTypeNamevalues and extracts a passthrough display-name helper, with no changes to behavior for any previously-supported attribute type.Manual verification recommended before merge: register/edit a step for the Update message on an entity with a File or Image attribute (e.g. a custom File column) and confirm it now appears, checkable, in the Filtering Attributes dialog, with "File"/"Image" shown in the Type column.
Risk
Low. Only widens the existing allow-list for two additional
AttributeTypeNamevalues and adds a passthrough helper for display text; no behavior changes for attribute types that were already supported.