I have written an XMLport (Import) and I want to store a default path somewhere and then when the XMLport runs it automatically shows this folder / file location and only CSV files. No problem for me in dataports but unsure if this is possible in XMLports?
I have preset the FileName property on the XMLport main properties page with *.csv and this works so that bit at least is solved!
But how can I do the file location bit... :? :?
0
Comments
I've tried copying the dataport request form 'Filename' box I created onto the XLMport request page but it won't appear (running through RTC..)? I just get the error message I input to stop if filename = blank
I've got the usual stuff from a dataport working, ie. I placed a field on the Request Page with sourceexpr of "Filename" (defined as a C/AL global text250) and in the OnLookup trigger call codeunit 412 for the file functionality, passing in path/filename.
This is working, but immediately afterwards another box appears asking for the filename again, this is the standard XMLport import box...
So how do I stop that one popping up?
If I try RequestForm = No then mine stops appearing :shock:
did you manage to solve the problem with pop-up for filename? I'm in the same spot right now and trying to figure out how to aviod the extra pop-up.
thanks,
nobody has an answer to this ?
I am currently in the same situation but impossible to change this path and to dismiss this window. I want everything to be done in automatic.
Thank you for your help^^
A better option for you might be to launch the XMLport from a report (or page) instead. That way you can do all the file selections, etc., from the report's request page, and run the XMLport without the request page shown at all - that should solve the problem.
- Mark
Thank you for your response.
I'll keep your side project is very interresting.
I would like to try this option :
"A better option for you might be to launch the XMLport from a report (or page) instead. That way you can do all the file selections, etc., from the report's request page, and run the XMLport without the request page shown at all - that should solve the problem."
But what it is the correct syntax to start the XMLPORT from a button from a page or start from a code unit (I am in NAV 2009 R2)?
I tried this:
Gfile_MonFichier.CREATE('C:\xx\xxx\xxxx\xx\xxx\xxx.csv');
Gfile_MonFichier.CREATEOUTSTREAM(XmlStream);
XMLPORT.EXPORT(60004, XmlStream);
Gfile_MonFichier.CLOSE;
The result is:
<?xml version="1.0" encoding="UTF-16" standalone="no"?>
<ProductionOrderFile>
<ProductionOrderOF>
<Status>SimulÚ</Status>
<No>OFS000001</No>
<Description>Conteneur non Pyro C42</Description>
<SearchDescription>CONTENEUR NON PYRO C42</SearchDescription>
<Description2/>
<CreationDate>18/09/12</CreationDate>
<LastDateModified>18/09/12</LastDateModified>
<SourceType>Article</SourceType>
<SourceNo>K 0045 H-A</SourceNo>
<RoutingNo>ATV</RoutingNo>
<InventoryPostingGroup>SEMI FINI</InventoryPostingGroup>
<GenProdPostingGroup>SEMI FINI</GenProdPostingGroup>
<GenBusPostingGroup/>
<Comment>Non</Comment>
<StartingTime>11:14:59</StartingTime>
<StartingDate>01/10/12</StartingDate>
<EndingTime>16:45:00</EndingTime>
<EndingDate>01/10/12</EndingDate>
<DueDate>02/10/12</DueDate>
<FinishedDate/>
<Blocked>Non</Blocked>
<ShortcutDimension1Code/>
<ShortcutDimension2Code/>
<LocationCode/>
<BinCode/>
<ReplanRefNo>OFS000001</ReplanRefNo>
<ReplanRefStatus>SimulÚ</ReplanRefStatus>
<Low-LevelCode>0</Low-LevelCode>
<Quantity>60</Quantity>
<UnitCost>0,00</UnitCost>
<CostAmount>0,00</CostAmount>
<WorkCenterFilter/>
<CapacityTypeFilter>Centre de charge</CapacityTypeFilter>
<CapacityNoFilter/>
<DateFilter/>
<ExpectedOperationCostAmt>0</ExpectedOperationCostAmt>
<ExpectedComponentCostAmt>0</ExpectedComponentCostAmt>
<ActualTimeUsed>0</ActualTimeUsed>
<AllocatedCapacityNeed>0</AllocatedCapacityNeed>
<ExpectedCapacityNeed>0</ExpectedCapacityNeed>
<NoSeries>P-DEV</NoSeries>
<PlannedOrderNo/>
<FirmPlannedOrderNo/>
<SimulatedOrderNo/>
<ExpectedMaterialOvhdCost>0,00</ExpectedMaterialOvhdCost>
<ExpectedCapacityOvhdCost>0</ExpectedCapacityOvhdCost>
<StartingDate-Time>01/10/12 11:14</StartingDate-Time>
<EndingDate-Time>01/10/12 16:45</EndingDate-Time>
<CompletelyPicked>Non</CompletelyPicked>
<AssignedUserID>VERONGOU</AssignedUserID>
</ProductionOrderOF>
</ProductionOrderFile>
But I would like this, a simple csv file:
Simulé;OFS000001;Conteneur non Pyro C42;CONTENEUR NON PYRO C42;;18/09/12;18/09/12;Article;K 0045 H-A;ATV;SEMI FINI;SEMI FINI;;Non;11:14:59;01/10/12;16:45:00;01/10/12;02/10/12;;Non;;;;;OFS000001;Simulé;0;60;0;0;;Centre de charge;;;0;0;0;0;0;P-DEV;;;;0;0;01/10/12 11:14;01/10/12 16:45;Non;VERONGOU
If I start the xmlport with a simple menu in nav, the browse windows appear, I select my folder blabla and the result is correct, I have a good csv file but I do not want this browse window appears
Thank in advance
There may be a solution using the XMLport, but I wonder if that's really the best approach for you in this case. By the time you're done, you're actually using almost none of the functionality that you would want an XMLport for (file selection, XML output, etc.). You might be better off just writing some code in a report to generate the CSV file.
I found the problem.
I deployed my development in a version in NAV2013 and it works as I would. I obtained a good csv delimited by ";"
I tested this method from a codeunit:
Gfile_MonFichier.CREATE('C:\xx\xxx\xxxx\xx\xxx\xxx.csv');
Gfile_MonFichier.CREATEOUTSTREAM(XmlStream);
XMLPORT.EXPORT(60004, XmlStream);
Gfile_MonFichier.CLOSE;
So there is a problem for XMLPORT in NAV 2009 R2( v6.00.3212) when it is a type is "variable text".
There is there a fix to apply ?
Thank in advance.