function createDataset(fields, constraints, sortFields) {
    var dataset = DatasetBuilder.newDataset();
    dataset.addColumn("status");
    dataset.addColumn("mensagem");
    dataset.addColumn("erro");

    log.info("### Enviando dados para Protheus via fluigAPI ###");

    try {
        var jsonData = "{}";
        if (constraints) {
            for (var i = 0; i < constraints.length; i++) {
                if (constraints[i].fieldName === "params" && constraints[i].initialValue) {
                    jsonData = constraints[i].initialValue;
                    break;
                }
            }
        }
        log.info("Dados recebidos: " + jsonData);

        var clientService = fluigAPI.getAuthorizeClientService();
        var data = {
            companyId:      String(getValue("WKCompany") || "1"),
            serviceCode:    "Postprod",
            endpoint:       "/rest/uf_mata010",
            method:         "post",
            timeoutService: "60000",
            params:         JSON.parse(jsonData),
            headers:        { "Content-Type": "application/json" }
        };

        var vo = clientService.invoke(JSON.stringify(data));
        var response = vo ? String(vo.getResult() || "") : "";

        log.info("Response: " + response);
        dataset.addRow(["OK", response, ""]);

    } catch (error) {
        log.error("Erro: " + error.toString());
        dataset.addRow(["Erro", "", error.toString()]);
    }

    return dataset;
}
