Home General Discussion

script for pre-check "Add message to action log" checkbox in send mail feature

Silas_SulserSilas_Sulser Customer Advanced IT Monkey ✭✭✭

Hi Folks

Is there any possibility to precheck the "Add message to action log" in send mail Feature?

I've already tried it with adding some selfmade script in the footer script loader:

<script>
 document.getElementById("IsAddToLog").checked = true;
</script>

Unfortunately I'm not very good in scripting, so it didn't work :)

Because this checkbox is at the very bottom of the form, a lot of our analysts miss it, what not even should be possible.

It should be pre-selected all the time.

Can you help me with this?

Best Answer

  • Tom_HydeTom_Hyde Customer Advanced IT Monkey ✭✭✭
    Answer ✓
    Hi @Silas_Sulser

    Add the below to your custom.js

    app.custom.formTasks.add('Incident', null, function (formObj, viewModel) {
        //bind a function to the form ready event
        formObj.boundReady(function () {
            $(".link[data-bind*=sendEmail]").on("click", function () {
                $("#IsAddToLog").trigger("click").closest("div");
            });
        });
    });

    app.custom.formTasks.add('ChangeRequest', null, function (formObj, viewModel) {
        //bind a function to the form ready event
        formObj.boundReady(function () {
            $(".link[data-bind*=sendEmail]").on("click", function () {
                $("#IsAddToLog").trigger("click").closest("div");
            });
        });
    });

    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 () {
                $("#IsAddToLog").trigger("click").closest("div");
            });
        });
    });

Answers

  • Tom_HydeTom_Hyde Customer Advanced IT Monkey ✭✭✭
    Answer ✓
    Hi @Silas_Sulser

    Add the below to your custom.js

    app.custom.formTasks.add('Incident', null, function (formObj, viewModel) {
        //bind a function to the form ready event
        formObj.boundReady(function () {
            $(".link[data-bind*=sendEmail]").on("click", function () {
                $("#IsAddToLog").trigger("click").closest("div");
            });
        });
    });

    app.custom.formTasks.add('ChangeRequest', null, function (formObj, viewModel) {
        //bind a function to the form ready event
        formObj.boundReady(function () {
            $(".link[data-bind*=sendEmail]").on("click", function () {
                $("#IsAddToLog").trigger("click").closest("div");
            });
        });
    });

    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 () {
                $("#IsAddToLog").trigger("click").closest("div");
            });
        });
    });

  • Silas_SulserSilas_Sulser Customer Advanced IT Monkey ✭✭✭
    Wow, that was fast!! It works like a charm, thank you so much! :)
  • Tom_HydeTom_Hyde Customer Advanced IT Monkey ✭✭✭
    No problem @Silas_Sulser :smile:
  • Alan_FosterAlan_Foster Customer Adept IT Monkey ✭✭
    Is there a solution that will work with Chrome browser? I have implemented this and it works for IE and Edge but not for Chrome.
  • Jeff_LangJeff_Lang Customer Ninja IT Monkey ✭✭✭✭
    not sure why this is not working in chrome for you, we have been using it for a while without any issues, and have it working in chrome, firefox and IE, have you done a SHIFT-F5 in Chrome to reload the page from the server without using the local cache ?
  • Alan_FosterAlan_Foster Customer Adept IT Monkey ✭✭
    Doing the Shift-F5 corrected the issue.  Thank you Jeff_Lang
  • Lauren_BoxallLauren_Boxall Customer IT Monkey ✭

    Hi all,
    I'd previously tested this on version 7.4 and am now using 8.4.3.2012 and this no longer works. Has anyone had any success?

    Thanks

  • Mikkel_MadsenMikkel_Madsen Customer Advanced IT Monkey ✭✭✭
    @Lauren_Boxall
    We have it working in 8.6 but the newest portal version have this functionality included and you can set the feature in admin settings https://support.cireson.com/KnowledgeBase/View/1168#/

Sign In or Register to comment.