MscrmTools / MscrmTools.PolymorphicLookupCreator

GNU General Public License v3.0
6 stars 7 forks source link

The functionality does not support working with Custom Activity Entity #3

Closed DynamicSadFun closed 2 years ago

DynamicSadFun commented 3 years ago

On the interface side, as soon as you add a custom activity entity to the lookup, the functionality stops working correctly. In this case, it shows data only for this entity - not for any others. Almost certainly the problem is not in your tool, but in the functionality of the lookup itself.

ryanperrymba commented 3 years ago

Hi @DynamicSadFun thanks for pointing this out. I have a similar scenario wherein adding a specific entity causes the lookup to no longer show any other entities. But, it is not an activity entity.

Testing hypotheses at moment: It does not appear to be due to a reciprocal / additional relationship conflict. I had a corresponding relationship pointing the other, but removed it, leaving only the one relationship. Removing and recreating did not resolve.

@MscrmTools (Tanguy), you are a rockstar. Thanks for putting this together. I noted the MSFT documentation for mult-table relationships currently only covers the WebAPI and is still missing entirely from the SDK / OrgService documentation. I'm not clear if this is an issue with the UI Control, or the relationship just yet. I'll have a look over the code / entitymetadata from the WebAPI / verify if the relationship works regardless of the UI, and let you know if I find anything.

Update: Have confirmed I am able to populate the field via API. Appears issue is with the UI.

mtone commented 3 years ago

@ryanperrymba I am populating & retrieving data via a plugin and it works fine as well, it does seem to be just the UI. The populated field name is black and cannot be clicked, and the lookup view only shows a single entity. Views still work and links are clickable there.

I had one custom activity entity too so I thought it was due to that. FWIW I created the lookup & relationships manually with SDK 9.0.2.42 (so not an issue with XrmToolBox specifically) and added/removed some relationships afterwards as well -- maybe this is the culprit? Also wondering what happens if we remove a relationship target used by some field values? Does it resolves the issue when managed through JS WebApi calls? Need to do more tests...

SDK is documented here.

Is this still preview? GA was scheduled for Sept 17, 2021 and the doc page don't mention preview.

Edit: So far the closest thing to a clue I have is one custon non-activity entity that is causing the problem is imported from an on-prem solution.

ryanperrymba commented 3 years ago

@mtone As far as I can tell, this is now GA, but am not 100% sure. Documentation is still fairly brief One thing I did find interesting is that the OData type to create these is ComplexLookupAttributeMetadata, but the resulting field is still the LookupAttributeMetadata. Given my application is a fully automated logging process, I've proceeded with my project. In the meanwhile, I have a ticket opened with MSFT regarding the UI issue and will let you know what I find out.

MscrmTools commented 3 years ago

The preview status is more on the UI side (since there is some remaining bugs and no UI to handle the configuration) than in the backend side. It's GA so safe to use as a column type for storage but preview for the UI. At least, this is what I understood when asking MS

daryllabar commented 3 years ago

Make sure you add the table to the APP!!!!

https://support.microsoft.com/en-us/topic/-lookup-records-shown-for-some-entities-but-not-others-d0339621-08fb-5cef-a5b9-007a7582306c

I think this can be closed @MscrmTools, although you may want to put a warning or a reminder in the tool.

ryanperrymba commented 3 years ago

Thank you @daryllabar! This is spot on.

To further clarify: If none of the related entities are in the current app, it works fine. In my case I had several entities enabled which all worked until I added one that was in the app, at which point only it would show. Adding the remaining entities to the app fixed the issue.

I agree the warning would help many users and that the issue can be closed. I noted the article you shared doesn't include the word polymorphic, so may not be as readily found. Thanks for the find. Adding to my blog.