¿Cómo escribir un código Javascript para contar el número de formularios en Dynamic CRM 2011?

I want to write a Javascript code for counting the number of forms available for a particular user according to the security role in Dynamic CRM 2011.

preguntado el 01 de febrero de 12 a las 14:02

If by form you mean <form> entonces solo hazlo document.forms.length -

Where do you want this code to be executed on? -

I got the code to count and i want to hide all the ribbons if only one form is available,the following code is working in my local system then i imported into Online instance but its failed there var countForms = Xrm.Page.ui.formSelector.items.get(); if(countForms.length==0) { alert("One form"); //Hiding the Ribbons window.top.document.getElementById("crmTopBar").style.display = "none"; } else { alert("Two forms"); return true; } -

@Hashim: If you feel this question as it stands is answered, accept the answer, but if you have a new question about hiding ribbons based on the number of available forms, ask it as another question. It will help you get the most views and helpful answers. -

1 Respuestas

Consulte nuestra página Xrm.Page.ui.formSelector.items Collection.


Respondido 01 Feb 12, 21:02

Xrm.Page.ui.formSelector.items.getLength() is working in my local system,but when i deployed into online server its not counting the number of forms - Hashim

@Hashim: What is it doing? This feature isn't limited to on-premise deployments (at least the documentation doesn't say so). Is the property null, es el items -- null, etc.? - Peter Majeed

No es la respuesta que estás buscando? Examinar otras preguntas etiquetadas or haz tu propia pregunta.