Category Archives: AL Code

How to upload File from URL using Extension in Business Central

Today we will see how we can upload picture from live URL on item card with extension.

For the above process created extension by extending item card.

Lets see how extension work to upload the picture from URL.

  1. Create new AL file with required name and by using page extension snippet extend Item card Page as below

2. Create a function to upload the file 

In the above function used HttpClient and HttpResponseMessage method to upload the file from URL.

3. Call this function on action on item card 

While passing parameter in function passed directly the URL from where I need to upload the picture on item card.

4. Compile and publish the extension and check the result.

5. Once you click on Upload file it will automatically upload the picture from URL on Item card.

This way you can upload the picture from URL rather than downloading on local drive and upload.

Isn’t it cool..

How Do I Upgrade to Business Central (on-premise)

Here are steps to upgrade to Business central .This is old way that is merging the objects into standard objects . Anyway not recommended to do this and it is better to create extension and publish it

Listed here some of the steps to upgrade business central from NAV 2018

  1. Merge all customization of old database to business central on-premises. Merging can be done using PowerShell(recommended) or manually (not recommend)
  2. Rectify all the errors and keep the object ready for upgrade.
  3. Take full SQL backup of old database.
  4. Install the Business Central from DVD.
  5. Uninstall allthe existing extensions from old database.
  6. Upload business central partner license into the old database.
  7. Delete all object except tables from old database.
  8. Clear all server instance and debugger breakpoints records from the old database.
  9. Make sure user with whom upgrade is carried out should have privileges of DB_Owner in Sql.
  10. Open business central development environment as an Administrator.
  11. Open the old database in Business central, which will ask for convert.
  12. Skip the schema synchronization at this point of upgrade.
  13. Import the upgraded objects on converted database in business central with selection of Replace All.
  14. Skip the schema synchronization at this point of upgrade.
  15. Import appropriate upgrade code unit from product DVD.
  16. Connect new database to appropriate NAV service.
  17. Increase SQL command time out to maximum number.
  18. Compile all objects with schema synchronization.
  19. Execute data upgrade process and import permission set.
  20. Make pages searchable by using ‘Build object search Index’ option from developer environment.
  21. Remove all unwanted objects
  22. Get Ready to face customer queries from new database 


NAV Tech Days Recorded Session

NAV TechDays is the name of a conference, organized by mibuso.com. This conference meant  technical only and highly relevant – sessions, related NAV and Business Central.

NAV TechDays is the place where some of the best developers and MVP’s exchange ideas and provides more insight of NAV world (oops Business Central)

Few of the session which I think more useful for everybody which listed here on my blog and you can visit them

Practical approaches for upgrading your NAV database and moving to extensions

The future for developers and consultants

Performance: Business Central reloaded for the Cloud

What’s new in Developing for Business Central

Evolution of a titan: a look at the development of NAV from an MVP angle

Business Central: The new face of the client

Crazy mix of integrations: Dynamics 365 Business Central and Azure services

Hope you guys will find it useful 

Cumulative Update 01 for Microsoft Dynamics 365 Business Central on-premises

15

Cumulative Update 01 for Microsoft Dynamics 365 business central on-premises released

Download from following link

Microsoft 365 Business Central :- Business Central CU01

This cumulative update includes all hotfixes and regulatory features that have been released for Microsoft Dynamics 365 Business Central, including hotfixes and regulatory features that were released in previous cumulative updates.

This cumulative update replaces previously released cumulative updates. You should always install the latest cumulative update.

 

 

 

How to handle CodeUnit 1 Logic in Business Central upgrade

15

As you all are aware that Codeunit 1 (Application Management) has been removed and it is replace with new system codeunits. By moving this there is no functionality changes but this process will affect upgrade process for NAV.

All these functions has been changed  to different event including publishers and subscribers that means instead of calling Codeunit 1 functions business central will use system codeunits.

Following tables will illustrate mapping between codeunit 1 triggers and event publishers.

Codeunit 1 trigger
New Codeunit ID
New method
CompanyClose
LogInManagement
CompanyClose
CompanyOpen
LogInManagement
CompanyOpen
GetSystemIndicator
LogInManagement
GetSystemIndicator
OnAfterCompanyClose
LogInManagement
OnAfterCompanyClose
OnAfterCompanyOpen
LogInManagement
OnAfterCompanyOpen
OnBeforeCompanyClose
LogInManagement
OnBeforeCompanyClose
OnBeforeCompanyOpen
LogInManagement
OnBeforeCompanyOpen
FindPrinter
ReportManagement
GetPrinterName
ApplicationVersion
Application System Constants
ApplicationVersion
CustomApplicationVersion
N/A
N/A
ReleaseVersion
Application System Constants
ReleaseVersion
ApplicationBuild
Application System Constants
ApplicationBuild
CustomApplicationBuild
N/A
N/A
ApplicationLanguage
LanguageManagement
ApplicationLanguage
DefaultRoleCenter
Conf./Personalization Mgt.
DefaultRoleCenterID
MakeDateTimeText
TextManagement
MakeDateTimeText
GetSeparateDateTime
TextManagement
GetSeparateDateTime
MakeDateText
TextManagement
MakeDateText
MakeTimeText
TextManagement
MakeTimeText
MakeText
TextManagement
MakeText
MakeDateTimeFilter
TextManagement
MakeDateTimeFilter
MakeDateFilter
TextManagement
MakeDateFilter
MakeTextFilter
TextManagement
MakeTextFilter
MakeCodeFilter
TextManagement
MakeTextFilter
MakeTimeFilter
TextManagement
MakeTimeFilter
AutoFormatTranslate
AutoFormatManagement
AutoFormatTranslate
ReadRounding
AutoFormatManagement
ReadRounding
CaptionClassTranslate
CaptionManagement
CaptionClassTranslate
GetCueStyle
Cue Setup
GetCueStyle
SetGlobalLanguage
LanguageManagement
SetGlobalLanguage
ValidateApplicationlLanguage
LanguageManagement
ValidateApplicationLanguage
LookupApplicationlLanguage
LanguageManagement
LookupApplicationLanguage
GetGlobalTableTriggerMask
GlobalTriggerManagement
GetGlobalTableTriggerMask
OnGlobalInsert
GlobalTriggerManagement
OnGlobalInsert
OnGlobalModify
GlobalTriggerManagement
OnGlobalModify
OnGlobalDelete
GlobalTriggerManagement
OnGlobalDelete
OnGlobalRename
GlobalTriggerManagement
OnGlobalRename
GetDatabaseTableTriggerSetup
GlobalTriggerManagement
GetDatabaseTableTriggerSetup
OnDatabaseInsert
GlobalTriggerManagement
OnDatabaseInsert
OnDatabaseModify
GlobalTriggerManagement
OnDatabaseModify
OnDatabaseDelete
GlobalTriggerManagement
OnDatabaseDelete
OnDatabaseRename
GlobalTriggerManagement
OnDatabaseRename
OnDebuggerBreak
Debugger Management
ProcessOnDebuggerBreak
LaunchDebugger
Debugger Management
OpenDebugger
OpenSettings
Conf./Personalization Mgt.
OpenSettings
OpenContactMSSales
SaaS Log In Management
OpenContactMSSales
InvokeExtensionInstallation
ExtensionMarketplaceMgmt
InvokeExtensionInstallation
CustomizeChart
Generic Chart Mgt
CustomizeChart
HasCustomLayout
ReportManagement
HasCustomLayout
MergeDocument
ReportManagement
MergeDocument
ReportGetCustomRdlc
ReportManagement
ReportGetCustomRdlc
ReportScheduler
ReportManagement
ScheduleReport
OnBeforeOpenSettings
Conf./Personalization Mgt.
OnBeforeOpenSettings
OnAfterGetApplicationVersion
Application System Constants
OnAfterGetApplicationVersion
OnRoleCenterOpen
Conf./Personalization Mgt.
OnRoleCenterOpen
OnAfterGetSystemIndicator
Sales-Post and Send
OnAfterGetSystemIndicator
OnAfterFindPrinter
ReportManagement
OnAfterGetPrinterName
OnAfterGetDefaultRoleCenter
Conf./Personalization Mgt.
OnAfterGetDefaultRoleCenter
OnAfterMakeDateText
N/A
N/A
OnAfterMakeTimeText
N/A
N/A
OnAfterMakeText
N/A
N/A
OnAfterMakeDateTimeFilter
TextManagement
OnAfterMakeDateTimeFilter
OnAfterMakeDateFilter
TextManagement
OnAfterMakeDateFilter
OnAfterMakeTextFilter
TextManagement
OnAfterMakeTextFilter
OnAfterMakeCodeFilter
N/A
N/A
OnAfterMakeTimeFilter
TextManagement
OnAfterMakeTimeFilter
OnAfterAutoFormatTranslate
AutoFormatManagement
OnAfterAutoFormatTranslate
OnAfterCaptionClassTranslate
CaptionManagement
OnAfterCaptionClassTranslate
OnAfterGetGlobalTableTriggerMask
GlobalTriggerManagement
OnAfterGetGlobalTableTriggerMask
OnAfterOnGlobalInsert
GlobalTriggerManagement
OnAfterOnGlobalInsert
OnAfterOnGlobalModify
GlobalTriggerManagement
OnAfterOnGlobalModify
OnAfterOnGlobalDelete
GlobalTriggerManagement
OnAfterOnGlobalDelete
OnAfterOnGlobalRename
GlobalTriggerManagement
OnAfterOnGlobalRename
OnAfterGetDatabaseTableTriggerSetup
GlobalTriggerManagement
OnAfterGetDatabaseTableTriggerSetup
OnAfterOnDatabaseInsert
GlobalTriggerManagement
OnAfterOnDatabaseInsert
OnAfterOnDatabaseModify
GlobalTriggerManagement
OnAfterOnDatabaseModify
OnAfterOnDatabaseDelete
GlobalTriggerManagement
OnAfterOnDatabaseDelete
OnAfterOnDatabaseRename
GlobalTriggerManagement
OnAfterOnDatabaseRename
OnAfterHasCustomLayout
ReportManagement
OnAfterHasCustomLayout
OnAfterReportGetCustomRdlc
Edit MS Word Report Layout
OnAfterReportGetCustomRdlc
OnBeforeOnDatabaseInsert
GlobalTriggerManagement
OnBeforeOnDatabaseInsert
OnBeforeOnDatabaseModify
GlobalTriggerManagement
OnBeforeOnDatabaseModify
OnBeforeOnDatabaseDelete
GlobalTriggerManagement
OnBeforeOnDatabaseDelete
OnBeforeOnDatabaseRename
GlobalTriggerManagement
OnBeforeOnDatabaseRename
OnEditInExcel
ODataUtility
OnEditInExcel
OnInstallAppPerDatabase
N/A
N/A
OnInstallAppPerCompany
N/A
N/A
OnCheckPreconditionsPerDatabase
Data Upgrade Mgt.
OnCheckPreconditionsPerDatabase
OnCheckPreconditionsPerCompany
Data Upgrade Mgt.
RaiseOnCheckPreconditionsPerCompany
OnUpgradePerDatabase
Data Upgrade Mgt.
OnUpgradePerDatabase
OnUpgradePerCompany
Data Upgrade Mgt.
OnUpgradePerCompany
OnValidateUpgradePerDatabase
Data Upgrade Mgt.
OnValidateUpgradePerDatabase
OnValidateUpgradePerCompany
Data Upgrade Mgt.
OnValidateUpgradePerCompany

Hope this helps you

 

 

 

 

 

 

 

How to record Events in Business Central

I know you all started working with AL development and extension. As you are converting your product or customization every time need to deal with base application code as during C/AL days you already added business logic in required codeunits,tables,pages etc.

Now when you are dealing with extension you need to move your customization to AL development using events subscription. It is always painful to find events associate with every business process and need to search right event to write customization did.

In business central there is feature available to see which events are executed during process you ran and one can record this events using event recorder .These events are not stored like permission set .This will disappear once you close the page.

We will see how we can use this . For recording you need to have two browser open in which one will do recording and other will execute business process.

  1. Search for Event recorder.

SearchEventR

2. Click On Event recorder which will show as below

EventScreen

3. Click on Record Events–> Start

EventStart

Go to another browser and start executing the required process . In this example I am creating one purchase order

PurchaseOrder

Now go back first browser and click on record Events–>Stop

StopEvents

Once you click ‘Yes’ then it will display all events executed during purchase order creation.

EventRecorded

Go to the last columns i.e. Get AL Snippets where you will get AL code for the events

Snippets

This will really helpful while moving your program to AL from C/AL

Too Cool.

Stay tuned for more updates.

 

 

How to Include Permission Set in Business Central Extension

15

So everybody aware that including permission set in app development is mandatory ,By using this permission one can use designated app.

