newtdf(tname,indata,success,failure)

Create a new tdf based on the json sent in indata

Parameters

- tname | name of table

- indata | the tdf definition in same format as it comes from gettd

- success | function to call on success

- faulure | function to call on failure, either a result != 'ok' or some other error

About format to send

You have to have at least {"tdf" : {"fdef" : [{"name" : "fieldname"}]}} to make it work. The save function will take any skipped values and replace it with the defaults, so you do not have to send all that is in the example below. Any key not recognized is ignored, so you do not need to clean up your json before sending.

{
    "tdf": {
        "fdef": [
            {
                "derived": "sequence from 000001",
                "hasindex": "yes",
                "isreqired": "yes",
                "isunique": "yes",
                "isvirtual": "no",
                "length": 6,
                "name": "ID",
                "preventedit": "yes",
                "readsec": "Low3",
                "type": "numstring",
                "writesec": "Low3"
            },
            {
                "hasindex": "no",
                "isreqired": "no",
                "isunique": "no",
                "isvirtual": "no",
                "length": 60,
                "name": "Name",
                "preventedit": "no",
                "readsec": "Low3",
                "type": "text",
                "writesec": "Low3"
            }
        ],
        "tablecreatesecurity": "Medium3",
        "tabledeletesecurity": "Medium3",
        "tabledopreservedataonmodify": true,
        "tablehasencrypteddata": false,
        "tablemodifysecurity": "Medium3",
        "tableviewsecurity": "Low3"
    }
}

Example of format to send