Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics NAV (Archived)

Nav2013r2 comparison for GL account numbers in CA/L

Posted on by Microsoft Employee

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

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: Nav2013r2 comparison for GL account numbers in CA/L

    WooooHooooo thank you very much!

  • Verified answer
    Suresh Kulla Profile Picture
    Suresh Kulla 43,745 on at
    RE: Nav2013r2 comparison for GL account numbers in CA/L

    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

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans