ModuleDependencyInfo Data Type – Business Central

Hey Friends,

Very small but useful, I was in one of the development process where in I had to get the dependent modules of my application as a part of some validation process and guess what we altogether have a new data type introduced for this.

This Data type comes up with the required 3 Methods – ID, Name and Publisher.

ModuleDependencyInfo.ID –> App ID

ModuleDependencyInfo.Name –> Name

ModuleDependencyInfo.Publisher –> Publisher

Just Declare this and you have all the information of the dependent Module.

Cheers

Get Hash Value – PowerShell

Hey Friends,

In one of my development in BC I was supposed to get the Hash value of all the file types. Here is the quick to get it out and use into your Application.

$signature = Get-FileHash -Path “Complete path” -Algorithm SHA256
$signatureBytes = [byte[]] -split ($signature.Hash -replace ‘..’, ‘0x$& ‘);
$signatureBase64 = [System.Convert]::ToBase64String($signatureBytes);
$signatureBase64

Algorithm value you can change as per need.

CHEERS

List Data Type – Business Central

Friends,

List Data Type is another cool data type introduced in Business central which can be used to add n number of values into it. Someone who has worked with Dot Net can correlate this List Data type as well Dictionary data type which we discussed in the last Blog.

Now when to use this List – simple answer to this is it can actually replace arrays which we often use in the previous versions of NAV.

Look at thee below code Snippert.

CHEERS

Dictionary Data Type – Business Central

Hey Readers,

It has always been a recurring process where in Microsoft keeps on launching some new Data Types and we as part of Business central family keeps on thinking like what’s the use if we are all able to accomplish everything and moreover if we already have had something for it. 🙂

The only answer to the above question is the performance. Keeping performance in mind MS keeps on brining something new so that our end customers are all happy with the amount of time system is taking to execute the operations.

Dictionary Data Type is one of the data type added which is all set to replace the temp table concept which has always been in use in our day to day developments. The only limitation is it’s not going to hold the records.

Have a look in the below Code and how Item Description is assigned and then further extracted.

CHEERS

Sync-App – Table can not be Located!!

Hey Friend’s

A very Happy New year 2022 to all of you!! Hope this year brings lots of Happiness into your life!!

New Year comes up with new Issues and here’s my Inception 🙂

While installing one of my third party Extension and which has nothing to do with the current database schema ended up with an error – Table cannot be located. Although I was all familiar with these errors but again as a third party this error owes no sense to me. After giving an ample amount of time I figure out that something was sitting there on SQL Side which was not letting this APP file to successfully sync in .

Something Garbage was sitting into the Object Metadata Snapshot Table. Investigate this table very wisely and delete the garbage entry and then you APP is all ready to get successfully Sync.

CHEERS!!

By RockwithNAV Posted in AL

Reverse Transaction(UNDO) – Accounting

Hey Readers,

We all are well equipped with the Accounting Reversals and how we are suppose to complete the reverse transaction if we know it has some discrepancies.

Over years I have seen people doing reverse transaction’s the same way as they have been doing over the years like for eg if they have to reverse General Ledger entry transaction then they will navigate to General Ledger Entry and will execute the reversal. Since then I personally have been using G/L Register for the reversal not the individual General Ledger Entry, reason being is I can see the consolidated entries along with the other Source Codes involved in the transaction. Though I was using this but I never recommended this because of limitation of the fact like it wont be doing any reversal if any transaction have sub ledgers involved, sub ledgers mean Vendor Ledger, Customer Ledger, Employee Ledger and so on. So people normally get exasperated when they some error which usually not get.

Now after the launch of Business central I can see Microsoft has introduced a very nice feature where in they have completely eliminated the chance’s of confusion. Now under the G/L Register interface if for any specific reason reversal cannot be done then altogether the button will be sitting in disabled mode. So that means end users will have a very understanding like if the button is disabled then reversal cannot be done and if enabled then you can execute the process without any glitch.

As you can see I am checking it for 35300 specific entry and for this transaction it’s disabled means reversal cannot be done and reason being we must be having sub ledgers. If this is enabled means you can do reversal without an issue.

CHEERS

Send Email – Dynamic Contents

Hey Friends,

One of my Customer requested me to have a feature wherein they can have the liberty to modify content of the email, add remove columns and do stuff like this. They wish to have long text as a free text along with certain database table information which they can attach detach as per there wish along with some html formatting possibly.

Providing such solutions always comes up with a question like how ease you have given to them to execute these features and the functionality.

Personally I had never used word document as part of Report making but here it came as a rescue. 🙂

Everybody is familiar with MS Word and doing any operation on it will be as simple as doing day to day activities.

So here it start’s, I made a very simple Report with word layout. Add all the necessary columns which can be useful to them or can be even used in future. For now I am just adding 2 Columns with necessary properties.

so once you compile the solution you will check system will make one file named My Layoyt.docx. Now open it externally and it will come up in a word document. Here in you have full fledged liberty to add whatsoever you wish including something in html formatting along with all the table level information that came across as a part of dataset(I hope you have basic knowledge how make Word Document Reports). Normally I always go for RDLC layout but if something like this sort requirement comes up then word layout reschedules the priority.

Now you simply need to import the word document layout from the Custom Report Layout selection interface and your job is done. Now whenever you need to change the design of a Report simply extract this word document complete your changes and you are done, that all context will be displayed on the email body you wished.

CHEERS

By RockwithNAV Posted in AL

Extension Installation – With Condition

Hey Readers,

I just ended up into a situation where in there was a prerequisite like once the Extension is installed it should execute a process by itself to make this extension functional on the Production Environment.

For example let’s take one very simple example where in say once we install an extension we want the Address of all the Customer’s to be modified to a certain value and this should happen the moment the extension is installed. We don’t have that bucket of anything to be executed post extension installation. So how to accomplish this.

We need to make a very simple brand new Codeunit for this and introduce one property which says – Subtype. We need to make Subtype = Install. We have couple of more options but for now lets focus on Subtype as Install. Once you enable this property system will provide you with couple of triggers to handle what you really wish to perform when the Extension is installed.

So once you install this Extension and the Extension is installed you will see all the customer Address modified to – My Test Address.

CHEERS

By RockwithNAV Posted in AL Tagged

Extension Compilation failed – Business Central

Hey Friends,

I just faced an error where in my solution was getting successfully compiled but at them time of publishing I was getting this error message where in system says –

Method:POST; Url:http://localhost:7049/BC180/dev/apps?tenant=default&SchemaUpdateMode=forcesync&DependencyPublishingOption=default; StatusCode:422; ReasonPhrase:Unprocessable Entity;

This is bit annoying because solution is getting compiled but system is unable to publish due to some error which is not clearly explanatory. A bit of struggle but then I saw there was actually a DLL file MSXML which was the trouble, though this comes in with the assembly package but I was bound it download it manually and put it in the ./Service/addin folder.

Put this path in the “al.assemblyProbingPaths”, as every dll path needs to be mentioned in here and then restart the Service. Package Successfully Published. 🙂

CHEERS

By RockwithNAV Posted in AL

Business Central – Download Symbol Struggles

Hey Friends,

I hope and pray all of you are doing great with the grace of God. I am writing after a long time and the reason being I was Covid+ for last a month and finally now recovered, thanks to almighty.

This is the first post am writing on Business central and that’s why I wish to dedicate it to the the very first step where in I saw people experiencing difficulties downloading symbols, which actually makes the al package in VS Code.

So after you downloaded the VS Code here’s the very first step that needs to be done to start writing the very first AL Program

Download the AL extension from the Marketplace.

This will make the al package in your Solution. Next step is to go Command Palette(ctrl + shift + p) and open Al: Go! , this will make a new solution folder for your project, complete the process with the authentication.

Check your launch JSON file and enter the correct information for your Server, Server Instance, Authentication and Environment type. These are very crucial information so make sure everything is correct.

Now the next step is to go with the Download symbols, so navigate back to Command Palette and search for Download Symbols and execute it. It takes just moment to get this downloaded but when it starts giving error it can take hours for you :).

I will list out some major check points for this so that it went smooth –

  1. launch JSON should have all the valid information’s.
  2. check the port in launch JSON if its not the default one.
  3. Account has all the major permissions needed.
  4. Developer service endpoint is enabled on Service tier.

CHEERS