Ok, after the nice post from @pop i have also created a sample for Struct. I had a little bit time before holliday π
There are two schemas (very basic in the example):
person.struct.json
{
"structversion": "2020-06-30",
"schema": "person",
"id": "14",
"user": "admin",
"config": {
"allowed editors": "",
"label": {
"en": ""
}
},
"columns": [
{
"colref": 1,
"ismulti": false,
"isenabled": true,
"sort": 10,
"label": "code",
"class": "Text",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"prefix": "",
"postfix": "",
"label": {
"en": "ID"
},
"hint": {
"en": ""
}
}
},
{
"colref": 2,
"ismulti": false,
"isenabled": true,
"sort": 20,
"label": "first name",
"class": "Text",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"prefix": "",
"postfix": "",
"label": {
"en": "First Name"
},
"hint": {
"en": ""
}
}
},
{
"colref": 3,
"ismulti": false,
"isenabled": true,
"sort": 30,
"label": "last name",
"class": "Text",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"prefix": "",
"postfix": "",
"label": {
"en": "Last Name"
},
"hint": {
"en": ""
}
}
}
]
}
call.struct.json
{
"structversion": "2020-06-30",
"schema": "call",
"id": "17",
"user": "admin",
"config": {
"allowed editors": "",
"label": {
"en": ""
}
},
"columns": [
{
"colref": 1,
"ismulti": false,
"isenabled": true,
"sort": 10,
"label": "person_code",
"class": "Lookup",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"schema": "person",
"field": "code",
"label": {
"en": "ID"
},
"hint": {
"en": ""
}
}
},
{
"colref": 2,
"ismulti": false,
"isenabled": true,
"sort": 20,
"label": "date",
"class": "Date",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"format": "Y\/m\/d",
"prefilltoday": false,
"pastonly": false,
"futureonly": false,
"label": {
"en": "Date"
},
"hint": {
"en": "Date"
}
}
},
{
"colref": 3,
"ismulti": false,
"isenabled": true,
"sort": 30,
"label": "initiales",
"class": "Text",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"prefix": "",
"postfix": "",
"label": {
"en": "Initiales"
},
"hint": {
"en": ""
}
}
},
{
"colref": 4,
"ismulti": false,
"isenabled": true,
"sort": 40,
"label": "report",
"class": "Text",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"prefix": "",
"postfix": "",
"label": {
"en": "Report"
},
"hint": {
"en": ""
}
}
},
{
"colref": 5,
"ismulti": false,
"isenabled": true,
"sort": 50,
"label": "person_name",
"class": "Lookup",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"schema": "person",
"field": "last name",
"label": {
"en": "Name"
},
"hint": {
"en": ""
}
}
},
{
"colref": 6,
"ismulti": false,
"isenabled": true,
"sort": 60,
"label": "person_page",
"class": "Page",
"config": {
"visibility": {
"inpage": true,
"ineditor": true
},
"usetitles": true,
"autocomplete": {
"mininput": 2,
"maxresult": 5,
"namespace": "",
"postfix": ""
},
"label": {
"en": "Customer Page"
},
"hint": {
"en": ""
}
}
}
]
}
Page Overview:
====== Search for Customer ======
----struct table ----
schema: person
cols: %pageid%, code, first name, last name
sort: code
max: 100
dynfilters: 1
csv: 0
----
Page Call History:
====== Call History ======
---- struct table ----
schema: call
cols: *
max: 100
dynfilters: 1
csv: 0
----
And one of the Person Page:
====== Max Mustermann ======
===== New Call =====
<form>
action struct_lookup
struct_field "call.report"
struct_field "call.initiales" "=@USER@"
struct_field "call.date" =%Y-%m-%d
struct_fieldhidden "call.person_code" "=[""@FORMPAGE_ID@"",0]"
struct_fieldhidden "call.person_name" "=[""@FORMPAGE_ID@"",0]"
struct_fieldhidden "call.person_page" "=[""@FORMPAGE_ID@""]"
submit "Save call"
</form>
===== Call History =====
---- struct table ----
schema: call
cols: date, report, initiales
filter : code = $STRUCT.person.code$
csv: 0
----
It is like the description above. Actually, I just wanted to see if it worked. It is not there to disregard the contribution of @pop!
saggi
Edit:
For completeness:
wiki:person:*
is assigned to person
a person.csv
"pid","code","first name","last name"
"wiki:person:00001","00001","Max","Mustermann"
a call.csv
"pid","person_code","date","initiales","report","person_name","person_page"
"","[""wiki:person:00001"",0]","2020-07-15","admin","New Idea","[""wiki:person:00001"",0]","wiki:person:00001"
"","[""wiki:person:00001"",0]","2020-07-15","admin","Second Idea with names","[""wiki:person:00001"",0]","wiki:person:00001"
"","[""wiki:person:00001"",0]","2020-07-15","admin","New Name Test","[""wiki:person:00001"",0]","wiki:person:00001"
"","[""wiki:person:00001"",0]","2020-07-15","admin","Test with Name and Page","[""wiki:person:00001"",0]","wiki:person:00001"
"","[""wiki:person:00001"",0]","2020-07-15","admin","Another Test with Name and page","[""wiki:person:00001"",0]","wiki:person:00001"