INCONSISTENT error on the G/L entry table when issuing

asemberengasembereng Member Posts: 220
I am having an inconsistent error whenever i issue a finance charge memo to a foreign currency customer. Commented the Consistent function on codeunit 12 and it was posting. One of the entry was in local currency while the other was not converted to local currency causing the transaction to have different values. Can someone please help me sort this out? How can i solve this consistent error??
Thanks
«1

Comments

  • krikikriki Member, Moderator Posts: 9,110
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!


  • asemberengasembereng Member Posts: 220
    I tried that but it seems the codes to add to the finish function is incomplete or i am adding it to the wrong place. Can you help me on this?
  • ara3nara3n Member Posts: 9,256
    In CU 12 in Function
    FinishCodeunit()

    You only need to add the following code after
    GLEntry.INSERT;
    

    //MOD01 Start
    SingleCU.InsertGL(GLEntry);
    //MOD01 End
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • tothytothy Member Posts: 3
    Thanks a alot \:D/ i was getting the same error and i was faced with the task ](*,) of identifying which entry was causing the inconsistency
    I know that and if you think I don't, I know that too
  • ara3nara3n Member Posts: 9,256
    I'm glad this helped you. :)
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • asemberengasembereng Member Posts: 220
    I have placed the codes there but it won't compile.. Its asking me to place until somewhere.. below is codes
    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
    

    Any idea on what i am doing wrong??
  • ara3nara3n Member Posts: 9,256
    try this
    WITH GenJnlLine DO BEGIN
      IF GLEntryTmp.FIND('-') THEN BEGIN
        REPEAT
          GLEntry := GLEntryTmp;
         //MOD01 Start
         SingleCU.InsertGL(GLEntry);
         //MOD01 End
          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;
    
    IF NOT InsertFAAllocDim(GLEntry."Entry No.") THEN
    

    Make sure SingleCU is a variable of type codeunit with 50000 as subtype
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • asemberengasembereng Member Posts: 220
    thanks Its working.. but how can fix this problem.. One of them is taking the foreign exchange conversion while the other is not.. Any idea why?
  • ara3nara3n Member Posts: 9,256
    What country version and Nav version are you on, and have you looked for fixes at MS site?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • asemberengasembereng Member Posts: 220
    I am not sure about what you mean by country version but i assume you are referring to the currency conversion country. I am converting from Euro to Dalasi (Gambian currency) and i am running Navsion 4.0.
  • asemberengasembereng Member Posts: 220
    If i can possibly know how it writes to the G/L entry table when a finance charge memo is issued to a foreign currency customer then that will help alot. Because all transactions is stored on the G/L entry table using the local currency meaning it has to multiply the foreign currency exchange rate to that of the local currency to get the actual amount in LCY.
  • ara3nara3n Member Posts: 9,256
    are you running the W1 version?

    click on help->about.


    I would check partnersource for a fix.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • webweb Member Posts: 102
    I have exactly the same problem. I am running w1 4.0 version. I don't have partnersource access
    Thanks
  • ara3nara3n Member Posts: 9,256
    I searched PartnerSource and didn't find any articles.

    It looks like you need to contact your NSC and ask them to open a Support incident at MS, or try and solve it themselves.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • webweb Member Posts: 102
    we did not have NSC. We are serving as NSC. I want someone to help me fix this problem that is why i am following this post.
    Thanks
  • webweb Member Posts: 102
    My problem is if i place
     GLEntry.CONSISTENT(
        (BalanceCheckAmount = 0) AND (BalanceCheckAmount2 = 0) AND
        (BalanceCheckAddCurrAmount = 0) AND (BalanceCheckAddCurrAmount2 = 0));
        GLEntry.INSERT(TRUE);
    
    To check the consistency error, i have this other error
    G/L entry no. 237689 already exist.
    How can i fix this too.
  • ara3nara3n Member Posts: 9,256
    This problem can't be solved over the web.

    An experienced developer needs to do a remote session and take a look at the database.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • asemberengasembereng Member Posts: 220
    I am running w14.0. can you help me with the codeunit number that translate from foreign currency to local before writing it to the G/L Entry table? Because its only translating one and leaving the other thats why its not accepting it.
    Thanks
  • asemberengasembereng Member Posts: 220
    web how did you solve the initial problem of the inconsistency with the G/L entry table? Translating one transaction and not translating the other. The negative value is always translated while the positive is not.
  • webweb Member Posts: 102
    Some NSC solved it. I don't know how they did it.
    We are not NSC, but we customized Navision.
    I would also like to know who it is solve. Please tell me when you find the solution.
  • asemberengasembereng Member Posts: 220
    Ok.. If i can get to the code where it converts the amount from foreign currency to local currency then maybe i will be able to sort of the problem. Can someone help on this?
  • webweb Member Posts: 102
    I have tried this out:
    
    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.
      }
    }
    
    
    
    
    And in CU 12 I add the following Code in function FinishCodeunit
    
    
    
    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
    
    
    Once you've made the changes. You run the SinleInstanceCU Once.
    Then do what ever you do to get the consistency error.
    Then Run the SingleInstanceCU again.
    You'll see a list of GL lines. You will see why the transaction is not balanced.
    
    But when i try issuing it keeps giving me the follwing error:
    G/L Entry No.'#####' already exists.
    Can any one help me out on this. Assembereng have u got this error and if yes how did you solve it?
    Thanks
    [/code]
  • ara3nara3n Member Posts: 9,256
    You can change the code

    IF NOT TempGLEntry.INSERT THEN BEGIN
    TempGLEntry.DELETEALL;
    TempGLEntry.INSERT;
    END;

    To

    if TempGLEntry.get(GLEntry."Entry No.") then begin
             TempGLEntry.DELETEALL;
             TempGLEntry.INSERT; 
            TempGLEntry := GLEntry; 
            TempGLEntry.insert;
    end;
    
    
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • webweb Member Posts: 102
    I have tried you suggestion but the error still persist.
    I did the change in code you suggested in CU 50000. The consistency function causes the error and that function is in CU 12 not CU 50000.
    Any other suggestion please.
    Thanks.
  • ara3nara3n Member Posts: 9,256
    turn on the debugger and see where the error stops for GL Entry already exists.
    Make sure you log out and in after you made changes to cu 50000.
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • asemberengasembereng Member Posts: 220
    web i am having that error message the only error message i have is the inconsistency error which i still cannot figure out how to solve it. I know why i am having the error because the two amounts are different; one is converted to local currency but the other is not. How to convert the one which is not converting is my problem.. Any Idea???
  • AsallaiAsallai Member Posts: 141
    Hello All,

    I have still the same pboblem, and I'm using the Codeunit above too. But the error is same, nothing changed. When I run the CU50000 and check the lines, all of them are correct. The Amount of lines are 0 (zero) no differences.
    ](*,)
    It is the Purchase Invoice Posting process. Anyone has the same error at this process too? :|
    Thank you.
  • asemberengasembereng Member Posts: 220
    any help guys?
  • Alex_ChowAlex_Chow Member Posts: 5,063
    Every CONSISTENT error is unique. As ara3n already suggested, you will need an experienced developer to help you isolate where in the application it's causing CONSISTENT error instead of just simply trying to troubleshooting it with code.

    To web, you've stated that you're not a NSC, but yet you have the ability to modify protected codeunits and tables which tells me that you most likely stolen a license from a NSC. Maybe the reason you're getting the CONSISTENT error is because of your own doing. My suggestion to you is undo your own mods to see if you're still getting the CONSISTENT error, if you still are, then establish a relationship with a local NSC. They're trained to resolve problems like this.
  • Alex_ChowAlex_Chow Member Posts: 5,063
    asembereng wrote:
    web i am having that error message the only error message i have is the inconsistency error which i still cannot figure out how to solve it. I know why i am having the error because the two amounts are different; one is converted to local currency but the other is not. How to convert the one which is not converting is my problem.. Any Idea???

    You can identify the CONSISTENT error pretty easily. It's finding out where the application is causing the CONSISTENT is the hard part. Unfortunately, every case is different, so that's why ara3n suggest you to contact an experienced NSC to help you.
Sign In or Register to comment.