Remove some properties
Remove some properties from an object by using the ApplyPatches method.
Example
A preliminary step is to create a transient list object.
1. Create a transient list object ListObject01. The object has two dynamic properties name and title.
The client sends:
{
"jsonrpc": "2.0",
"id": 1,
"method": "CreateSessionObject",
"handle": 1,
"params": [
{
"qInfo": {
"qId": "ListObject01",
"qType": "ListObject"
},
"qListObjectDef": {
"qStateName": "$",
"qLibraryId": "",
"qDef": {
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1
}
]
},
"qInitialDataFetch": [
{
"qTop": 0,
"qHeight": 1,
"qLeft": 0,
"qWidth": 1
}
]
},
"name": "ListObject01",
"title": "Title for ListObject01"
}
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 1,
"result": {
"qReturn": {
"qType": "GenericObject",
"qHandle": 2
}
},
"change": [
2
]
}
The list object is created and the handle is 2.
2. Remove the property title.
The client sends:
{
"jsonrpc": "2.0",
"id": 2,
"method": "ApplyPatches",
"handle": 2,
"params": [
[
{
"qPath": "/title",
"qOp": "remove"
}
]
]
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 2,
"result": {},
"change": [
1
]
}
3. Get the properties of the list object.
The client sends:
{
"jsonrpc": "2.0",
"id": 3,
"method": "GetProperties",
"handle": 2,
"params": []
}
The engine returns:
{
"jsonrpc": "2.0",
"id": 3,
"result": {
"qProp": {
"qInfo": {
"qId": "ListObject01",
"qType": "ListObject"
},
"qMetaDef": {},
"qListObjectDef": {
"qStateName": "$",
"qDef": {
"qGrouping": "N",
"qFieldDefs": [
"Country"
],
"qFieldLabels": [
"Country Label"
],
"qSortCriterias": [
{
"qSortByLoadOrder": 1,
"qExpression": {}
}
],
"qNumberPresentations": []
},
"qFrequencyMode": "N",
"qInitialDataFetch": [
{
"qLeft": 0,
"qTop": 0,
"qWidth": 1,
"qHeight": 1
}
],
"qExpressions": []
},
"name": "ListObject01"
}
}
}
The title is removed from the properties.