Hello everyone,
I am currently trying to implement a new custom package for our company. In this package, we would like to add a new field “calendar” for Organizations, that would target to the calendar object.
So I added the below code:
ObjectManager::Attribute.add(
object: 'Organization',
name: 'calendar',
display: 'Open hours calendar',
data_type: 'select',
data_option: {
relation: 'Calendar',
relation_condition: { access: 'full' },
customsort: 'on',
default: '',
belongs_to: 'calendar',
note: 'Choose here what open hours calendar should be applied for this company.',
# nulloption: true,
# multiple: false,
null: true,
translate: true,
},
editable: true,
active: true,
screens: {
view: {
'ticket.customer' => {
shown: false
},
'ticket.agent' => {
shown: true
},
'admin.organization' => {
shown: true
},
},
create: {
'ticket.agent' => {
shown: true,
required: false
},
'admin.organization' => {
shown: true,
required: false
}
},
edit: {
'ticket.agent' => {
shown: true,
required: false
},
'admin.organization' => {
shown: true,
required: false
}
}
},
to_create: false,
to_migrate: false,
to_delete: false,
position: 1425,
created_by_id: 1,
updated_by_id: 1
)
It seems to be working correctly: the field actually appears in the formular with a drop-down list corresponding to the calendar list.
However, we cannot save the Organization form anymore: when clicking on the “send” button, nothing happens.
To try and find out the origin of this error, I had a look at the Firefox console, and I got the following message:
App.i(error) |
Object { _core_workflow: {…} }
application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:23:21182
_log http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:23
log http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:23
log http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:23
onSubmit http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:29
submit http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:28
t http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:28
s http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:9
dispatch http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:2
handle http://172.19.0.10:8080/assets/application-6d0d7e19c7a28b742274f927c2a4d0648cd49d7adb1bfdb49fb4b4e3e02ebb99.js:2
I am unsure on how I can get out of this and make the formular save correctly. Is there anything I missed in the addition of this attribute?
Any help to debug this would be greatly appreciated.
Thank you all.