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

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Small and medium business | Business Central, N...
Suggested Answer

How to Create .app package [Business central extension package] as 30 day Trail for Microsoft AppSource

(1) ShareShare
ReportReport
Posted on by 256

Hi All,

how to restrict the user to access the business central app after the free trial is over. can we write the code in AL?. Also, how can we check the extension package is installed by Customer and Date so that the trial period is activated from the date of installation.

Thanks in Advance.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    You need to handle the expiration by yourself. A possible solution is to save into the Isolated Storage the installation date or other things you need. This can be done in the OnInstallAppPerDatabase trigger of an Install codeunit.

  • NeoMatrix Profile Picture
    256 on at

    Thanks for the reply.  Do you have any sample code for this which store license key and installation date?

  • Suggested answer
    Mohsin Abbas Profile Picture
    525 on at

    Hi

    Yes, this can be done in AL. One possible solution is that if you have any setup table in your extension, add a field to indicate the start date in it. This date can be populated in OnInstall codeunit. Then you can use "Handled" design pattern to check that date before executing each functionality.

    Please let me know if you need any further clarification.

    Thanks.

  • Suggested answer
    Stefano Demiliani Profile Picture
    37,172 Most Valuable Professional on at

    In the Install codeunit, simply use:

    IsolatedStorage.Set(‘InstallDate’,TODAY,Datascope::Module)

    and then read this data where you want in your app with:

    IsolatedStorage.Get(‘InstallDate’,Datascope::Module,YourVariable)

    Never store sensitive data on tables because these can be changed by other extensions.

    More info here:

    demiliani.com/.../

    docs.microsoft.com/.../devenv-isolated-storage

  • NeoMatrix Profile Picture
    256 on at

    Thanks for Reply @Mohsin Abbas. I have doubts. If I insert the package installation date on the master table and there may be a chance the someone can change using SQL DB Query. or If the User changes the System date as backdate then how Can handle the this situation using Programiticaly. 

     

  • Suggested answer
    Mohsin Abbas Profile Picture
    525 on at

    1- In BC online, users can not access/modify the database directly.

    2- It's not practical for users to change the system date. If they do this they'll be risking all their transactional data because it'll all be in the back date.

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

Quick Links

Season of Sharing Community Challenge Winners!

Congratulations to our community stars!

Women in Power Builds Momentum

Expanding mentorship, skilling, and AI innovation

Leaderboard > Small and medium business | Business Central, NAV, RMS

#1
OussamaSabbouh Profile Picture

OussamaSabbouh 645 Super User 2026 Season 2

#2
YUN ZHU Profile Picture

YUN ZHU 432 Super User 2026 Season 2

#3
Teagen Boll Profile Picture

Teagen Boll 248 Super User 2026 Season 2

Last 30 days Overall leaderboard

Featured topics

Microsoft Training Manuals

Product updates

Dynamics 365 release plans