Options

Dimension not validating in rtc

KisuKisu Member Posts: 381
edited 2011-12-30 in NAV Three Tier
I've come up with a odd problem, I've old dataport that imports purchase invoices and its been working fine in classic sql client,

now I made a page for that port and do the import again, it gives me this error:
"xxx is not an available code for that dimension"

It works fine if I REM the dimension validation part of the code and all data comes in except the dimension.

This works without REM on classic client. We've triple checked the dimensions and they are good, as stated they work fine with classic side.

Anyone come up with this kind of error?
K.S.

Comments

  • Options
    KisuKisu Member Posts: 381
    Okay it tries to validate global dimension 1 with global dimension 2 code somehow. This is realy odd as it validates them correctly in classic client.

    I'm really loosing my hair with this, I even made temp table to see the dimension values come correctly from the file.
    ](*,) ](*,)
    K.S.
  • Options
    aseigleaseigle Member Posts: 207
    Correct me if I'm wrong, but the RTC doesn't support dataports... only XMLports.
  • Options
    KisuKisu Member Posts: 381
    aseigle wrote:
    Correct me if I'm wrong, but the RTC doesn't support dataports... only XMLports.

    Yes its xmlport and port works correctly, it brings all the data to temptable and I'm populating the invoice fields from there.

    Process
    xml file -> xml port -> temp table -> invoice header creation from temp table -> invoice line creation from temp table for that invoice -> invoice line dimension validation

    on the temp table global dimension 1 and 2 are in separate colums and when I validate the dimension in classic client it does it right way.

    I create the line before I populate the amounts and other stuff:
          txtPurchaseLine.INIT;
          txtPurchaseLine."Document Type" := txtPurchaseLineTemp."Document type";
          txtPurchaseLine."Document No." := txtPurchaseLineTemp."Document No";
          txtPurchaseLine."Line No." := txtPurchaseLineTemp."Line No";
          txtPurchaseLine.INSERT(TRUE);
    


    After everything else I call the dimension validation, if there is value in the temp table (this is where it works or not depending the client) :-k
    IF txtPurchaseLineTemp."Global Dimension 1" <> '' THEN
            txtPurchaseLine.VALIDATE("Shortcut Dimension 1 Code", txtPurchaseLineTemp."Global Dimension 1");
    
          IF txtPurchaseLineTemp."Global Dimension 2" <> '' THEN
            txtPurchaseLine.VALIDATE("Shortcut Dimension 2 Code", txtPurchaseLineTemp."Global Dimension 2");
    
          txtPurchaseLine.MODIFY(TRUE);
    
    K.S.
  • Options
    KisuKisu Member Posts: 381
    It seems to work like this somehow and I'm not sure why does it work without using VALIDATE() -function?

    Does Modify(TRUE) call the validation when the field is populated. Why there is no word of this in the nav manuals
    txtPurchaseLine."Shortcut Dimension 2 Code" := txtPurchaseLineTemp."Global Dimension 2";
    


    on the page itself there is no validation call for the shortcut 1 and 2 but in its table there is same as the other shortcuts have on page trigger. ](*,)
    K.S.
Sign In or Register to comment.