You do not need to filter... it will be running for all records - filters will be the problem only if there are more records exported, but not in case that nothing is exported... ;-)
Pls, go to bed, it realy seems that you have some black friday... :whistle:
If nothing is exported, filter will not help...
PK is primary key - it means that if you set filter and then do setrecfilter you will have filtered only for the record which is active - in this case nothing (because there is no FIND or NEXT or GET before....) - if someone will use your code, never will get any data... =;
Comments
Tried you add commit before calling the dataport?
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
there is no error ... it just nothing happens.
It seems that the call of the dataport (from the report) not work.
Lars
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Is the trigger you call this statement from actually getting called / runned?
Little tip:
It's better to call it like :
DATAPORT.RUN(DATAPORT::"Dataport Name");
If it was hard to write, it should be hard to understand."
ExpDat is variable of type Dataport for the requested dataport...
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
If it was hard to write, it should be hard to understand."
the trigger runs (i set a message there).
if i run the dataport manualy than it works ...
but if i call it by code - nothing hapens
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
You probably select a filename manually when you run the dataport. When you run this dataport from the code, you need to set a filename...
If it was hard to write, it should be hard to understand."
From all the postings I have seen in this thread, the one thing that seems to be missing is Filtering before the dataport is Run.
Steve
SETRECFILTER places a filter on the PK. This is not the solution...
If it was hard to write, it should be hard to understand."
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
Emiel
What is the PK?
This line of code
MyRec.SETFILTER(MyField1,'%!..%2',Value1,Value2);
should have been
MyRec := Rec;
Kine
You're right, the problem is "Nothing" is being exported.
Not a good day so far, so I'm going home and going back to bed.
If nothing is exported, filter will not help...
PK is primary key - it means that if you set filter and then do setrecfilter you will have filtered only for the record which is active - in this case nothing (because there is no FIND or NEXT or GET before....) - if someone will use your code, never will get any data... =;
MVP - Dynamics NAV
My BLOG
NAVERTICA a.s.
I am also facing the same problem.
Here below my code
Name DataType Subtype
MyDataPort Dataport (Dataport Name)
tblJIFile.RESET;
CLEAR(MyDataport);
MyDataport.IMPORT(TRUE);
MyDataport.FILENAME(ImpFilename);
MyDataport.SETTABLEVIEW(tblJIFile);
MyDataport.RUN;
When I run the Dataport manually, it works. But call from the report (as mentioned) doesn't trigger the dataport.
Please Help.
Regards
Nasheer.
I got exactly the same problem when I try to run a dataport from a report.
The solution for me was to edit the properties of the dataport. Set value for the UseReqForm on the dataport to 'NO', then i works like a charm.
Regards Jonas