How to get the GetF4SQL result in V10 in an external application?

3

With the code below in V9 it works perfectly but in V10 nothing happens when selecting a client from the list either with F4 again or with enter. What's the difference for V10? Is there any other way to do this?

string s = "SELECT     Cliente, Nome, Fac_Mor, Fac_Tel, NumContrib From Clientes";
string res =  plataforma.Listas.GetF4SQL("Clientes", s, "Cliente");
MessageBox.Show(res);
    
asked by anonymous 13.08.2018 / 10:46

1 answer

3

In V10 the GetF4SQL method expects the result to be passed to a control, so nothing happens when you try to do F4.

To "bypass" this situation and get the result for string , you can do this as follows:

string s = "SELECT Cliente, Nome, Fac_Mor, Fac_Tel, NumContrib FROM Clientes";
string res = plataforma.Listas.GetF4SQL("Clientes", s, "Cliente", this, new TextBox());

MessageBox.Show(res);

If you really want to pass the value to a control, just pass it to the last parameter of the method:

string s = "SELECT Cliente, Nome, Fac_Mor, Fac_Tel, NumContrib FROM Clientes";
string res = PriEngine.Platform.Listas.GetF4SQL("Clientes", s, "Cliente", this, textBox1);

MessageBox.Show(res);
    
13.08.2018 / 11:11