0
votes

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

1 Answers

0
votes

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!