Tech Support > Microsoft Windows > Windows CRM > Madatory Field
Madatory Field
Posted by Faiz Amir on May 7th, 2008


Dear All,
Is it possibel to make a field mandatory for a user? If through javascript
is there a generic format available

Posted by Robert Rybaric on May 7th, 2008


It is a property of the attribute (field) itself. Go to the attributes and
change it there.

Regards,

Robert


"Faiz Amir" wrote:

Posted by Faiz Amir on May 7th, 2008


You have mentioned it to make it mandatory for all users. I want to make it
madatory for only one user.

"Robert Rybaric" wrote:

Posted by Rob Mottram on May 7th, 2008


You can use the following code to make a field required or not required in
javascript

var CRM_REQUIRED_LEVEL_NORMAL = 0;
var CRM_REQUIRED_LEVEL_RECOMMENDED = 1;
var CRM_REQUIRED_LEVEL_REQUIRED = 2;
//Make Required
crmForm.SetFieldReqLevel('fieldname', CRM_REQUIRED_LEVEL_REQUIRED);
//Make Normal - Not Required
crmForm.SetFieldReqLevel('fieldname', CRM_REQUIRED_LEVEL_NORMAL);

Using this in the onload of a form will allow you to make a field required
or not depeding on other fields on the form. What I don't know how to do is
get the username in javascript to know which users should have the field
required or not required.

I hope this might help you on your way.


Rob

"Faiz Amir" wrote:

Posted by Christoph Maßmann on May 8th, 2008


Hi,

you can get the current user
a) via a javascript webservice call
b) via the unsupported "remotecommand" (this works only in version 3 I
think)

Best regards,
Christoph


"Rob Mottram" <RobMottram@discussions.microsoft.com> schrieb im Newsbeitrag
news:7EB64459-84A9-40E1-8D1D-4DD4ED81EC4C@microsoft.com...