Skip to main content

Notifications

Announcements

No record found.

Finance | Project Operations, Human Resources, ...
Answered

How to create a display field and have a column header filter ?

(0) ShareShare
ReportReport
Posted on by 419

Hi, 

I red that i couldn't get a column header filter on a field made by a display method.

My question is how could i get that ?

How could i get the same result but the possibility to use column header filter ? What is the best way ?

Thank you.

  • Awaxx Profile Picture
    Awaxx 419 on at
    RE: How to create a display field and have a column header filter ?

    Its working fine thank you GirishS

  • Verified answer
    GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: How to create a display field and have a column header filter ?

    Yes, you need to add DefaultDimensionView as a DataSource to your form and add link between CustTrans and DefaultDimensionView in OnInitialize event handler.

    Also, if it's a custom form you can directly add the link code in init method of the DefaultDimensionView datasource.

    if it's a standard form use event handler.

    Thanks,

    Girish S.

  • Awaxx Profile Picture
    Awaxx 419 on at
    RE: How to create a display field and have a column header filter ?

    Sorry but i m lost now,

    Should i still use a View or just adding DefaultDimensioView as datasource on my form and put the code  :

    ' DefaultDimensionView_ds.queryBuildDataSource().addLink(fieldnum(CustTrans, defaultDimenions),

    fieldnum(DefaultDimensionView, DefaultDimenion));'

    on the onInitialized event on this new datasource ?

  • GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: How to create a display field and have a column header filter ?

    Try like below. It should be on DefaultDimensioView onInialized DataSource method not on execute Query method.

    DefaultDimensionView_ds.queryBuildDataSource().addLink(fieldnum(CustTrans, defaultDimenions),
    fieldnum(DefaultDimensionView, DefaultDimenion));

    Thanks,

    Girish S.

  • Awaxx Profile Picture
    Awaxx 419 on at
    RE: How to create a display field and have a column header filter ?

    So the first datasource to select is defaultdimensionview and then add join datasource Custtrans

    Cause if i do the reverse i didnt get the same relation 

    pastedimage1683024554111v1.png

  • GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: How to create a display field and have a column header filter ?

    No, not needed. You need to set the relation between the CustTrans and DefaultDimensionView in the OnQueryExecuting method of the DefaultDimensionView datasource.

    Relation will be DefaultDimensionView.DefaultDimension == CustTrans.DefaultDimension.

    Thanks,

    Girish S.

  • Awaxx Profile Picture
    Awaxx 419 on at
    RE: How to create a display field and have a column header filter ?

    Should i add something more than that relation to reach my goal ? Computed Column ? New method ?

    Or this relation will be enough ?

    Sorry to bother, i'm newbie and that's the first time i m handling views and this case.

  • Suggested answer
    GirishS Profile Picture
    GirishS 27,832 Super User 2024 Season 1 on at
    RE: How to create a display field and have a column header filter ?

    You can join CustTrans table with DefaultDimensionView. DefaultDimensionView contains field named "Name" where you can filter by Departments and field named "Display value" which will gives you the dimension value.

    Thanks,

    Girish S.

  • Awaxx Profile Picture
    Awaxx 419 on at
    RE: How to create a display field and have a column header filter ?

    Hi guys Bharani Preetham Peraka , GirishS 

    I dont see how i could use my display method on a view ?

    I'm creating my view using CustTrans Table as datasource.

    The field i need to display is the 'DefaultDimension'

    How i could retrieve the same result by using my view ?

    Should i add this method without the 'display' keyword like a view method ?

    Regards.

  • Awaxx Profile Picture
    Awaxx 419 on at
    RE: How to create a display field and have a column header filter ?

    Thank you guys i will try that

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Verified Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,391 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,445 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans