Dynamics NAV 2017 MediaSet

aceX
Member Posts: 166
Hi
I like to get the items pictures assigned in Company1 into Company2. This was easy while the Picture field in table Item was BLOB, but now when it is MediaSet I can't to find out how can I do that..
I'm trying with this code:
but nothing happens ... also I'm trying with this:
i can't make to import the pictures in Company2 ...
Does any one know how can I transfer only Picture field from one to another company and how can I check does Picture field has value or not, for example:
Regards
I like to get the items pictures assigned in Company1 into Company2. This was easy while the Picture field in table Item was BLOB, but now when it is MediaSet I can't to find out how can I do that..
I'm trying with this code:
IF Item1.FINDFIRST THEN REPEAT Item2.SETRANGE(''No'', Item1''No''); IF Item2.FINDFIRST THEN BEGIN Item2.CHANGECOMPANY('Company2'); Item2.Picture := Item1.Picture; Item2.MODIFY; END; UNTIL Item1.NEXT = 0;
but nothing happens ... also I'm trying with this:
IF Item1.FINDFIRST THEN REPEAT FileNameExport := 'C:\Temp\' + FORMAT(Item1."No.") + '.jpg'; FileNameImport := 'C:\Temp\' + FORMAT(Item1."No.") + '-1.jpg'; Item2.SETRANGE''No'', Item1''No''); IF Item2.FINDFIRST THEN BEGIN Item2.CHANGECOMPANY('Company2'); Item1.Picture.EXPORTFILE(FileNameExport); Item2.Picture.IMPORTFILE(FileNameImport , 'Demo Image'); END; UNTIL Item1.NEXT = 0;
i can't make to import the pictures in Company2 ...
Does any one know how can I transfer only Picture field from one to another company and how can I check does Picture field has value or not, for example:
IF Item1.Picture <> '' THEN ...does this example for this is ok:
IF Item1.Picture.COUNT > 0 THEN ...
Regards
0
Answers
-
why u EXPORT 'C:\Temp\' + FORMAT(Item1."No.") + '.jpg';
But IMPORT 'C:\Temp\' + FORMAT(Item1."No.") + '-1.jpg';
That another name files...
And check this: MSDN
UPD. U can check this: IMPORTFILE function. Have nice Example for ur issue.1 -
Hi there @Dolsha,
I've already read those posts and I'm using standard examples for Import/Export file functions.
Why I'm using different name while import is a good question. I'm doing that cause export of the image is successful and I don't know why, before the extension type while exporting I'm always get to all pictures -1. As you see I'm get the Item number for the name but when picture is exported if I don't add -1 in import function I get error that the file does not exist. When I go in C:\TEMP folder i see that pictures are exported as
1000-1.jpg
2001-1.jpg
3010-1.jpg etc...
I'm sure there must be a way to import the pictures from company into company without export and import pictures.
Best Regards0
Categories
- All Categories
- 73 General
- 73 Announcements
- 66.6K Microsoft Dynamics NAV
- 18.7K NAV Three Tier
- 38.4K NAV/Navision Classic Client
- 3.6K Navision Attain
- 2.4K Navision Financials
- 116 Navision DOS
- 851 Navision e-Commerce
- 1K NAV Tips & Tricks
- 772 NAV Dutch speaking only
- 617 NAV Courses, Exams & Certification
- 2K Microsoft Dynamics-Other
- 1.5K Dynamics AX
- 320 Dynamics CRM
- 111 Dynamics GP
- 10 Dynamics SL
- 1.5K Other
- 990 SQL General
- 383 SQL Performance
- 34 SQL Tips & Tricks
- 35 Design Patterns (General & Best Practices)
- 1 Architectural Patterns
- 10 Design Patterns
- 5 Implementation Patterns
- 53 3rd Party Products, Services & Events
- 1.6K General
- 1.1K General Chat
- 1.6K Website
- 83 Testing
- 1.2K Download section
- 23 How Tos section
- 252 Feedback
- 12 NAV TechDays 2013 Sessions
- 13 NAV TechDays 2012 Sessions