function displayFields(form, customHTML) {
    var activity = parseInt(getValue("WKNumState"), 10);
    var userId = getValue("WKUser");
    var hoje = new java.text.SimpleDateFormat("dd/MM/yyyy").format(new java.util.Date());

    form.setShowDisabledFields(true);
    form.setHidePrintLink(true);

    form.setValue("WKNumProces", getValue("WKNumProces"));
    form.setValue("activity", String(activity));
    form.setValue("formMode", form.getFormMode());
    form.setValue("empresa", getValue("WKCompany"));

    var nomeUsuario = "";
    var emailUsuario = "";

    try {
        var c1 = DatasetFactory.createConstraint("colleagueId", userId, userId, ConstraintType.MUST);
        var constraints = [c1];
        var fields = ["colleagueName", "mail"];
        var dsColleague = DatasetFactory.getDataset("colleague", fields, constraints, null);

        if (dsColleague && dsColleague.rowsCount > 0) {
            nomeUsuario = dsColleague.getValue(0, "colleagueName") || "";
            emailUsuario = dsColleague.getValue(0, "mail") || "";
        }
    } catch (e) {
        log.error("[displayFields] Erro ao consultar colleague: " + e);
    }

    form.setValue("currentUserName", nomeUsuario);
    form.setValue("currentUsermail", emailUsuario);
    form.setValue("currentUserId", userId);

    if (activity === 0 || activity === 1) {
        form.setValue("requesterId", userId);

        if (emailUsuario) {
            form.setValue("requesterMail", emailUsuario);
        }
        if (!form.getValue("usuarioSolicitante") && nomeUsuario) {
            form.setValue("usuarioSolicitante", nomeUsuario);
        }
        if (!form.getValue("emailSolicitante") && emailUsuario) {
            form.setValue("emailSolicitante", emailUsuario);
        }
    }

    if (activity === 121) {
        if (nomeUsuario) {
            form.setValue("user_validacao_gestor", nomeUsuario);
        }
        form.setValue("data_validacao_gestor", hoje);
    }

    // Receber produto/servico
    if (activity === 18) {
        if (nomeUsuario) {
            form.setValue("userValidacaoItens", nomeUsuario);
        }
        form.setValue("dataValidacaoItens", hoje);
    }
}
