Hi
First - i'm not all that familiar with the 3-tier yet and therefor I struggle a little on different development issues.
One thing i'm working on (and struggeling with) at the moment is how to do the following
We have a lot of items (fashion clothes) and needs to attach pictures in NAV to these. In the old NAV (2-tier) I used the Filerec table to browse a folder - filtered on only files with certain characteristics (.jpg and with a special naming so I knew which item to import to). If I found any files I would import them one by one to the correct Item.
How to browse a folder on either the network or locally on the client?
Hope to hear from you.
Regards
Mads Morre
0
Answers
The variables are
SysObj : System.Object.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
SysDir : System.IO.Directory.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
SysList : System.Collections.Generic.List`1.'mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089'
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I'm not able to create/find the specified Globals.
I can create them as DotNet but I can't find the exact Variables your are specifying.
Regards
Mads Morre
If you want to find and define them 'from scratch' please use the assembly : mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
What kind of variabel is CurrentFile? Is that the actual file - if I need to do something with it (import it to an item).
Mads Morre
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I managed to get the code working, but the folder I specify, seems to be from the Serverside. If I ex. Writes 'C:\temp\' it looks at the server - not on my client.
It is a little more complicated because we haven't got any real network folders - we operate totally in Office365.
I think that I have found the network path (UNC-path) to my Office365 - but if this isn't useable, we can copy the files to a folder on my local machine and import from there.
If the UNC-path to Office365 should be useable, it should def. seeing from (my) client side.
It is prob. me who doesn't understand fully the 3-tier solution.
/Mads Morre
If you want to browse the folders on client side (as visible from user PC) you can try to edit the properties on all three DotNET variables and mark them as RunOnClient = Yes
You will also have to add a line of code uploading the file to the server before processiing it:
(C419 is a variable of type codeunit 419)
Slawek
Dynamics NAV, MS SQL Server, Wherescape RED;
PRINCE2 Practitioner - License GR657010572SG
GDPR Certified Data Protection Officer - PECB License DPCDPO1025070-2018-03
I succeded in reading the files in the folder on my client side by using your code and coding tips !!
I'm now working on importing them and then move the file to a "processed" folder, but I will try and figure this out.
Thanks a lot for your input. I'm sure taht i will get more familiar with the 3-tier solution by working with it.
Best Regards
Mads Morre
Maybe you can use it.
https://juhl.blog/2017/07/05/get-filelist-using-net/
This looks interesting. I will use the Temp-table solution to present the data to the users before importing the pictures to the items.
I want to execute code in the worker thread of Dynamics nav , so the RunOnClient property should be set to "No." Is there another method with the RunOnClient property set to "No"?
Best regards,