Monday, September 28, 2020

File Upload to Sharepoint from Business Central SAAS using REST API

Hello Readers, 


Few days back, I was struggling to upload the file into Sharepoint folder using Business Central SAAS version, then I came up with the solution using REST API.

The solution is easily achievable using few lines of code and configuration.

 

Lets have a look how this works:

 

Pre-Requisite  required: 

1. Sharepoint site - with Admin Credentials

2. Business Central Access.

 

#A - Configuration of Sharepoint site  

1. Sharepoint site with the read-write permission.

 


2. Register an app using the below commands and trust your share point site.

1. https://YourSharepointDomain.sharepoint.com/sites/BusinessCentral/_layouts/15/appregnew.aspx

Generate the Client Id and Client Secret, save all the information to be used in the later stage.

once all the required information is filled up, click on Create button.


2. Now, next step is to Trust the app with your sharepoint site (refer the below images). 

Enter the below url:

https://YourSharepointDomain.sharepoint.com/sites/BusinessCentral/_layouts/15/appinv.aspx

into the app id - put the Client ID  which you have generated in the last step.

Permission request xml:

<AppPermissionRequests AllowAppOnlyPolicy="true">  
  <AppPermissionRequest Scope="http://sharepoint/content/sitecollection/web/list"
   Right="FullControl" />
</AppPermissionRequests>

 

 

Once the above setup is done, click on Create button and it will redirect to Trust windows, click on Trust It.

 

This completes the sharepoint configuration part, in the next blog we will see how to use the above into the business central and upload the file into the sharepoint.

 

Thank you,

Anish Agrawal

NAV/Business Central Developer

Connect me on : +91-9770757595

Linkedin :Anish Agrawal

Tuesday, August 18, 2020

Multi-Language Translation in Business Central using xlf File

Hello Readers, 

 

Few days back I was doing a upgrade project into Business Central, and there was a requirement for Multi-language translation.

So in this blog we will see how we can deal with the Chinese translation (zh-CN chinese PRC) from the English US without adding the Caption ML property.

Below are the steps that needs to be perform for the translation in business central.

 

1. Open you AL Project and in the app.json file add the below syntax to generate the XLIFF file (by default system will generate in en-US).

"features": ["TranslationFile","GenerateCaptions"] ,


2. Save the app.json file after addting the Features, & Create the Package by pressing Crtl+Shift+B.

Once the Package is created, system will  generate the Translation folder with the xlf file & right click and reveal it in file explorer.

 

 

 

3. Now Copy the translated file and change the name by adding suffix language ISO Code (see the below example for Chinese PRC ISO Code zh-CN).

Change the name like below:

 

4. Open the above file in notepad and change the target language to the language code you want to translate in (in my case zh-CN).

See the example below.

change as below:

 

5.Now download the Multilingual App Toolkit from the below link and install it.

https://developer.microsoft.com/en-us/windows/downloads/multilingual-app-toolkit/ 

6. Now open the XLF file (which we created in step 3) with the Multilingual Editor and click on the highlighted Translate All Button (While doing the below make sure you're connected to internet)

 

 

Once the above Translation is done change the sate to Translated and save file & close the Editor window.  

Now open the file in visual studio and check the translation.

7. Now Publish the AL Package and install it along with the translation file. 

 

Hope this blog will be usefull for all BC/NAV developer to submit the extension as an APP on AppSource as well as to deliver the solution into multi-language.

  

You can comment on the blog if you have any doubts/queries regarding the Translation process/ multilingual toolkit app.


Thank you,

Anish Agrawal

NAV/Business Central Developer

Connect me on : +91-9770757595

Linkedin :Anish Agrawal

Busines Central Developer

Mastering Financial Harmony: Bank Reconciliation with Copilot in Business Central

   Hello Readers, welcome to my blog! Fasten your virtual seatbelts and prepare to delve into the realm where code meets creativity. The fut...

Report Substituting