Problems with the reserves

RazielRaziel Member Posts: 5
edited 2007-10-18 in Navision Financials
I have a problem with the import of a dataport, it was designed to import a txt file into a sales order, we use validates to import the txt but it does not work as we wish, because I would like to reserve automatically and it is has been impossible to do.

The validate trigger of Product code makes the reserve when you do it manually, but not with the dataport, could anyone help me?

thanks in advance.

Comments

  • Marije_BrummelMarije_Brummel Member, Moderators Design Patterns Posts: 4,262
    Hi,

    Is product code a standard navision field in financials?

    Anyway, have you tried inserting the sales line before you validate the field?

    If the primairy key is complete you can insert the record, then if the record is complete you can do a Modify.
  • DenSterDenSter Member Posts: 8,307
    I always run into things like that, where you set the validation property to 'yes' and it still doesn't validate the fields you want. In those cases you can simply program it in your dataport. Assuming that you have the Item number field mapped to your dataport and your dataitem is called "Sales Line", go into the dataitem you need and press F9 to open the C/AL editor. In the OnAfterImportRecord trigger, type this:
    "Sales Line".VALIDATE("No.");
    
    Of course, this will also do stuff to other fields, so you need to make sure you get the correct results.
  • RazielRaziel Member Posts: 5
    I have made what you suggested, but when I import the file, the reserved quantity is always blank.

    I have designed a Report that only validate the quantity of this sales order and the reserved field is still blank, I think I will Shoot the monitor the next time I see this blank field.

    Thank you.

    ](*,)
  • DenSterDenSter Member Posts: 8,307
    If you want to duplicate a standard Navision process, you need to first figure out what is going on behind the scenes. Turn on the debugger and perform the task that you want to automate. Then, in your code, you duplicate that process and customize it for your needs.

    Apparently, validating the quantity does not do the trick, so you need to figure out what does. I believe there is a function that you can send in a Sales Line that does this, but I'm not sure which one it is. I would turn on the debugger and find out.
  • RazielRaziel Member Posts: 5
    thank you denster, but there is a little problem with the debbuger, I was working as Navision and Sap consultant, and now I am Working in a final customer with Navision, we have no license to do a lot of things.

    So when I debug it is only in process and it takes a lot of time to find the code to reserv, and then I can´t open de code.
  • DenSterDenSter Member Posts: 8,307
    I guess you better buy that license then huh :whistle:

    If you have the dataport designer, you should have access to running the debugger. Are you a SUPER user? Usually I can run the debugger on my customer licenses. Even if you can't open the object designer, you can figure out what the program does and duplicate it in your dataport.
  • ara3nara3n Member Posts: 9,256
    also insert(true) and modify(true). ARe you doing this in your dataport?
    Ahmed Rashed Amini
    Independent Consultant/Developer


    blog: https://dynamicsuser.net/nav/b/ara3n
  • RazielRaziel Member Posts: 5
    Denster, maybe I don´t explain it well, I can run the debugger, but only when I run the process, and I have to read a lot of code before the reserve function.

    And Yes, I use the insert and modify function before the end of the Dataport, in the OnAfterImputRecord
  • KeesMeuzelaarKeesMeuzelaar Member Posts: 26
    Your problem is that even if you run a validate, it only runs the validate of the table.

    The reservation is made from a trigger in the sales order form.

    This will not be run the way you do it, so copy the code from the onaftervalidate of the field quantity in the form.
Sign In or Register to comment.