AnsweredAssumed Answered

Extending create view gives blank page

Question asked by Usman Saeed on May 29, 2014
Latest reply on May 29, 2014 by Usman Saeed
Hi,
I am extending the create view (new records) of contact.
Business role is this:
If user title is sales than give warning message and redirect user to list view of contacts i.e if user title is sales than he can not create new contact, but he can view the contact.

I am extending the create-actions.js in custom/modules/Contacts/clients/base/views\create-actions/create-actions.js.
and the code there is: 

({extendsFrom:'CreateView',    initialize: function (options) {

            app.view.invokeParent(this, {type: 'view', name: 'create', method: 'initialize', args: [options]});
            var user_id = app.user.id;
            var access_denied_1 = 0;
            user_title === "sales";
          
                     if(user_title === "sales"){
                    access_denied_1 = 1;
                     }
                    if(access_denied_1 === 1){
                      app.alert.show('warning', {level:'warning',title:'Permissions',messages: "Access Denied"});
                       app.router.navigate(app.router.buildRoute('Contacts','',''),{trigger: true});
                   }
                   else {
                     this._parsePanelFields(this.meta.panels);
                   }
                   
            this._super('initialize', [options]);
           }
})

What missing here is, the function for displaying/fetching the form fields....

Can somebody guide, how I can display the form fields as I am getting a blank page no form fields on it.


Thank you,

Usman

Outcomes