web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

Community site session details

Community site session details

Session Id :
Business Central forum

How To replace file record in AL extensions ?

(0) ShareShare
ReportReport
Posted on by 60

Hi everyone,

I'm discovering the AL extensions recently and I came across a problem when converting CAL to AL.
The problem is that I cant use File rec anymore so how can I replace it? this is an exemple of an obsolete code in the AL code :

procedure CheckPathExist(PathToCheck_P: Text[1024]): Boolean
var
File_L: Record File; (The type or method 'File' cannot be used for 'Extension' development)
begin
File_L.RESET;
File_L.SETFILTER(Path, PathToCheck_P);
File_L.SETRANGE("Is a file", FALSE);
IF File_L.ISEMPTY THEN
EXIT(FALSE)
ELSE
EXIT(TRUE);

end;

Thanks in advance! :)

Categories:
I have the same question (0)
  • Suggested answer
    Community Member Profile Picture
    on at

    Hi,

    File APIs are not available in Extensions V2. What to do?

    Code that relied on temporary files needs to be rewritten to rely on InStream and OutStream types. Code that relied on permanent files needs to be rewritten to use another form of permanent storage.

    We are considering a virtualized temporary file system to make working with temporary files available in the cloud in the future.

    Please have look in this FAQ for more details

    github.com/.../Frequently-Asked-Questions

  • Suggested answer
    amirsa Profile Picture
    20 on at
    {
      "id": "15a08342-5814-49e6-93ef-93905db8fb9b",
      "version": "18.0.0.1",
      "brief": "",
      "description":
      "EULA": "",
      "help": "",
      "url": "",
      "logo": "
      "screenshots": [], 
     
      "target": "OnPrem",
      "showMyCode": true,
      "runtime": "7.0"
    }

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

News and Announcements

Season of Giving Solutions is Here!

Quick Links

November Spotlight Star - Khushbu Rajvi

Congratulations to a top community star!

Forum Structure Changes Coming on 11/8!

In our never-ending quest to help the Dynamics 365 Community members get answers faster …

Dynamics 365 Community Platform update – Oct 28

Welcome to the next edition of the Community Platform Update. This is a status …

Leaderboard > Business Central

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans