Skip to main content

Notifications

Announcements

Microsoft Dynamics NAV (Archive)
Suggested answer

XMLPort Filter with second Table

Posted on by 2

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

  • Suggested answer
    YUN ZHU Profile Picture
    YUN ZHU 62,477 Moderator on at
    XMLPort Filter with second Table

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

News and Announcements

Community Forum Filters

Quick Links

Community Spotlight of the Month

Kudos to Mohamed Amine Mahmoudi!

Blog subscriptions now enabled!

Follow your favorite blogs

TechTalk: How Dataverse and Microsoft Fabric powers ...

Explore the latest advancements in data export and integration within ...

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 283,860 Moderator

#2
Ludwig Reinhard Profile Picture

Ludwig Reinhard Microsoft Employee

#3
Martin Dráb Profile Picture

Martin Dráb 225,155 Moderator

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans