Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV forum
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 Super User on at
    XMLPort Filter with second Table

Helpful resources

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 Super User

#2
Martin Dráb Profile Picture

Martin Dráb 225,155 Super User

#3
nmaenpaa Profile Picture

nmaenpaa 101,146

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans