Sunday, April 12, 2009

[15] "OBS is Required" validation check

Somebody asked me how to make Project OBS fields mandatory... I didn't want to introduce any Trigger based solution as it may obstruct Clarity's own Create/Save Project process. So came up with a Java Script workaround that will display following message if Project OBS is not entered. Download code




* Adding custom Javascript thing was one of the most interesting, challenging research I did on Clarity. Adding "OBS is Required" message was another Fun thing. Intercepting Save/Submit button event and then dynamically adding Error message bar was quite interesting research. Specially dynamically adding custom function in Save/Submit button drove me crazy... but at last it was done. I did this Javascript thing somewhere early in 2006 and I was using it for other "naughty" purpose (still using though) but this OBS Message is just recent thing. I tested on 7.5.x, 8.x and 12.x and it works. Attached Javascript is just a foundation, but it can be extended to do 'anything'. I experimented with AJAX calls, data validation checks, Dependent lookups blah blah ... using this Javascript workaround. But word of caution here, improper handling/coding of Javascript may cause Javascript error messages on the screen and may interfere with Clarity's own Javascript functions. Another thing, you may need to Redo this XSL change after ServicePack/upgrade.

10 comments:

  1. I am going to try and tweak this for ideas to make Dept OBS a required field. I'll let you know if this works.

    ReplyDelete
  2. Is it possible to modify this to make Dept OBS a required field on ideas?

    ReplyDelete
  3. Adam,

    Try replacing obsUnit by obsDepartmentText in checkOBSFilled function. Use OR (||) condition for both obsUnit & obsDepartmentText if you want user to fill in any of these.

    - Sangeet

    ReplyDelete
  4. Thanks. I'll try an let you know if this works.

    ReplyDelete
  5. In our implementation we want to default the OBS settings in project templates and not let our project managers modify them. Is there any way you know to hide the OBS section on the project edit page?

    ReplyDelete
  6. Hey Sangeet,

    Is it possible to make a validation on resource timesheet page for a field lets say charge code ?
    Please advice

    ReplyDelete
  7. During upgrades, do we need to re-do these changes?

    ReplyDelete
  8. Hi,

    I have used the attached code for my configured OBS X for Project object. It is working fine. I also need to do the samae for Idea, Application and Resource Object. So Can I use the same way for Idea, Application and Resource. If somebody has already created the same then please share with me.

    Any suggestion is much appreciated.

    ReplyDelete
  9. Is there any way to incorporate this directly in the GUI instead? We are unluckily(in this case) on ONDEMAND system so no customizations of files.

    Harvey
    harvey1953@ymail.com

    ReplyDelete
  10. Is it possible to modify the javascript on Clarity 13?

    I have many customizations with js and I don´t know how to make them now.

    Cheers.

    ReplyDelete