on 02-15-2012 2:35 PM
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.
Hi Leonardo,
Why do you need ToString() there? That may only return text instead of integer.
Thanks,
Gordon
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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.
User | Count |
---|---|
96 | |
9 | |
8 | |
5 | |
4 | |
3 | |
3 | |
3 | |
3 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.