Soap Service – Special Charecters

 

Hey Folks,

We all know SOAP Services has it’s own Protocol while commuting over different Platforms. Sometimes Client is willing to send special characters for there own reasons over web service but it is not permitted within SOAP protocols.

Here is the way how you can make this accessible with a tweak, while calling service replace this special characters with:

< is converted to &lt;

> is converted to &gt;

& is converted to &amp;

is converted to &quot;

Now at the other end you just need to decode it to get back the original special character that you have. Here is the code you need to write-

//RWN
Bigtext.ADDTEXT(DecodeSpecialCharacter.HtmlDecode(InputBigtext));
//RWN

Here Bigtext will have decoded value coming in InputBigtext.

DecodeSpecialCharacter    DotNet     System.Net.WebUtility.’System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

CHEERS

 

Advertisements

Debit Credit Concept – Accounting

 

Hey Friends,

I know there’s always been a confusion to understand this Accounting concept like which account gets Credited and exactly which will get Debited as there’s no generic sign for Debit and Credit. Sometimes Debit means Positive (+) and sometimes it means Negative (-) and the same goes vice versa for Credit. So I just made this small structure which will help you understand when Debit means positive and for which Account Type and the same for Credit.

 

 

 

 

 

 

Here Account Type means either its a Balance Sheet or Income Statement. Debit (+) means this Account will get Debited with a + value and Credit will be in -. The same way this will get Credited + means this Account will be Credited with a  + value and Debit will be in -.

I wrote DEALER on the top because it will make easier for you to remember the Accounts. First three DEA means Draw, Expense and Asset and last 3 LER means Liability, Equity and Revenue.

CHEERS

Disable Sorting – List Page

 

Hey Friends,

Recently I got a requirement where client asked me to disable Sorting. They don’t want any user to rearrange the data based on any field.  Here is just what needs to be done.

Open list page and navigate to Repeater Property –  Here you will find IndentationColumnName property. Just change it to 0 and we are done.

There are many properties in multiples places across NAV which we don’t bother to experience but it can literally make our life easier.

CHEERS

Cross Reference No – Item

 

Hey Friends,

There’s many features in standard NAV which we normally don’t use, not because we don’t want to but just because we are not aware. Item Cross Reference is one of the out of the box feature which I belief is rarely used by the end users but it’s really an awesome one for them to use in there day to day data entry process. The basic benefit of this is you don’t have to look for Item No every time, just your unique reference and it will automatically bring the respective item, Variant and so on.

So here’s what you need to do – Open Item List

Here as highlighted in screenshot you need to open Cross Reference and do the respective setup’s. This you need to do for each and every Item. So here we are doing for Item I000009.

Here you need to put the Customer No for the Customer’s you want to do along with the Variant and Unit of Measure Codes. Cross Ref No will be the key to identify this.

Now you need to navigate to Sales Order and you are supposed to make the new one.

Now as you see the screenshot we took the same customer for which we did the setup, Now we need to navigate to Line Items and push the drop down for Cross Reference No. Generally Cross Reference No is not visible so you need to choose it from Choose Columns. So once you hit the Drop Down you will have the list of Cross Reference’s that you did the setup for. Now you just have to hit OK and you will have your line item ready.

So by this you don’t have to look for your Item No every time. Just one setup as per your convenience and you are good to go.

CHEERS

File Upload – SFTP

 

Hey Friends,

This post I dedicated in how to upload a file on SFTP from NAV. This normally happens when we are doing some sort of processing from a file which has to be processed needs to be downloaded from a SFTP and then eventually needs to be processed. SFTP is Secured File Transfer Protocol so it’s  a level more secured then FTP.

Below is the screenshot of the code that needs to be written.

This code is to move File to respective SFTP.

WinSCP is free DLL that you can find over internet and its very effective.

CHEERS

File Upload – FTP

 

Hey Friends,

This post I dedicated in how to upload a file on FTP from NAV. This normally happens when we are doing some sort of processing from a file which has to be processed needs to be downloaded from a FTP and then eventually needs to be processed.

Below is the screenshot of the code that needs to be written.

This one is a very simple example, you can manipulate this as per your need. In the very next post I will come up on dealing with SFTP. This one will work only for FTP.

//RWN
ConnectionString := ‘ftp://your.ftp.address’;

SourceText := ‘Something that you want to write in the file’;

FTPRequest := FTPRequest.Create(ConnectionString);

FTPRequest.KeepAlive := TRUE;
FTPRequest.UseBinary := TRUE;
FTPRequest.Method := ‘STOR’;

FTPRequest.Credentials := NetworkCredential.NetworkCredential(‘UserID’,’Password’);

UTF8Encoding := UTF8Encoding.UTF8Encoding;

FTPRequest.ContentLength := UTF8Encoding.GetBytes(SourceText).Length;
RequestStream := FTPRequest.GetRequestStream;
RequestStream.Write(UTF8Encoding.GetBytes(SourceText),0,FTPRequest.ContentLength);
RequestStream.Close;

FTPResponse := FTPRequest.GetResponse;
MESSAGE(FTPResponse.StatusDescription);
//RWN

Variables

FTPRequest  DotNet System.Net.FtpWebRequest.’System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ FTPRequest DotNet System.Net.FtpWebRequest.’System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

FTPResponse DotNet System.Net.FtpWebResponse.’System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

NetworkCredential DotNet System.Net.NetworkCredential.’System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′ WebRequestMethods DotNet System.Net.WebRequestMethods.’System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

UTF8Encoding DotNet System.Text.UTF8Encoding.’mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

RequestStream DotNet System.IO.Stream.’mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

ConnectionString Text

SourceText Text

CHEERS

 

 

Extended Text – Item Card

 

