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 :
Microsoft Dynamics NAV (Archived)

Nav2013r2 comparison for GL account numbers in CA/L

(0) ShareShare
ReportReport
Posted on by

I know I am coding something wrong but I am so tired I can figure it out I am turning to mush.  Can someone help? Does not like looking for var....


IF "Job WIP G/L Entry".Type = "Job WIP G/L Entry".Type::"3" then begin
//**SALES
IF("Job WIP G/L Entry"."G/L Account No." >= '19900') and ("Job WIP G/L Entry"."G/L Account No." < '23001') then
INVOICED += "Job WIP G/L Entry"."WIP Entry Amount";
//**RETURNS AND ALLOWANCES
IF ("Job WIP G/L Entry"."G/L Account No." >= '24000') AND ("Job WIP G/L Entry"."G/L Account No." =< '26000') THEN
INVOICED += "Job WIP G/L Entry"."WIP Entry Amount";
end;
if "Job WIP G/L Entry".Type = "Job WIP G/L Entry".Type::"2" then begin
//**RETURNS AND ALLOWANCES
IF ("Job WIP G/L Entry"."G/L Account No." >= '24000') AND ("Job WIP G/L Entry"."G/L Account No." < '26000') THEN
INVOICED += "Job WIP G/L Entry"."WIP Entry Amount";
//**MATERIALS
IF ("Job WIP G/L Entry"."G/L Account No." >= '30000') AND ("Job WIP G/L Entry"."G/L Account No." < '32001') THEN
MATERIAL += "Job WIP G/L Entry"."WIP Entry Amount";
//**LABOR
IF ("Job WIP G/L Entry"."G/L Account No." >= '35000') AND ("Job WIP G/L Entry"."G/L Account No." < '36001') THEN
LABOR += "Job WIP G/L Entry"."WIP Entry Amount";
END;

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Suresh Kulla Profile Picture
    50,245 Super User 2025 Season 2 on at

    Kim,

    I am not sure what is the issue you are facing but i recommend to use IN function instead of <= or >=, which is very neat to understand and small chances of errors

    so for example for your highlighted line the code looks like this

    IF "Job WIP G/L Entry"."G/L Account No." IN ['19900'..'23000'] THEN

  • Community Member Profile Picture
    on at

    WooooHooooo thank you very much!

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 > 🔒一 Microsoft Dynamics NAV (Archived)

#1
HoangNam Profile Picture

HoangNam 7

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans