OBJECT Codeunit 50000 Single Instance CU { OBJECT-PROPERTIES { Date=10/11/07; Time=[ 2:50:02 PM]; Modified=Yes; Version List=MOD01; } PROPERTIES { SingleInstance=Yes; OnRun=BEGIN IF NOT StoreToTemp THEN BEGIN StoreToTemp := TRUE; END ELSE FORM.RUNMODAL(0,TempGLEntry); END; } CODE { VAR TempGLEntry@1000000000 : TEMPORARY Record 17; StoreToTemp@1000000001 : Boolean; PROCEDURE InsertGL@1000000000(GLEntry@1000000000 : Record 17); BEGIN IF StoreToTemp THEN BEGIN TempGLEntry := GLEntry; IF NOT TempGLEntry.INSERT THEN BEGIN TempGLEntry.DELETEALL; TempGLEntry.INSERT; END; END; END; BEGIN END. } }
FinishCodeunit() WITH GenJnlLine DO BEGIN IF GLEntryTmp.FIND('-') THEN BEGIN REPEAT GLEntry := GLEntryTmp; IF GLSetup."Additional Reporting Currency" = '' THEN BEGIN GLEntry."Additional-Currency Amount" := 0; GLEntry."Add.-Currency Debit Amount" := 0; GLEntry."Add.-Currency Credit Amount" := 0; END; GLEntry.INSERT; //MOD01 Start SingleCU.InsertGL(GLEntry); //MOD01 End IF NOT InsertFAAllocDim(GLEntry."Entry No.") THEN
Comments
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Can you please let me know the 'Kitting' Functionality Introduced in Nav-5.0.
I am really interested to know Such New things helps lot...
Regards
KiranKumar
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Tested and approved!
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
Yep, hopefully you are doing that in a backup db.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I'm glad you are approving this one.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Life would suck if I didn't...
Nonetheless, you still rock.
AP Commerce, Inc. = where I work
Getting Started with Dynamics NAV 2013 Application Development = my book
Implementing Microsoft Dynamics NAV - 3rd Edition = my 2nd book
Well, I've got to keep being objective
Eric Wauters
MVP - Microsoft Dynamics NAV
My blog
I can impliment this but the users license gives them an error that they can't use this codeunit. (I had to give it a diff unused #) that is now out of our range.
would adding indirect permissons like
TableData G/L Entry=rimd help? or could it be inserted into another codeunit that is accessible (That would be sloppy tho I think)?
http://www.BiloBeauty.com
http://www.autismspeaks.org
The code only inserts into temporary table not actual table. As long as the user has indirect permission to post glentry, this would work.
As far as not in the license, this 50000 range, I'm assuming most customer start from that range to purchase CU.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://www.BiloBeauty.com
http://www.autismspeaks.org
I had the same issue with another customer as well.
It was taking too long to order the CU. So I used old CU that was used in 2.6 in 100 range but did not longer exists in 4.x but the client has still license to them.
For example Department and Project tables are no longer there but you can import a 2.6 fob object and then use them as other codes.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I start the debugger with a breakpoint just before the error. Then I check the T17-table in another session (of course in a test DB!). The advantage of seeing uncommitted records...
No PM,please use the forum. || May the <SOLVED>-attribute be in your title!
Does anyone know a fix for this?
The invoice rounding is set to .01
I think the problem is caused by the sales tax routine calculating the sales tax for the entire sales invoice, then adjusting the sales lines taxable amounts to make them balance, but not making a corresponding adjustment to the outstanding amount.
http://mibuso.com/blogs/davidmachanick/
There is a setup allow tax differnce to be checked.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I have the tax difference checked.
One of the sales lines has Outstanding amount = 27.06 and the Amount Including Tax = 27.07.
Changing the tax in the Invoicing tab does not change this amount.
Do I need to change the amount inclusing tax on the sales line itself by editing the line?
http://mibuso.com/blogs/davidmachanick/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://mibuso.com/blogs/davidmachanick/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://mibuso.com/blogs/davidmachanick/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
The tax amount on the sales line is non-editable.
I could change it as a developer, but that means I cannot turn over future problems to the user.
This particular order had a partial shipment, so I posted the invoice only, which appears to have fixed the problem. The remaining items are resources which did not appear on the shipment and the sales tax amount now reconciles with the outstanding amount.
http://mibuso.com/blogs/davidmachanick/
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
http://mibuso.com/blogs/davidmachanick/
~SA
thanks
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
I normally use one of the other methods, i.e. create a journal to see what will be posted, or remove the CONSISTENT command to see what was going on. I just recently had a new consistent error, and decided to try this tip, and I must say that its simple, it works and its brilliant.
Well done Ahmed =D>
Leaving the code on customer db won't hurt performance because the function will simply exit out if you haven't run it manually from object designer.
Independent Consultant/Developer
blog: https://dynamicsuser.net/nav/b/ara3n
Yes I noticed this, but in the client didn't want modified code in the live db (that would require audit testing etc). Anyway great tip.
I've seen other postings with code displayed in the way that ara3n has put it in his posting. How do you get a code unit to display all of the properties and code the way that has been posted here? Can this code be imported some how, as is?
Thanks,