cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
skoofy5
Advocate II
Advocate II

addColumn of related entity

Hi All

 

I'm trying to add a column of a related entity. In this instance from a custom entity to the systemuser to retrieve the 'entityimage_url' field. I can achieve it by adding a linked entity and then the addColumn method, but this creates an outer join filter that causes problems when I try to filter the control. Is it possible to just add the column? I can already retrieve other columns from the systemuser table because the relationship exists, just not this column.

 

Thanks for any help on this!

1 REPLY 1
skoofy5
Advocate II
Advocate II

Just to tease out my problem a bit more...

 

If I use the following code:

 

 

            const userLink = {
                name: "systemuser",
                from: "systemuserid",
                to: "a1a_assigneduser",
                linkType: "outer",
                alias: "assigneduser",
            };

            context.parameters.workflowDataSet.linking.addLinkedEntity(userLink);
            context.parameters.workflowDataSet.addColumn("entityimage_url", "assigneduser");

 

The column is added successfully, but the following filter is added that stuffs up filtering:

skoofy5_0-1607392242843.png

 

My workaround is to add a dummy column from the related systemuser table, retrieve its alias and then use that to add my column like this:

 

            const linkedEnts = context.parameters.workflowDataSet.linking.getLinkedEntities();
            const systemuserTable = linkedEnts.find(x => x.name === "systemuser")
            context.parameters.workflowDataSet.addColumn("entityimage_url", systemuserTable?.alias);

 

I have to do this because the alias isn't 'systemuser', but some random guid that changes on deployment - it would be great if it wasn't. This workaround creates a bug when filtering - when I expect 5 records to be returned the totalresultcount will be accurate, but it will return a full 'page' of data regardless. In my instance that's 50 records as seen below.
skoofy5_0-1607399886542.jpeg



Anyone have a better solution?

Helpful resources

Announcements
PA User Group

Welcome to the User Group Public Preview

Check out new user group experience and if you are a leader please create your group

MBAS Attendee Badge

Claim Your Badge & Digital Swag!

Check out how to claim yours today!

secondImage

Are Your Ready?

Test your skills now with the Cloud Skill Challenge.

secondImage

Demo Extravaganza is Back!

We are excited to announce that Demo Extravaganza for 2021 has started!

MBAS on Demand

Microsoft Business Applications Summit sessions

On-demand access to all the great content presented by the product teams and community members! #MSBizAppsSummit #CommunityRocks

Users online (34,959)