Remove Namespace – Web Service Response (Automation Variable)

Hey Everybody,

This Post is about How to Import directly an XML which is coming as Web-Service from different platform like .NET. Whenever we get a response from a .NET Service we usually get Namespaces coming as enclosed in it. Now being a NAV developer  it’s something which becomes a barrier to us while getting it directly Imported from NAV XML Ports. So here we are to how get rid from this.

What exactly you need to do is you have to write below piece of code with the same DotNet variable references which you have used while getting sending a Request.

Capture

When you will save this in the last call your response will get saved without Namespaces. Now you can directly Import it Via your XML Port.

XmlStyleSheet – ‘Microsoft XML, v6.0’.DOMDocument60

XMLSourceDocument – ‘Microsoft XML, v6.0’.DOMDocument60

XMLDestinationDocument – ‘Microsoft XML, v6.0’.DOMDocument60

CHEERS.

Advertisements

Remove Namespace – Web Service Response (DotNet Variable)

Hey Everybody,

This Post is about How to Import directly an XML which is coming as Web-Service from different platform like .NET. Whenever we get a response from a .NET Service we usually get Namespaces coming as enclosed in it. Now being a NAV developer  it’s something which becomes a barrier to us while getting it directly Imported from NAV XML Ports. So here we are to how get rid from this.

What exactly you need to do is you have to write below piece of code with the same DotNet variable references which you have used while getting sending a Request.

Capture

When you will save this in the last call your response will get saved without Namespaces. Now you can directly Import it Via your XML Port.

XmlStyleSheet – MSXML.DOMDocumentClass.’Microsoft.MSXML, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’

XMLSourceDocument – MSXML.DOMDocumentClass.’Microsoft.MSXML, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’

XMLDestinationDocument – MSXML.DOMDocumentClass.’Microsoft.MSXML, Version=8.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a’

CHEERS.

String Comparison – Use DotNet Variable

 

Hey Friends,

I guess many Developers might have had faced this Issue, Whenever we used to compare a Text variable in CAL Coding something like –

Capture1

 

 

 

 

We do face Issues like System is not giving Error even CalTextVariable contains a Blank value. Majority times this Issues comes when there is an Integration between NAV and some .NET Portals. Reason behind this issue is, A NULL value is never considered as a Blank value OR even you can say the White Spaces. So this Line of Code is never a Full Proof solution to handle these cases.

But Instead of the above Line of Code If we just Introduce a .Net Variable and write below line of Code then this turns out to be Full Proof Solution.

Capture

This Piece of Code will handle each Probability that might ever we skip while Coding.

DotNetStringVariable – System.String.’mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089′

CalTextVariable  – CAL Text Variable.

CHEERS

Disable specific Keyboard Keys – Single Line of Code

 

Hey Friends,

I saw many people asking how to disable specific keys from Keyboards like for example How to Disable Enter Key , Though I never got this need 🙂 but eventually requirements has no limits hence I decided to find it out and introduce it here in my Blog.

Capture

InputFromKeyboard – System.Windows.Input.Keyboard.’PresentationCore, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′

InputKey – System.Windows.Input.Key.’WindowsBase, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35′

Enable RunOnClient Property as Yes for both the.NET Variables

You just need to write the above code highlighted, What it will do is when the confirmation Dialogues pops up then you need to Press Yes from MOUSE instead of the Enter Key from Keyboard to execute the further piece of Codes. If you will Press Enter from Keyboard then EXIT statement will Run and system will leave the execution

CHEERS

Virtual Table – Date

Hey,

Many times we have used Date as our Data Type in Tables and in Variables. Very often or even never we used Date as a Record Variable. This Post is all about using Date as a Record Data and we will see how powerful and helpful it is to use in our daily Programming.

This Virtual Table gives us a full fledge control on:

Period Type – Period Start – Period End – Period No – Period Name

Let’s see one example and make a Page from the standard Dynamics NAV wizard providing Date in the Table Name.

Capture

Currently in the above screenshot we have selected this Period Type as Date which explains –

Period Start – The Date which you have selected.

Period End – The Date which you have selected.

Period No – This shows the Days in Integer like  Monday – 1, Tuesday  – 2, Thursday – 3.

Period NameThis shows the name of respective Days.

Capture

Now in the above screenshot we have selected this Period Type as Week which explains –

Period Start – The Date which you have selected.

Period End – Date when week ends.

Period No – This shows starting week of the year and will continue till the year ends.

Period NameThis too shows the same information as above as week does not have a specific name.

Capture

Now in the above screenshot we have selected this Period Type as Month which explains –

Period Start – The Date which you have selected.

Period End – Date when month ends.

Period No – This shows the month in Integer like January – 1, February – 2, March – 3.

Period NameThis shows the name of respective Months.

Capture

Now in the above screenshot we have selected this Period Type as Quarter which explains –

Period Start – The Date which you have selected.

Period End – Date when quarter ends.

Period No – As we know quarters are of 3 month hence it’s now describing the quarter no..

Period NameThis too shows the same information as above.

Capture

Last but not the least now  we have selected this Period Type as Year which explains –

Period Start – The Date which you have selected.

Period End – Last day of the year..

Period No – Year.

Period NameThis too shows the same information as above.

Cheers.

Sorting – Report

 

Open Visual Studio.

Select Text-box -> Property -> Interactive Sorting.

Untitled

 

 

 

 

 

 

 

 

Select Sort By and Select the Respective Field whom you want to Sort with.

Save & Exit.

Outcome (Ascending).

1

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

 

Outcome (Descending).

2