Dataport: Item Journal Line import

Aravindh_NavisionAravindh_Navision Member Posts: 258
Hi Friends,

I have designed a dataport to import Item No., Entry Type, Quantity, Location Code from CSV file. After importing the following fields will get imported in the Item Journals. While posting, say for example, Item A is only 10 nos. in the inventory. But when I try to post 15 nos., normally it pops up with a screen saying the warning that only 10 is there, but you are posting 15. Do you want to post it now? But after importing the records from CSV file, this warning screen is not popping up. Can any please help me how to solve this?

I know that, I need to use the VALIDATE function. but still it is not working.

Item No., Entry Type, Quantity, Location Code are the dataport fields. (Those fileds will be the excel sheet)

I wrote the below coding in Item journal Line - OnAfterImportRecord()
IF xItemNo <> ItemNo THEN BEGIN
  WITH ItemJournal DO BEGIN
    VALIDATE("Line No.", LineNo);
    VALIDATE("Journal Template Name", 'ITEM');
    VALIDATE("Journal Batch Name", 'DEFAULT');
    VALIDATE("Source Code", 'ITEMJNL');
    VALIDATE("Document Date", Date1);
    VALIDATE("Posting Date", Date1);
    DocumentNo1 := FORMAT(Date1,0,'<month,2><day,2><year>') + DocumentNo;
    VALIDATE("Document No.", DocumentNo1);
    VALIDATE("Item No.", ItemNo);
    VALIDATE(Quantity, Quan);
    VALIDATE("Entry Type", EntryType);
    VALIDATE("Location Code", Location);
    INSERT(TRUE);
  END;
END;

xItemNo := ItemNo;

Comments

  • rhpntrhpnt Member Posts: 688
    Use the "Dataport Fields" designer instead of writing validation code in the trigger. Set the field property "CallFieldValidate" to true (where needed) and try again.
  • SavatageSavatage Member Posts: 7,142
    Isn't this the same issue as
    http://mibuso.com/forum/viewtopic.php?f ... 53#p246853

    When you manually enter a item in the journal, do you always set the entry type last as in your code?

    Wouldn't you set the entry type before the item no and the qty.
    In your code order at the time of qty validation the system doesn't know if it's a positive or negative adjustment.

    Try setting the item no and qty last.

    Also as a true test to see if your data port is workin correctly, after importing with data port also enter a line manually. Then in object designer view the table and see if all the fields that get filled with the manual entry also get filled on the data port import line.
    If the don't match you need to correct the data port deficiency
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    Hai,

    I have tried that too. But its not working... :-(

    If I give Item No. before Entry Type it is showing a message saying, "You must specify No. in Item No. ="
  • vijay_gvijay_g Member Posts: 884
    Try to assign your fields in a sequence(by code in dataport) in which you are able to insert manualy in item journal line.
  • Aravindh_NavisionAravindh_Navision Member Posts: 258
    Hi Vijay,

    Thanks for your reply. But it is not working... :-(
  • vijay_gvijay_g Member Posts: 884
    Did you try to debug it..???try to debug why your field not validating?
  • SavatageSavatage Member Posts: 7,142
    Hai,

    I have tried that too. But its not working... :-(

    If I give Item No. before Entry Type it is showing a message saying, "You must specify No. in Item No. ="

    but that's what you are doing in your code
    VALIDATE("Item No.", ItemNo);
    VALIDATE(Quantity, Quan);
    VALIDATE("Entry Type", EntryType);

    did your try type->item no-> qty?
Sign In or Register to comment.