Skip to main content
Microsoft Dynamics NAV forum
Answered

SubPageLink (ListPart) Show either data from one OR another Key

editSubscribe (0) ShareShare
ReportReport
Posted on by 10

Hello All,

This is actually my first post to this forum, so I hope I do it right :)
I have a setup  that looks very mundane at first. 


Using extensions, I have created a new table with some subscription data. This data is related to the customer but on two different key: A "customer no" and a "Invoice customer no." This is because that sometimes some other customer is the customer to be invoiced. 

My goal is to show this in listpart on the customer page. But the listpart should contain both the records where the customer is "customer" OR "invoice customer"

Any ideas are most welcome :)

/Cheers !

Categories:
  • Goonie Profile Picture
    Goonie 10 on at
    RE: SubPageLink (ListPart) Show either data from one OR another Key

    Hi Hannes,

    Sorry for the late reply. I actually never got around to try out your suggestion. We ended up having 2 listparts instead. The customer liked that solution. But I have still marked it as an answer .Thank you for your time :)

  • Goonie Profile Picture
    Goonie 10 on at
    RE: SubPageLink (ListPart) Show either data from one OR another Key

    Thanks a lot for your input - I will try it out, and get back here for the results

  • Verified answer
    Hannes Holst Profile Picture
    Hannes Holst 5,763 on at
    RE: SubPageLink (ListPart) Show either data from one OR another Key

    Hi,

    In such situation, I would utilise a temporary table.

    Make the sourcetable of listpart temporary and create a public function in the listpart-object.

    The function takes one parameter (the customer no.) and looks up the records which do match with the customer no. in either the field "customer no." or "invoice customer no.".

    When such a record is found, write the result in the temporary Rec-table of the listpart.

    I think you have to do a CurrPage.UPDATE in the end to refresh the view.

    To execute the function, simply call it from the "OnAfterGetCurRecord"-trigger of the parent page.

Helpful resources

Quick Links

What Motivates a Super User?

We know many of you visit the Dynamics 365 Community and Power Platform…

Demystifying Copilot with Georg Glantschnig…

Industry experts answer burning questions directly from our amazing Community…

Setting Up Knowledge Sources for Copilot…

Look at how configuring a comprehensive knowledge base is crucial…

Leaderboard

#1
Andre Arnaud de Calavon Profile Picture

Andre Arnaud de Cal... 283,068 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 222,591 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,138

Product updates

Dynamics 365 release plans