Examples DocumentChange operations on columns

Dokumentation •
In diesem Artikel

With the DocumentChange it is also possible to perform operations on columns, in case you want to modify, add or replace a column.

Columns properties 

  • alignement
    • type: text
    • values: left|right|center
  • description
    • type: text
  • header1
    • type: text
  • header2
    • type: text
  • name
    • type: text
  • nameXml
    • type: text
  • width
    • type: number
    • values: in mm, max value 10000
  • definition
    • type: object
    • values: text, number, amount, date, time, bool, timestamp, timecounter, links,textmultiline, markdown, mime, textencrypted, Default value: text
    • decimals
      Number of decimals for types amount and number. Default value: 2
  • operation
    • values: add|delete|modify|move|replace

 

{
   "name": "MyColumn",
   "nameXml": "MyColumn",
   "description": "This is my column with an amount",
   "header1": "MyColumn",
   "definition" : {
      "type": "amount",
      "decimals": "4"
   },
   "operation": {
      "name": "add"
   }
}

Example adding a column

The following example shows how to append a column to the Accounts table. If you indicate the sequence, the column will be inserted at the given position. try this operation

{
    "format": "documentChange",
    "error": "",
    "data": [{
        "document": {
            "dataUnits": [{
                "data": {
                    "viewList": {
                        "views": [{
                            "columns": [{
                                    "alignement": "center",
                                    "description": "center column",
                                    "nameXml": "CenteredColumn",
                                    "header1": "My Header 1",
                                    "header2": "My Header 2",
                                    "width": 200,
                                    "operation": {
                                        "name": "add"
                                    }
                                }],
                            "id": "Base",
                            "nameXml": "Base",
                            "nid": 1
                        }]
                    }
                },
                "id": "Accounts",
                "nameXml": "Accounts",
                "nid": 100
            }]
        }
    }]
}

Example modifying a column

The following example shows how to modify the existing column at line 2 in the Transactions table.

{
    "format": "documentChange",
    "error": "",
    "data": [{
        "document": {
            "dataUnits": [{
                "data": {
                    "viewList": {
                        "views": [{
                            "columns": [{
                                "header1": "NewDescription XXXX",
                                "nameXml": "Description",
                                "operation": {
                                    "name": "modify",
                                    "sequence": "1"
                                }
                            }],
                            "id": "Base",
                            "nameXml": "Base",
                            "nid": 1
                        }]
                    }
                },
                "id": "Transactions",
                "nameXml": "Transactions",
                "nid": 103
            }]
        }
    }]
}

Example replacing a column

The following example shows how to replace the existing custom column 'MyColumn' in the Transactions table.

{
    "format": "documentChange",
    "error": "",
    "data": [{
        "document": {
            "dataUnits": [{
                "data": {
                    "viewList": {
                        "views": [{
                            "columns": [{
                                "nameXml": "MyColumn",
                                "header1": "My new empty column",
                                "operation": {
                                    "name": "replace",
                                    "sequence": "23"
                                }
                            }],
                            "id": "Base",
                            "nameXml": "Base",
                            "nid": 1
                        }]
                    }
                },
                "id": "Transactions",
                "nameXml": "Transactions",
                "nid": 103
            }]
        }
    }]
}

Example deleting a column

The following example shows how to delete the existing column at line 2 in the Accounts table.

{
    "format": "documentChange",
    "error": "",
    "data": [{
        "document": {
            "dataUnits": [{
                "data": {
                    "viewList": {
                        "views": [{
                            "columns": [{
                                "nameXml": "Description",
                                "operation": {
                                    "name": "delete"
                                    "sequence": "1"
                                }
                            }],
                            "id": "Base",
                            "nameXml": "Base",
                            "nid": 1
                        }]
                    }
                },
                "id": "Accounts",
                "nameXml": "Accounts",
                "nid": 100
            }]
        }
    }]
}

Example moving a column

The following example shows how to move an existing column to position 2 in the Transactions table.

To find a column's number, double-click any column header. In the dialog that opens, you can view all available columns, listed in ascending order starting from 0.

Hidden columns are also included in the numbering.

{
    "format": "documentChange",
    "error": "",
    "data": [{
        "document": {
            "dataUnits": [{
                "data": {
                    "viewList": {
                        "views": [{
                            "columns": [{
                                "nameXml": "Description",
                                "operation": {
                                    "name": "move",
                                    "sequence": "2"
                                }
                            }]
                        }]
                    }
                },
                "nameXml": "Transactions"
            }]
        }
    }]
}

 

Wie können wir Ihnen besser helfen?

Lassen Sie uns wissen, welches Thema wir erweitern oder hinzufügen sollten, um diese Seite nützlicher zu machen.

Senden Sie uns Ihr Feedback

Diesen Artikel teilen: Twitter | Facebook | LinkedIn | Email