Add a Custom Button

Add a Custom Button

ivendnext.ui.form.on("Event", "refresh", function(frm) {
    frm.add_custom_button(__("Do Something"), function() {
        // When this button is clicked, do this

        var subject = frm.doc.subject;
        var event_type = frm.doc.event_type;

        // do something with these values, like an ajax request 
        // or call a server side iVendNext function using ivendnext.call
        $.ajax({
            url: "http://example.com/just-do-it",
            data: {
                "subject": subject,
                "event_type": event_type
            }

            // read more about $.ajax syntax at http://api.jquery.com/jquery.ajax/

        });
    });
});

  1. Custom Field In A Form
Discard
Save
This page has been updated since your last edit. Your draft may contain outdated content. Load Latest Version

On this page

Review Changes ← Back to Content
Message Status Space Raised By Last update on