MediaSet in temporary records
                
                    viljarp                
                
                    Member Posts: 3                
            
                        
            
                    Hi! I'm building an image gallery page. The pictures should not be stored to the database but to the server folder. I am able to implement this by importing the file to the temporary table Media or MediaSet field Rec."Picture Media".ImportFile(FilePath, '');
I notice that each time when creating the temporary records, the Tenant Media records are created. I guess, that will consume a lot of space in database. In cloud version the media records are not included to the database size but in OnPrem they are.
I wonder if I could use the existing Tenant Media record on my temporary record instead of importing the file each time and creating new Tenant Media record. Tenant Media record holds a file name, there is no problem to find that. If I could find the corresponding Tenant Media Set record, I could copy the "Media ID" (type Media) to the temporary record field. However, I don't find a way to get the correct Tenant Media Set record.
Two questions...
1) how to find an existing Tenant Media Set record using the file name?
2) how could I clean the Tenant Media records? Do I need to delete the records myself, is the field "Expiration Date" that does it for me or some other way?
Viljar
                I notice that each time when creating the temporary records, the Tenant Media records are created. I guess, that will consume a lot of space in database. In cloud version the media records are not included to the database size but in OnPrem they are.
I wonder if I could use the existing Tenant Media record on my temporary record instead of importing the file each time and creating new Tenant Media record. Tenant Media record holds a file name, there is no problem to find that. If I could find the corresponding Tenant Media Set record, I could copy the "Media ID" (type Media) to the temporary record field. However, I don't find a way to get the correct Tenant Media Set record.
Two questions...
1) how to find an existing Tenant Media Set record using the file name?
2) how could I clean the Tenant Media records? Do I need to delete the records myself, is the field "Expiration Date" that does it for me or some other way?
Viljar
0                
            Answers
- 
            thank you Juhl for this answer. For picture gallery the blob is not a good option... Then I should use a card page instead of list in order to get the picture shown in a good size. I think I found a solution by using the Expiration Date for Tenant Media records (setting the Expiration Date after file import) and deleting them with a job queue later.0
 
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
 - 323 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