Validating dimension on sales order line in xmlport

kamranshehzadkamranshehzad Member Posts: 165
It throws exception when i try to validate dimension on sales invoice line using xmlport..
if i dont validate it, it works fine but den dimension doesnt it cos sales g/l entries...
any idea?


  • Options
    kamranshehzadkamranshehzad Member Posts: 165
    error message is this..
    Microsoft Dynamics NAV Classic
    The Sales Line does not exist. 
    Identification fields and values:
    Document Type='Invoice',Document No.='620337',Line No.='20000'
  • Options
    genericgeneric Member Posts: 511
    This is one of the main issues when using Nav for integration.

    Many tables, the way the code is written expects that the user is entering the data. So based on that fact if you are inserting the data through code, you have to take care of all the code that works fine for a user but doesn't work when doing it through code.

    In your scenario. A user would insert the invoice line first, and then select a dimension.
    On an XMLPort. the validate occurs first then the record is inserted.

    What are you options? Don't trigger the code, and on insert add your own code and insert the record first and then fire the validation sequence.

    The whole dimension implementation is horrible anyways.
    They should have left Department and Project fields as is and have dimension as new functionality, nothing to do with Department/Project. No stinking synch code.
    They could have added 8 more dimension fields to all the tables and call it 10 dimension, if any company needed more, they could do a modification.
    They could have removed the department/project from the table and just keep it in dimension table.
  • Options
    kinekine Member Posts: 12,562
    I am using this: when importing through XMLPort, I set the source table (the xml element of type table) as temporary and I am processing the data from this table in OnPostXMLPort where I am inserting the data into real tables in a way like when user enters them - it means:

    <Fill primary key>

    <validate other fields>

    Because in this way the dimensions will be filled in correctly...
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    kamranshehzadkamranshehzad Member Posts: 165
    yes i added the funcationality as a trigger , being called after the data import... works fine.

    thanks for your help.
  • Options
    krikikriki Member, Moderator Posts: 9,098
    [Topic moved from 'NAV 2009' forum to 'NAV/Navision' forum]
    Regards,Alain Krikilion
    No PM,please use the forum. || May the <SOLVED>-attribute be in your title!

  • Options
    awarnawarn Member Posts: 261
    Thanks kine, your post helped me a great deal.
Sign In or Register to comment.