Adding a URL link within an UI Action

matthew_hughes
Kilo Sage

I've got a UI Action where a confirmation box appears when a user clicks on the 'Generate/Continue AMA Scoping' button. I'm using the following code to create my confirmation box:

 

function generateConfirmation() {

var answer = confirm('By clicking "Continue" you are committing to completing the full Access Management Assessment (AMA) process and once started the assessment process cannot be cancelled. If you do not wish to proceed, click "Cancel".\n\nPlease ensure by starting this that you are ready to complete and have evidence available to support responses to full Access Management Assessment. For AMA guidance and evidence requirements please consult the <a href = "https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flloydsbanking.sharepoint.com%2Fsit...">Access Management SharePoint</a> site.');

if (answer == true) {
gsftSubmit(null, g_form.getFormElement(), 'continue_scoping');
} else {
return false;
}
}

 

I'm wanting the alert to show Access Management SharePoint as the link and to open in a new windows. However, when a user clicks on the 'Generate/Continue AMA Scoping' button, the it displays the following:

 

UI Action html.png

 

I was just wondering what I need to do to stop the html from showing in the confirmation box.

1 ACCEPTED SOLUTION

Arun_S1
Tera Guru
Tera Guru

@matthew_hughes Please change the UI Action script as below and check if this suits your requirement.

 

function generateConfirmation() {
    var dd = new GlideModal('Confirm');
    dd.setTitle('Confirm');
    dd.renderWithContent('<div>By clicking "Continue" you are committing to completing the full Access Management Assessment (AMA) process and once started the assessment process cannot be cancelled. <br/> If you do not wish to proceed, click "Cancel".<br/><br/>Please ensure by starting this that you are ready to complete and have evidence available to support responses to full Access Management Assessment. For AMA guidance and evidence requirements please consult the <a href = "https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flloydsbanking.sharepoint.com%2Fsit...">Access Management SharePoint</a> site.</div> <div><button onclick="confirm()">Confirm</button><button onclick="cancel()">Cancel</button></div>');

    function confirm() {
        alert('Thanks for Confirming');
        gsftSubmit(null, g_form.getFormElement(), 'continue_scoping');
    }

    function cancel() {
        dd.desctroy();
    }

}

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!

View solution in original post

4 REPLIES 4

Arun_S1
Tera Guru
Tera Guru

@matthew_hughes Please change the UI Action script as below and check if this suits your requirement.

 

function generateConfirmation() {
    var dd = new GlideModal('Confirm');
    dd.setTitle('Confirm');
    dd.renderWithContent('<div>By clicking "Continue" you are committing to completing the full Access Management Assessment (AMA) process and once started the assessment process cannot be cancelled. <br/> If you do not wish to proceed, click "Cancel".<br/><br/>Please ensure by starting this that you are ready to complete and have evidence available to support responses to full Access Management Assessment. For AMA guidance and evidence requirements please consult the <a href = "https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flloydsbanking.sharepoint.com%2Fsit...">Access Management SharePoint</a> site.</div> <div><button onclick="confirm()">Confirm</button><button onclick="cancel()">Cancel</button></div>');

    function confirm() {
        alert('Thanks for Confirming');
        gsftSubmit(null, g_form.getFormElement(), 'continue_scoping');
    }

    function cancel() {
        dd.desctroy();
    }

}

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!

Hi @Arun_S1 

When I click 'Confirm', this then appears and nothing happens when I click OK:

 

matthew_hughes_0-1689846435710.png

 

Do you know what's causing it?

 

 

Hi @Arun_S1 I've figured it out now. Do you know how to make a GlideModal box appear for certain conditions?

Arun_S1
Tera Guru
Tera Guru

@matthew_hughes You meant to say that the message popup should appear on a specific condition, like when a field in the form has a specific value selected?

 

If so, please write a method execute() and call this method in the UI Action Onclick field.

function execute(){
if(current.priority ==1){
generateConfirmation();
}

current.update();
}


function generateConfirmation() {
    var dd = new GlideModal('Confirm');
    dd.setTitle('Confirm');
    dd.renderWithContent('<div>By clicking "Continue" you are committing to completing the full Access Management Assessment (AMA) process and once started the assessment process cannot be cancelled. <br/> If you do not wish to proceed, click "Cancel".<br/><br/>Please ensure by starting this that you are ready to complete and have evidence available to support responses to full Access Management Assessment. For AMA guidance and evidence requirements please consult the <a href = "https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Flloydsbanking.sharepoint.com%2Fsit...">Access Management SharePoint</a> site.</div> <div><button onclick="confirm()">Confirm</button><button onclick="cancel()">Cancel</button></div>');

    function confirm() {
        alert('Thanks for Confirming');
        gsftSubmit(null, g_form.getFormElement(), 'continue_scoping');
    }

    function cancel() {
        dd.desctroy();
    }

}

 

Please mark the appropriate response as correct answer and helpful.

Thanks!!