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

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Answered

Retreive filters from JsonObject

(1) ShareShare
ReportReport
Posted on by 26
Hello,
 
I need to use the event 'OnAfterDocumentReady' to merge the purchase order layout with pdf files attached in item card.
The problem is inside the event, I can't get the /document Type/ and /Document No/ of my record.
 
 
I tried to read the json object ObjectPayload, and I found report filters in the /view/ attribute .
Can I Apply the /view/ value to filter my record /Purchase Header/ in AL ?
 
 
 
 
Thanks
 
I have the same question (0)
  • Suggested answer
    YUN ZHU Profile Picture
    95,593 Super User 2025 Season 2 on at
    Hi, I think this requires some string functions to extract the order number first, such as 106044. Then filter from the AL code.
     
    Hopefully other experts can give you better advice.
     
    Thanks
    ZHU
  • Suggested answer
    Shrey Chauhan Profile Picture
    284 on at
    Hello ,

    You can use like this to retrieve the number 106044 :
    // Now, Order number should start with the view value
    // Find the end of the number value (assuming it ends with a period)
    numberEndPos := StrPos(numberStartPos, '.');
    if numberEndPos > 0 then begin
    // Delete everything after the number value
    numberEndPos := numberEndPos - 1;
    numberEndPos := DelStr(numberStartPos, numberEndPos, StrLen(numberStartPos) - numberEndPos + 3);
    end;
    Var
    numberEndPos: Integer;
    numberPos: Integer;
    numberStartPos: Text;
    numberEndPos: text;

    Hope this help
    Thank you,
    ​​​​​​​Shrey
  • Meriah Profile Picture
    26 on at
    Thans you for your answers.
    I used string functions to retrieve "document no" filter .

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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 3,010

#2
Jainam M. Kothari Profile Picture

Jainam M. Kothari 1,270 Super User 2025 Season 2

#3
YUN ZHU Profile Picture

YUN ZHU 1,085 Super User 2025 Season 2

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans