Form saving error after new attribute to organization (with FK)

Hello,

We are having an issue when trying to customize our organization form. We would like to add a link to calendar object, so we 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 appears in the formular with a dropdown list. However, we cannot save it anymore: when clicking on the “send” button, nothing happens.
In the Firefox console however, we get 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

Have we missed some step when adding the new attribute? Any help to debug this would be greatly appreciated.

Thank you all.

Hello,

Just to follow up on this: I got the answer here Package error when adding new attribute, thanks to @rolfschmidt .

All good now :slight_smile:

This topic was automatically closed 7 days after the last reply. New replies are no longer allowed.