Today we will see how we can create permission set and include in your extension.

Go to Role tailored client and create new permission set.(This can done by either manually or by recording permission

I created simple permission set as below

cronusper

Once permission set is create then you need to export this to .xml file which can be used to create permission set in Business central via extension.

For exporting newly created permission set I used PowerShell command as below.

Import-Module ‘C:\Program Files (x86)\Microsoft Dynamics NAV\110\RoleTailored Client\Microsoft.Dynamics.Nav.Apps.Tools.psD1’
Export-NAVAppPermissionSet -Path C:\SourceFolder\demopermissions.xml -PermissionSetId DEMOSET -ServerInstance DynamicsNAV110 -Force -PassThru

Above command will create .xml file in designated folder.

Now copy this file and paste it in you app folder where all extensions file are stored

After copy this file publish the app and check in permission set of business central. One can see newly created permission set added.

demoset

How cool and simple is this…

Stay tuned  for more…

 

 

 

 

 

Business Central Resources and Information

15

Subscribe to following YouTube channel and find out how to create extensions, publishing app.

Click on below link

Microsoft Dynamics 365 Business Central

This channel contains videos which will guide you for business central and extension creation.

 

Stay tuned for more..

 

Business Central :Code Unit 1 Retired

 

15Though we are eagerly waiting for October 2018 Business central on-premise version and meanwhile we have news that Codeunit 1 (Application Management ) has been retired and new system events has been introduced in 2 billion range.

This has been refactor to cope up with new development environment .so  henceforth you will not find Codeunit 1 in object designer.

Whenever database is created these special codeunits will be created automatically. As well as they will not contain event instead of code.

Following functions become events

 

Codeunit 1 function name
New Object Type
New Object ID
New function name
CompanyOpen
Codeunit
40
CompanyOpen
GetSystemIndicator
Codeunit
40
GetSystemIndicator
CompanyClose
Codeunit
40
CompanyClose
FindPrinter
Codeunit
44
GetPrinterName
ApplicationVersion
Codeunit
9015
ApplicationVersion
CustomApplicationVersion
N/A
N/A
N/A
ReleaseVersion
Codeunit
9015
ReleaseVersion
ApplicationBuild
Codeunit
9015
ApplicationBuild
CustomApplicationBuild
N/A
N/A
N/A
ApplicationLanguage
Codeunit
43
ApplicationLanguage
DefaultRoleCenter
Codeunit
9170
DefaultRoleCenterID
MakeDateTimeText
Codeunit
41
MakeDateTimeText
GetSeparateDateTime
Codeunit
41
GetSeparateDateTime
MakeDateText
Codeunit
41
MakeDateText
MakeTimeText
Codeunit
41
MakeTimeText
MakeText
Codeunit
41
MakeText
MakeDateTimeFilter
Codeunit
41
MakeDateTimeFilter
MakeDateFilter
Codeunit
41
MakeDateFilter
MakeTextFilter
Codeunit
41
MakeTextFilter
MakeCodeFilter
Codeunit
41
MakeTextFilter
MakeTimeFilter
Codeunit
41
MakeTimeFilter
AutoFormatTranslate
Codeunit
45
AutoFormatTranslate
ReadRounding
Codeunit
45
ReadRounding
CaptionClassTranslate
Codeunit
42
CaptionClassTranslate
GetCueStyle
Codeunit
9701
GetCueStyle
SetGlobalLanguage
Codeunit
43
SetGlobalLanguage
ValidateApplicationlLanguage
Codeunit
43
ValidateApplicationLanguage
LookupApplicationlLanguage
Codeunit
43
LookupApplicationLanguage
GetGlobalTableTriggerMask
Codeunit
49
GetGlobalTableTriggerMask
OnGlobalInsert
Codeunit
49
OnGlobalInsert
OnGlobalModify
Codeunit
49
OnGlobalModify
OnGlobalDelete
Codeunit
49
OnGlobalDelete
OnGlobalRename
Codeunit
49
OnGlobalRename
GetDatabaseTableTriggerSetup
Codeunit
49
GetDatabaseTableTriggerSetup
OnDatabaseInsert
Codeunit
49
OnDatabaseInsert
OnDatabaseModify
Codeunit
49
OnDatabaseModify
OnDatabaseDelete
Codeunit
49
OnDatabaseDelete
OnDatabaseRename
Codeunit
49
OnDatabaseRename
OnDebuggerBreak
Codeunit
9500
ProcessOnDebuggerBreak
LaunchDebugger
Codeunit
9500
OpenDebugger
OpenSettings
Codeunit
9170
OpenSettings
OpenContactMSSales
Codeunit
50
OpenContactMSSales
InvokeExtensionInstallation
Codeunit
2501
InvokeExtensionInstallation
CustomizeChart
Codeunit
9180
CustomizeChart
HasCustomLayout
Codeunit
44
HasCustomLayout
MergeDocument
Codeunit
44
MergeDocument
ReportGetCustomRdlc
Codeunit
44
ReportGetCustomRdlc
ReportScheduler
Codeunit
44
ScheduleReport
OnBeforeOpenSettings
Codeunit
9170
OnBeforeOpenSettings
OnAfterGetApplicationVersion
Codeunit
9015
OnAfterGetApplicationVersion
OnBeforeCompanyOpen
Codeunit
40
OnBeforeCompanyOpen
OnAfterCompanyOpen
Codeunit
40
OnAfterCompanyOpen
OnRoleCenterOpen
Codeunit
9170
OnRoleCenterOpen
OnBeforeCompanyClose
Codeunit
40
OnBeforeCompanyClose
OnAfterCompanyClose
Codeunit
40
OnAfterCompanyClose
OnAfterGetSystemIndicator
Table
79
OnAfterGetSystemIndicator
OnAfterFindPrinter
Codeunit
44
OnAfterGetPrinterName
OnAfterGetDefaultRoleCenter
Codeunit
9170
OnAfterGetDefaultRoleCenter
OnAfterMakeDateText
N/A
N/A
N/A
OnAfterMakeTimeText
N/A
N/A
N/A
OnAfterMakeText
N/A
N/A
N/A
OnAfterMakeDateTimeFilter
Codeunit
41
OnAfterMakeDateTimeFilter
OnAfterMakeDateFilter
Codeunit
41
OnAfterMakeDateFilter
OnAfterMakeTextFilter
Codeunit
41
OnAfterMakeTextFilter
OnAfterMakeCodeFilter
N/A
N/A
N/A
OnAfterMakeTimeFilter
Codeunit
41
OnAfterMakeTimeFilter
OnAfterAutoFormatTranslate
Codeunit
45
OnAfterAutoFormatTranslate
OnAfterCaptionClassTranslate
Codeunit
42
OnAfterCaptionClassTranslate
OnAfterGetGlobalTableTriggerMask
Codeunit
49
OnAfterGetGlobalTableTriggerMask
OnAfterOnGlobalInsert
Codeunit
49
OnAfterOnGlobalInsert
OnAfterOnGlobalModify
Codeunit
49
OnAfterOnGlobalModify
OnAfterOnGlobalDelete
Codeunit
49
OnAfterOnGlobalDelete
OnAfterOnGlobalRename
Codeunit
49
OnAfterOnGlobalRename
OnAfterGetDatabaseTableTriggerSetup
Codeunit
49
OnAfterGetDatabaseTableTriggerSetup
OnAfterOnDatabaseInsert
Codeunit
49
OnAfterOnDatabaseInsert
OnAfterOnDatabaseModify
Codeunit
49
OnAfterOnDatabaseModify
OnAfterOnDatabaseDelete
Codeunit
49
OnAfterOnDatabaseDelete
OnAfterOnDatabaseRename
Codeunit
49
OnAfterOnDatabaseRename
OnAfterHasCustomLayout
Codeunit
44
OnAfterHasCustomLayout
OnAfterReportGetCustomRdlc
Table
9650
OnAfterReportGetCustomRdlc
OnBeforeOnDatabaseInsert
Codeunit
49
OnBeforeOnDatabaseInsert
OnBeforeOnDatabaseModify
Codeunit
49
OnBeforeOnDatabaseModify
OnBeforeOnDatabaseDelete
Codeunit
49
OnBeforeOnDatabaseDelete
OnBeforeOnDatabaseRename
Codeunit
49
OnBeforeOnDatabaseRename
OnEditInExcel
Codeunit
6710
OnEditInExcel
OnInstallAppPerDatabase
N/A
N/A
N/A
OnInstallAppPerCompany
N/A
N/A
N/A
OnCheckPreconditionsPerDatabase
Codeunit
9900
OnCheckPreconditionsPerDatabase
OnCheckPreconditionsPerCompany
Codeunit
9900
RaiseOnCheckPreconditionsPerCompany
OnUpgradePerDatabase
Codeunit
9900
OnUpgradePerDatabase
OnUpgradePerCompany
Codeunit
9900
OnUpgradePerCompany
OnValidateUpgradePerDatabase
Codeunit
9900
OnValidateUpgradePerDatabase
OnValidateUpgradePerCompany
Codeunit
9900
OnValidateUpgradePerCompany

Stay Tuned for more….

 

What’s New in Business Central October 18 release

15

Everybody is aware that Business central was live in month of April 2018 and now Microsoft is geared up for October 2018 release which will available in cloud, on-premises and in hybrid deployments. This version will come up with new and rich features which will make business users to interact more efficiently with product and get rid of day to day processes.

Roadmap for business central

roadmap

New features in business central

Refreshed desktop experience :- With a fresh new look it is easier to use business central .It is focused on layout of data, better data visibility ,new look and feel refreshpage

Improved productivity on lists :- Available the features like show/hide more columns, freeze pane, limit totals, row based copy paste. All the lists in the product feature now a new, refreshed layout with more flexible grid customization,
tile view available everywhere and with quick access to search and view. This allows users to get better and faster access to the data whenever it is needed.

 list

List Lookup Improved Search :- Get your data faster with improved search for pages,reports . The Search field replaces the Search for Page or Report field. You can use it to find objects such as pages and reports, but also to find actions and product documentation.

search

Advance Filtering :-The powerful filtering capabilities in Business Central accelerate list-related tasks by providing absolute control over filtering in a modern and intuitive experience.

search1

The filter pane allows you to:
• Get an overview of the currently applied filters, and see if they were set by you, by a filtered view, or by the application itself.
• Add as many filtered columns as you like by typing to quickly search for more fields on the source table.
• Get assistance with specifying filter values using lookups or the field’s data type.
• Create complex filters using operators, ranges, variables, and shorthand.
• Filter to the current cell value in the list.

Limit Totals:- Most popular and useful features of NAV makes entry in Business central

Copy and Paste :-This enables you to
• Copy one or more rows in a list and paste them to the same (or similar) list.
• Copy one or more rows and paste them into Microsoft Excel, including the column captions.
Not using Excel? Most applications such as Microsoft Outlook allow pasting tabular content
where the column captions will be displayed.
• Copy one or more rows from Excel and paste them into  Business Central.

Enhanced Power BI embed experience :- Enhancements to the current Power BI embed experience include an automatic deployment of Power BI reports, default report selection, and the ability to manage their Power BI reports without ever requiring them to leave Business Central.

Permission sets are editable :- End users can customize the permission sets and give them a structure that meets the specific needs of their business.

Intelligent edge :-Connect your on-premises Dynamics SMB solution to the intelligent cloud through Dynamics 365 Business Central, and get access to Power BI, Microsoft Flow, PowerApps, machine learning, and others.

edge

and many more new features has been added in this release such as enhancement in AL development which will share in next blog.

Stay tuned for more updates…

 

Source :- Business release notes

 

 

 

 

 

« Older Entries