Temporary table as parameter

Payn3Payn3 Member Posts: 6
Hi, i want to pass a data filled temporary table as parameter to a function from another object(like a xmlport).

The thing is that i have to message one in the function from the form I pass the variable and one in the function that takes that parameter that only shows me the number of records that my temporary table has.

Before i call the function my temporary table has 2000 records, but when I pass that record to the function in my xmlport the temporary table is empty.

Any idea how I should pass the data between the two objects?


  • Options
    Payn3Payn3 Member Posts: 6
    I read that topic again and again and I tried anything without any success.

    What I have is a function in my xml port called "SetTempTable" with only one parameter of type record ,pointing to table 27 and with the attribute TemporaryTable=Yes.

    In the form from which I call that XMLPort I have the next code.

    p_temp as Record pointing to table 27 and TemporaryTable=yes.(Declared as global)
    xmlStock as Record pointing to my XMLPort.

    MESSAGE(FORMAT(p_temp.COUNT)); // here I have 2000 records
    xmlStock.SetTempTable(p_temp); //Now in the SetTempTable I have another MESSAGE that tells me the number of records of the parameter. The result is 0.

    I tried to set the parameter without the temporarytable attribute and it returns me the whole table.

    I don't know what to try to pass that temporary table to the second object.
  • Options
    kinekine Member Posts: 12,562
    Try to enable "Var" on the parameter. You need to pass the record by refference, not value. And you do not need to set temporary on it. If the parameter is passed by refference, the temporary property on the parameter doesn't matter.
    Kamil Sacek
    MVP - Dynamics NAV
    My BLOG
    NAVERTICA a.s.
  • Options
    Payn3Payn3 Member Posts: 6
    Thank you a lot kine. I didn't know about the Var check in Navision.(I don't have too much experience)
Sign In or Register to comment.