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

Meta Data Using WebApiRequest

Sample CRUD Operations Using C# in MSCRM

Basic Plugin Code in D365 using C#