he creado una entida ,he hecho un codigo ( lo que debe hacer es mostrarme distintos valores en un picklist, dependiendo del usuario que lo este utilizando).
Y lo he cargado en la funcion Onload de esa entidad:
var currentUser = crmForm.all.ownerid.DataValue[0];
var userId = currentUser.id;
var userdomain = currentUser.domainname;
var p_estado = crmForm.all.new_estado;
var oArrayDecano = new Array();
var oArrayRegistro = new Array();
var oArraySecretaria = new Array();
// keep a copy of the original options and reset the picklist before we start firking about
if(!p_estado.originalPicklistValues)
{
p_estado.originalPicklistValues = p_estado.Options;
}
else
{
p_estado.Options = p_estado.originalPicklistValues;
}
//
oArrayDecano.push(3,4);
oArrayRegistro.push(5,6);
oArraySecretaria.push(1,2);
//
if(userdomain=="LABORATORIO\decanoCRM")
{
filterPicklist(oArrayDecano);
}
if(userdomain=="LABORATORIO\usuarioJefeR") //linea 53
{
filterPicklist(oArrayRegistro)
}
if(userdomain=="LABORATORIO\secretariaCRM")
{
filterPicklist(oArraySecretaria)
}
function filterPicklist(oDesiredOptions)
{
var oTempArray = new Array();
// loop through all items in the master list
for (var i=p_estado.length-1;i >= 0;i--)
{
// then add the option to our temp array and remove the
// item from the desired option array
for (var j=oDesiredOptions.length;j >= 0;j--)
{
if(p_estado[i].value == oDesiredOptions[j])
{
oTempArray[i] = true;
oDesiredOptions.splice(j,1);
}
}
}
// Now remove all options from the master list that were not marked as required
for (var i=p_estado.length;i >= 0;i--)
{
if(oTempArray[i] != true)
{
p_estado.remove(i);
}
}
}
Me sale el siguiente mensaje: " Se esperaba un dígito hexadecimal "
en la linea: " 53 " .
agradecria su ayuda.