ну вот что то типа вот этого
X++:
switch (ctrlCustVendACType.selection())
{
case CustVendACType::Cust :
RContractTable::lookupRContractAccount(this,
RContractPartnerType::Cust,
ctrlRContractCode.text(),
ctrlCustVendAC.text());
break;
case CustVendACType::Vend :
RContractTable::lookupRContractAccount(this,
RContractPartnerType::Vend,
ctrlRContractCode.text(),
ctrlCustVendAC.text());
break;
default:
throw error(error::wrongUseOfFunction(funcname()));
}