cancel
Showing results for 
Search instead for 
Did you mean: 

How to send a value from an open form to another open form SDK

marour
Participant
0 Kudos
287

Hello Experts,

I am trying to send a Value (String) from an open Form to another open Form (FatherForm) to set the value as an EditText Value.

So I open a Form ( Not a system Form) and click on a Button which open a new Form where i can choose one Value from a Grid and as soon as I choose a Value ( By double clicking on a specific Row in a Grid) the open Form will be closed and the Value that i clicked on should be copied to the Father Form and set in a specific Edittext there.

It's something like Choose from a List function but I didnt get it how to solve it with the ChooseFromList function so I am trying it this way.

Any briefly Steps how to identify the Father Form and be able to set new Values on the Father Form?

Accepted Solutions (0)

Answers (1)

Answers (1)

Johan_Hakkesteegt
Active Contributor
0 Kudos

Hi,

The new form where the choice is made, should be a Dialog. Choose it when you add a new item to your project:

Program the form to save the chosen value to a property, and after the dialog is closed, and the code of the father form continues, you can access the dialog object's property. It works pretty much the same as, for example, a OpenFileDialog, except that you need to setup your own property for the chosen value.

Regards,

Johan

marour
Participant
0 Kudos

Hello johan.hakkesteegt ,

thank you very much for your Answer.

I have two Problems :

1- Under Windows Forms I do not have a Dialog (Windows Form).

2- The Data that the user is going to choose will be Data from my SAP Database so I need to get this Data in a Grid . Is that possible in Case I open a Dilag Windows Form?

PS: I am using VS 2015

Johan_Hakkesteegt
Active Contributor
0 Kudos

Hi,

  1. You can also turn a normal form into a dialog. Either way, a dialog is just a normal form with a dialog result. You just need to open with YourDialogFormWithAGridAndAllKindsOfCoolStuff.ShowDialog
  2. You can just create the form as usual, add a grid, and populate the grid from the database as usual. You would of course need access rights to the necessary database and tables. If you have installed the SDK, you can probably find an example on your machine here: C:\Program Files (x86)\SAP\SAP Business One SDK\Samples\COM DI\CSharp\05.order

Regards,

Johan