Bajinder Singh

Unable to render field Sugar 7.8.*

Discussion created by Bajinder Singh on Jul 18, 2017

I am new to sugar development. I am stuck in below scenario.

Problem : - I have created a quick comment popup. With this popup user change assigned user and provide comment in record view. This popup get triggered on custom button click (which is there to trigger some workflow manually) and user can also provide some comments for the next assigned user(see attached photo). The popup is getting rendered on two different modules(component and uniform). Uniform have some custom assigned user field. Works properly first time, but when I visit the popup 2nd time on component page after visiting the  popup on uniform item page. It give me error message as shown in attached photo, but popup loads properly. I get that this is because Component module doesn't have this field. I believe there is some caching getting done for the popup and error appear when loading from cache. But this question is how to completely re-render the popup every time or any other way around. I have provided separate definitions in $viewdefs for both the views separately to render the assigned field accordingly.

 

I am disposing the component properly also.

$viewdefs['unfrm_Items']['base']['view']['quick-comment-box'] = array(
    'panels' => array(
        array(
            'fields' => array(
                0 =>
                array(
                    'name' => 'style_assigned_to_c',
                    'link' => true,
                    'default' => true,
                    'enabled' => true,
                    'width' => 15,
                    'type' => 'relate',
                    'label' => 'LBL_ASSIGNED_TO',
                    'id' => 'style_assigned_to_c',
                )

$viewdefs['item_components']['base']['view']['quick-comment-box'] = array(
    'panels' => array(
        array(
            'fields' => array(
                0 =>
                    array(
                        'name' => 'assigned_user_name',
                        'link' => true,
                        'default' => true,
                        'enabled' => true,
                        'width' => 15,
                        'type' => 'relate',
                        'label' => 'LBL_ASSIGNED_TO',
                        'id' => 'assigned_user_id'
                    )

 

 

Any help would be appreciated.. Thanks

Outcomes