Home Cireson Uploads

Make the SendEmail To and CC fields Read Only

Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
To avoid analysts changing the To and CC boxes of the SendEmail task you can use this customisation to make the fields Read Only. They cannot be edited.

I won't bother with a screenshot, as it looks exactly the same, but the two input boxes cannot be edited.

Enjoy

Geoff

Comments

  • David_AllenDavid_Allen Partner Advanced IT Monkey ✭✭✭
    The other field that would be useful to make read-only is the Subject field, especially if you are using the Exchange Connector, as the work item ID in square brackets is very important for replies to be processed. 

    After downloading Geoff's solution, you can add the following to the file MakeEmailToReadOnly.js for each work item type to make the subject read-only.

    $('input[data-bind="value: emailSubject"]').attr("readonly","true")

    David
  • Jonathan_BolesJonathan_Boles Customer Ninja IT Monkey ✭✭✭✭
    Hi @Geoff_Ross, kinda further along these lines of the SendEmail task - is it possible to force the entry of an email address in the CC box within the SendEmail task?
  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    @Jonathan_Boles
    As is force the user to enter something or have the portal put something predefined in there?
    Both are probably possible but very different methods.
  • Jonathan_BolesJonathan_Boles Customer Ninja IT Monkey ✭✭✭✭
    @Jonathan_Boles
    As is force the user to enter something or have the portal put something predefined in there?
    Both are probably possible but very different methods.
    Thanks for the quick response Geoff! We'd be looking to put in a pre-defined mailbox - not changeable by the user.
  • Geoff_RossGeoff_Ross Cireson Consultant Super IT Monkey ✭✭✭✭✭
    @Jonathan_Boles
    So take the solution above and add one 1 more line to each section so they read

    app.custom.formTasks.add('ServiceRequest', null, function (formObj, viewModel) {
        //bind a function to the form ready event
        formObj.boundReady(function () {
    		$(".link[data-bind*=sendEmail]").on("click", function () { 
    			$('input[data-bind="value: emailTo"]').attr("readonly","true")
    			$('input[data-bind="value: emailCC"]').attr("readonly","true")
    			$('input[data-bind="value: emailCC"]')[0].value = "[email protected]"; //NEW LINE
    		});
        });
    });
    Feel free to change the email address though :P

    Geoff
Sign In or Register to comment.