Estou usando o campo de parâmetro do tipo picklist de um entidade para fazer em outra entidade escolher o formulário a ser aberto, adicionei o java no OnLoad.
O código não apresenta erro porem não faz o necessário. Alguém tem alguma ideia?
Segue o codigo :
function SelecionaCargaInteracao() {
Xrm.Page.getControl("bull_tipo").addPreSearch(FiltrarCargaInteracao)
}
function FiltrarCargaInteracao() {
var idTipo = Xrm.Page.data.entity.getId();
if (idTipo != null)
{
var fetchXml = "<filter type='and'>";
fetchXml += "<condition attribute='bull_tipo' operator='eq' value='1' />";
fetchXml += "</filter>";
Xrm.Page.getControl ("bull_tipo").addCustomFilter (fetchXml);
}
}
function ValidaCargaInteracao() {
var idTipo = Xrm.Page.data.entity.getId();
if (idTipo == getValue(1))
{
var tipoSelecionado = Xrm.Page.getAttribute("bull_tipo").getValue(1);
}
else
{
var tipoSelecionado = Xrm.Page.getAttribute("bull_tipo").getValue(2);
}
}