cancel
Showing results for 
Search instead for 
Did you mean: 

UI ErrorCode = -2147417851

former_member202745
Active Participant
0 Kudos

Hi all,

i'm trying to select automatically a sales person at Sales Order form. Follows bellow the piece of code.

if (pVal.MenuUID == "trocaVend" && !pVal.BeforeAction)
            {
                int vendedor;

                try
                {
                    vendedor = (int)Modulo.Dados.BuscaUm("salesprson", "OHEM", "userid",
                                                Modulo.Empresa.UserSignature.ToString());

                    ComboBox _combox = (ComboBox)_form.Items.Item("20").Specific;

                    if (((ValidValue)_combox.Selected).Value == "-1")
                    {
                        //****   I'm sure that variable vendedor has the correct value!!
                        _combox.SelectExclusive(vendedor, BoSearchKey.psk_ByValue);
                    }

                }
                catch (Exception exception)
                {
                    ExceptionClass.throwException("Falha na busca do vendedor", exception);
                }

When this method is fired return this Exception:

{"O servidor emitiu uma exceção. (Exceção de HRESULT: 0x80010105 (RPC_E_SERVERFAULT))"}

ErrorCode = -2147417851

I tryed to do this with other ComboBox at this form with success. Some idea?

Regards,

Leonardo Azevedo.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hi Leonardo,

Why do you need ToString() there? That may only return text instead of integer.

Thanks,

Gordon

former_member202745
Active Participant
0 Kudos

Hi Gordon,

this is a parameter in my function to return a object from database, but your tip was very usefull,

I was using SelectExclusive with an integer parameter instead string. It works, but I've inserted

this method to the validate event of cardcode edittext, this was causing a misterious loop in my add-on crashing B1, moved to item_pressed.

Thanks and Regards,

Leonardo Azevedo.

Answers (0)