Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

If Condition

Posted on by 3,027

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

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: If Condition

    if pos <> 0 then begin

     //your logic here

    end;

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: If Condition

    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
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: If Condition

    or you can use same SETFILTER with FINDSET

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

    IF FINDSET THEN

     REPEAT

       //Your logic here

     UNITL Next = 0;

  • Verified answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: If Condition

    you have to use STRPOS

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: If Condition

    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

  • Suggested answer
    Mohana Yadav Profile Picture
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: If Condition

    did you check this function

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

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: If Condition

    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
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: If Condition

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

  • jsshivalik Profile Picture
    jsshivalik 3,027 on at
    RE: If Condition

    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
    Mohana Yadav 59,139 Super User 2024 Season 2 on at
    RE: If Condition

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

    Forum is not to write code for you.

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

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans