would like to know if XML Port (with Export Direction) can work with temporary table?
I have a XMLItem called "Item" in my xml port with Source Table = Item (table 27), Temporary = YES
Then I pass the Temp table record "l_recItem" to the xmlport in my Codeunit as below :
XMLPORT.EXPORT(XMLPORT::"Export Item",l_strTestStream,l_recItem);
Then I got the following error:
The Export Item XMLport does not have a XMLItem that uses the table(Table 27 Item) specified
in the function SetTableView
If I change back to Temporary = NO for both variable "l_recItem" & XMLItem "Item" , no error occur & xml file are generated.
But somehow I need to make it as temporary table ... any idea or workaround?
(my version is 5.0sp1 SQL db)
Thanks
0
Answers
Thanks anyway. :P
How did you manage to pass the temp table to the xmlport?
After reading Vjeko's blog on temp table's:
http://vjeko.com/blog/some-tips-and-hin ... #more-1264
my conclusion was: no possibility to use temp tables on a xmlport.export
Regards
Benno
Note: what is explained on the article @Benno67 shared is true and important. Whenever you pass a variable by reference using the VAR keyword, the TEMPORARY keyword has no effect in setting the record passed as parameter as temporary. The record will remain so as it is: if you pass a temporary record it will be temporary, if you pass a "physical" record it will be physical, no matter what the TEMPORARY keyword says. Despite this, it is a good practice to put the TEMPORARY keyword anyway wherever you expect a temporary record to be passed as parameter, because it represent a nice hint to whoever will use the function in future