<% /*
    $Revision$
    $Id$

    File:           model_res_kenmerk.inc

    Description:    Vanuit CodeCharge gegenereerd model voor res_kenmerk

    Context:

    Notes:
*/
%>
<%
function model_res_kenmerk()
{
    this.table = "res_kenmerk";
    this.primary = "res_kenmerk_key";
    this.records_name = "res_kenmerks";
    this.record_name = "res_kenmerk";
    this.soft_delete = "res_kenmerk_verwijder";
    this.autfunction = "WEB_RESMGT";
    this.record_title = L("res_kenmerk");
    this.records_title = L("res_kenmerk_m");


    this.fields = {
        "id": {
            "dbs": "res_kenmerk_key",
            "label": "Key",
            "typ": "key",
            "required": true,
            "filter": "exact",
            "seq": "res_s_res_kenmerk_key"
        },
        "type": {
            "dbs": "res_srtkenmerk_key",
            "label": L("res_srtkenmerk_key"),
            "typ": "key",
            "required": true,
            "foreign": {
                "tbl": "(select RES_SRTKENMERK_KEY, RES_SRTKENMERK_OMSCHRIJVING"
                     + "   from RES_SRTKENMERK"
                     + "  where RES_SRTKENMERK_VERWIJDER IS NULL"
                     + "  order by res_srtkenmerk_omschrijving asc)",
                "key": "res_srtkenmerk_key",
                "desc": "res_srtkenmerk_omschrijving"
            },
            "filter": "exact",
            "LOVinit": "",
            "friendlyname": true
        },
        "level": {
            "dbs": "res_kenmerk_niveau",
            "label": L("lcl_niveau"),
            "typ": "varchar",
            "required": true,
            "hidden_fld": true,
            "defaultvalue": "A"
        },
        "sequence": {
            "dbs": "res_kenmerk_volgnummer",
            "label": L("res_kenmerk_volgnummer"),
            "typ": "number",
            "required": true
        },
        "res_activiteit_key": {
            "dbs": "res_activiteit_key",
            "label": L("res_activiteit_key"),
            "typ": "key",
            "required": true,
            "foreign": {
                "tbl": "(select res_activiteit_key, res_activiteit_omschrijving"
                     + "   from res_activiteit"
                     + "  where res_activiteit_verwijder is null"
                     + "  order by res_activiteit_upper asc)",
                "key": "res_activiteit_key",
                "desc": "res_activiteit_omschrijving"
            },
            "filter": "exact",
            "LOVinit": ""
        },
        "required": {
            "dbs": "res_kenmerk_verplicht",
            "label": L("res_kenmerk_verplicht"),
            "typ": "key",
            "LOV": buildVerplichtingList(),
            "emptyoption": null
        },
        "group": {
            "dbs": "res_kenmerk_groep",
            "label": L("res_kenmerk_groep"),
            "typ": "key",
            "required": true,
            "LOV": buildGroepsverplichtingList(),
            "emptyoption": null
        },
        "readonly": {
            "dbs": "res_kenmerk_toonbaar",
            "label": L("res_kenmerk_toonbaar"),
            "typ": "check"
        },
        "default": {
            "dbs": "res_kenmerk_default",
            "label": L("res_kenmerk_default"),
            "typ": "memo",
            "translate": true
        },
        "hint": {
            "dbs": "res_kenmerk_hint",
            "label": L("res_kenmerk_hint"),
            "typ": "memo",
            "translate": true
        },
        "regexp": {
            "dbs": "res_kenmerk_regexp",
            "label": L("res_kenmerk_regexp"),
            "typ": "varchar"
        }
    };


    this.REST_GET    = generic_REST_GET(this, this.gparams);
    this.REST_POST   = generic_REST_POST(this);
    this.REST_PUT    = generic_REST_PUT(this);
    this.REST_DELETE = generic_REST_DELETE(this, {});
}
%>