update the status of the record using XrmSvcToolkit request

function setState() {
    //Set the stage to send enquiry letter
    XrmSvcToolkit.setState({
        id: Xrm.Page.data.entity.getId(),
        entityName: "lead",
        stateCode: 0,
        statusCode: 1, //New
        async: false,
    });
    //Save and Reload form
    Xrm.Page.data.refresh(true).then(null, null);
}

Comments

Popular posts from this blog

Basic Plugin Code in D365 using C#

CURD (Create, Update, Retrieve and Delete) Operation in D365 using Power Shell Script

Meta Data Using WebApiRequest