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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

If Condition

(0) ShareShare
ReportReport
Posted on by 3,099

hi

  I have G/L Entry DataItem . I want if Document No is Like 'GR/MBR/OT*'  then amount should be added in a variable else not.

Thanks

*This post is locked for comments

I have the same question (0)
  • Suggested answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    Please always provide what did you try and what problem are you facing.

    Forum is not to write code for you.

  • jsshivalik Profile Picture
    3,099 on at

    Hi

      I am reading Data from G/L Entry table. I want Document No should be like 'GR/MBR/OT*' . * can be any character or characters.

    Thanks

  • Suggested answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    your requirement is clear. I am asking about code that you tried.

  • jsshivalik Profile Picture
    3,099 on at

    Hi

       I am trying like this  with Setfilter and it is working. How we can do if i have to use If conditon

    SETFilter("Document No.", 'GR/MBR/OT*');

    Thanks

  • Suggested answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    did you check this function

    msdn.microsoft.com/.../dd355417(v=nav.90).aspx

  • jsshivalik Profile Picture
    3,099 on at

    Hi

     With Setfilter i have done like this and it is working . If i want to do same thing with if condition how it can be done

    SETFilter("Document No.", 'GR/MBR/OT*');

    Thanks

  • Verified answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    you have to use STRPOS

  • Suggested answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    or you can use same SETFILTER with FINDSET

    SETFilter("Document No.", 'GR/MBR/OT*');

    IF FINDSET THEN

     REPEAT

       //Your logic here

     UNITL Next = 0;

  • jsshivalik Profile Picture
    3,099 on at

    Hi

     U mean to say like this . I want to use with If condition.

    pos := STRPOS("Document No.",'GR/MBR/');

    What it will return

    Thanks

  • Suggested answer
    Mohana Yadav Profile Picture
    61,214 Super User 2026 Season 1 on at

    if pos <> 0 then begin

     //your logic here

    end;

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

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April 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