web
You’re offline. This is a read only version of the page.
close
Skip to main content
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)
Under review by Community Managers

Under review

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

XMLPort Filter with second Table

Posted on by

Hello everyone,

I am trying to filter an XMLPort by another table. The XMLPort mainly contains fields from the HR_MA table. However, there is an additional table called NAPA_MA for personnel payroll.

The key in the HR_MA table is the field "No." and in NAPA_MA the field "Nr".

The filtering should be done based on the "Status" field in the NAPA_MA table. Only records that have the "Aktiv" status (option field) in NAPA_MA should be output.

Here is my attempt, which does not work as it always outputs all records from HR_MA.

HR_MA - Export::OnPreXMLItem()
WITH HR_MA DO BEGIN
  NAPA_MA.RESET;
  NAPA_MA.SETCURRENTKEY(Nr);
  NAPA_MA.SETRANGE(Nr, HR_MA."No.");
  NAPA_MA.SETFILTER(Status, 'Aktiv');
  IF FINDSET THEN BEGIN
    REPEAT
      HR_MA.MARK (TRUE);
    UNTIL NEXT = 0;
  END ELSE
    currXMLport.SKIP;
NAPA_MA.MARKEDONLY(TRUE);
END;

Does anyone have any suggestions for me?
Best regards

Helpful resources

Quick Links

Mansi Soni – Community Spotlight

We are honored to recognize Mansi Soni as our August 2025 Community…

Announcing our 2025 Season 2 Super Users!

A new season of Super Users has arrived, and we are so grateful for…

Congratulations to the July Top 10 Community Leaders!

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics NAV (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans