button command action from Ribbon Workbench for crm 2013

797 views Asked by At

I have a button "add new " in my form, and there is a command action written (/_static/_common/scripts/RibbonActions.js) as per Ribbon workbench to create a new record.

Now i want to add my another function in as another command action which return true or false.

If it returns true then and then the default create function will execute.

How can i do this, anyone have idea ?

1

There are 1 answers

0
Khoait On

Try updating your New button command with following function from your script:

function MyAddNewAction(entityTypeName){
    var bContinue = true;
    // your validation code here, and update bContinue
    //

    if(bContinue){
        Mscrm.RibbonActions.openNewRecord(entityTypeName);
    }
}

Hope it helps!