Skip to Content
0
Feb 15, 2012 at 02:35 PM

UI ErrorCode = -2147417851

82 Views

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.