Hey Friends,

This page is all about How to Use Extended Text – Extended Text is a base functionality of Dynamics NAV where you can add some custom description for any of the Item which you want to Sell, Purchase etc..

So to use this you simply need to navigate to Item Card and open any of the Item, then and there on the Action Tab you will find a button Extended Text, you need to push this and a new page will open as shown in the below screenshot –

Highlighted part is the area where you need to fill in the text which you want to populate. Below is the Sales, Purchase and Service fast tab where you need to check the Flag where you exactly want this and disable the flags where you don’t.

Now try making a New Sales Order with the same Item for which you did the Setup –

Now as soon as you validate the Item, the Extended Text will automatically get populated as shown in the above screenshot. In the Item card you fill find a Flag Automatic Ext. Text. If this Flag is on then the text will automatically come otherwise you need to manually fill in by navigating to Function -> Insert Ext. Text.

CHEERS

File to Byte Conversion – Client to Server Move

Hey Friends,

This is a very simple post on how to move a file from your client computer to server computer. We all are well equipped and experienced in moving a file directly from a physical path, if we simply need to just copy that file as we all have expertise in using File Management Codeunit.  I just experienced a case where client was scanning the file from NAV and then and there he requested that the scanned file can anyhow directly move into server computer without any physical storage in the current client machine.

As the scanning form was a part of .NET dll so to achieve this and after scanning I sent that scanned file as a parameter in Big-text format to NAV Web Service. Here the actual work comes into play. Look at the below piece of code

//RWN
Byte:=Convert.FromBase64String(FileInBigText); FileInBigText includes scanned file
MemoryStream:=MemoryStream.MemoryStream(Byte);
TempBlob.DELETEALL;
TempBlob.INIT;
TempBlob.Blob.CREATEOUTSTREAM(OutStream);
MemoryStream.WriteTo(OutStream);
TempBlob.INSERT;

File.CREATE(FilePath); Filepath Includes Path + Name + FileType
File.CREATEOUTSTREAM(FileOutStream);
TempBlob.Blob.CREATEINSTREAM(FileInStream);
COPYSTREAM(FileOutStrm,FileInStream);
File.CLOSE;
//RWN

CHEERS

NAV ClickOnce Deployment – Fileshare

 

Hey Friends,

This Post is all about deploying your Dynamics NAV through ClickOnce to your local domain, where each User can access NAV without any dependency of system prerequisites. If you have no idea of ClickOnce then you can have a look on this ClickOnce

So first step what you need to do is to install the ClickOnce from the NAV build. If you have NAV already installed then you just need to open it out and install the ClickOnce setup.

Once you are done with the installation part you need to make a new folder and subfolders in any of your drives and name it like this  FileShare\ClickOnce\Deployment\ApplicationFiles(Name you can choose as per you).

Now you need to navigate to C:\Program Files (x86)\Microsoft Dynamics NAV\71\RoleTailored Client.

rtc

Here from this folder you need to copy all the files from the above mentioned path to – FileShare\ClickOnce\Deployment\ApplicationFiles the one we made above.

After this you need to copy your ConfigSettings from your local app folder(C:\Users\username\AppData\Roaming\Microsoft\Microsoft Dynamics NAV\71)

Now you need to navigate to  – C:\Program Files (x86)\Microsoft Dynamics NAV\71\ClickOnce Installer Tools\TemplateFiles and copy all Files from here to this directory as created above FileShare\ClickOnce\

Now you need to open Command Prompt with admin right and fire the command as shown below – 

  1. Navigate to FileShare\ClickOnce\Deployment\ApplicationFiles from command prompt and fire this command
    1. “C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\mage.exe” -Update Microsoft.Dynamics.Nav.Client.exe.manifest
  2. Navigate to FileShare\ClickOnce\Deployment\ from command prompt and fire this command
    1. “C:\Program Files (x86)\Microsoft SDKs\Windows\v8.0A\bin\NETFX 4.0 Tools\mage.exe” -Update Microsoft.Dynamics.Nav.Client.application -appmanifest ApplicationFiles\Microsoft.Dynamics.Nav.Client.exe.manifest -appcodebase \\fileshare\Clickonce\Deployment\ApplicationFiles\Microsoft.Dynamics.Nav.Client.exe.manifest
  3. You can manually navigate to these two files and cross-verify with current date and time that it’s been successfully updated.
  4. Now you need to open  Microsoft.Dynamics.Nav.Client.application file from Deployment folder as created above and change couple of things like Assembly Identity name as your specific Customer for whom you made this OneClick.

Now you are good to go but again one point is there that you need to take care – You can only access this OneClick from your local computer if you have shared this over network otherwise if you try to access it directly then you will end up with some security zones issue.

So now share your Fileshare folder with all necessary permissions and for those people with whom you truly want to share. Once you are done with this, Please try to access this in your windows explorer

\\ComputerIP\FileShare\ClickOnce\Deployment\

Now try to open your Microsoft.Dynamics.Nav.Client application manifest, a dialogue box will come which will ask you to install it up, if it ends up with an error then you need to open the log and check the error log.

Install the application and enter the valid ID and Password and you will be logged in to NAV RTC Environment.

CHEERS..

Check Valid Zip Code

 

Hey Friends,

This Post is all about validating a proper Zip Code. Just 2 3 lines of code needed and you can validate your zip code. So below is the line of code that you just need to write.

 

 

 

 

 

 

 

//RWN
IF NOT Regex.Match(ZipCode, ‘^\d{5}$’ ).Success THEN
EXIT(FALSE)
ELSE
EXIT(TRUE);
//RWN

Regex           DotNet                  System.Text.RegularExpressions.Regex.’System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

CHEERS