GlideModal | Delete Record

Spaceballs
Kilo Sage

Hi 

As a beginner on this tool, I'm attempting to create a simple prompt to appear when I click the custom delete button. I've set up a basic Glide confirmation, but when I click 'OK', the current record does not get deleted. I'm unsure of what is causing the issue.

 

Spaceballs_0-1675443175775.png

 

Spaceballs_1-1675443200548.png

UI  Action script

function deleteconfirmationdialog() {
	
    var gm = new GlideModal("glide_confirm_basic", true, 400);

    gm.setTitle("Ready to delete?");
    gm.setPreference("title", "Doing so will permanently delete the record from the database");

	//cancel
    gm.setPreference("onPromptCancel",
        function() {
            return;
        });
	
	//ok
    gm.setPreference("onPromptComplete",
        function() {
			current.deleteRecord();
        });

    gm.render();
}

 

expected result

Spaceballs_2-1675443237166.png

 

 

 

1 REPLY 1

Community Alums
Not applicable

Not sure you can do it in such a way... Why dont you check the OOB UI Actio sysverb_delete (display name Delete). There is an AJAX called script include named DeleteRecordAjax().

This is working for sure + as far as i recall it - in the delete UIAction there is delete_confirm_form as OOB modal.