.NET

Retrieve Data from .NET Dialog with .NET integration


Retrieve Data from .NET Dialog with .NET integration

You can simply retrieve data from .NET Dialogs using NAV .NET Integration.

Example: Object 50002 Get Value from .NET Input Dialog

On Page Action, declare .NET variables

DotNet variables are linked to standard System.Windows.Forms class.

Open Page

Click on Button

Input Data > insert “TEST”

Retrieve Data from .NET Command Prompt

Source C/AL Code

OBJECT Page 50002 Get Value from .NET Input Dial

{

OBJECT-PROPERTIES

{

Date=06/06/16;

Time=10.49.25;

Modified=Yes;

Version List=NAV9;

}

PROPERTIES

{

CaptionML=ENU=Get Value From .NET Input Dialog;

ActionList=ACTIONS

{

{ 1101340000; ;ActionContainer;

CaptionML=ITA=-;

ActionContainerType=NewDocumentItems }

{ 1101340001;1 ;Action ;

Name=Get Value From .NET Dialog Input;

Promoted=Yes;

PromotedIsBig=Yes;

PromotedCategory=Process;

OnAction=VAR

PromptInput@1101340000 : DotNet “‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.System.Windows.Forms.Form” RUNONCLIENT;

PageBordStyle@1101340001 : DotNet “‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.System.Windows.Forms.ButtonBorderStyle” RUNONCLIENT;

PageStartPos@1101340002 : DotNet “‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.System.Windows.Forms.FormStartPosition” RUNONCLIENT;

lblInputData@1101340004 : DotNet “‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.System.Windows.Forms.Label” RUNONCLIENT;

txInputData@1101340008 : DotNet “‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.System.Windows.Forms.TextBox” RUNONCLIENT;

Confirmation@1101340011 : DotNet “‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.System.Windows.Forms.Button” RUNONCLIENT;

DialogResult@1101340012 : DotNet “‘System.Windows.Forms, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’.System.Windows.Forms.DialogResult” RUNONCLIENT;

BEGIN

//Creating .NET Page

PromptInput := PromptInput.Form();

PromptInput.Width := 500;

PromptInput.Height := 300;

PromptInput.StartPosition := PageStartPos.CenterScreen;

//Creating Controls on Page

lblInputData := lblInputData.Label();

lblInputData.Text(‘Enter DataText:’);

lblInputData.Left(70);

lblInputData.Top(70);

PromptInput.Controls.Add(lblInputData);

//Adding Labels and text boxes

txInputData := txInputData.TextBox();

txInputData.Left(200);

txInputData.Top(70);

txInputData.Width(180);

PromptInput.Controls.Add(txInputData);

//Adding Confirmation Button

Confirmation := Confirmation.Button();

Confirmation.Text(‘OK’); //OK

Confirmation.Left(200);

Confirmation.Top(150);

Confirmation.Width(150);

Confirmation.DialogResult := DialogResult.OK;

PromptInput.Controls.Add(Confirmation);

PromptInput.AcceptButton := Confirmation;

// Getting data from prompt dialog

IF (PromptInput.ShowDialog().ToString() = DialogResult.OK.ToString()) THEN

MESSAGE(txInputData.Text); //TEST *** Print message retrieved from prompt

PromptInput.Dispose();

END;

}

}

}

CONTROLS

{

}

CODE

{

BEGIN

{

//Retrieve Data from .NET Dialog Input

//with .NET integration

}

END.

}

}

Annunci

Rispondi

Inserisci i tuoi dati qui sotto o clicca su un'icona per effettuare l'accesso:

Logo WordPress.com

Stai commentando usando il tuo account WordPress.com. Chiudi sessione / Modifica )

Foto Twitter

Stai commentando usando il tuo account Twitter. Chiudi sessione / Modifica )

Foto di Facebook

Stai commentando usando il tuo account Facebook. Chiudi sessione / Modifica )

Google+ photo

Stai commentando usando il tuo account Google+. Chiudi sessione / Modifica )

Connessione a %s...