Created Custom Entity called "Own employed" and like connect for portalUser Creation

Collapse
X
 
  • Time
  • Show
Clear All
new posts

  • Kharg
    replied
    I think it's because the view you defined doesn't exist.

    crm:views/eigenemitarbeiter/modals/select-for-portal-user'

    That's why it would have been better to recreate them and then ovverride in the json.

    Read about custom views in the docs please https://docs.espocrm.com/development/custom-views/

    If I have the time I'll try to make a proof of concept on how to do it if you can't make it work.

    Leave a comment:


  • biocronic
    replied
    Hi. I tried what you explained in the first place with the .js files. The only result is that I see this error message: 404 not found

    You suggested cloning, but because we want to display only the "EigeneMitarbeiter" instead of the normal Contact List I changed the code.

    I am also curious about the double defining or overwrting the variable "viewName";

    I think these lines are a development thing and in fact we only need the second line.


    var viewName = this.getMetadata().get('clientDefs.EigeneMitarbeit er.modalViews.select') || 'views/modals/select-records';

    var viewName = 'crm:views/eigenemitarbeiter/modals/select-for-portal-user';​



    So Everywhere there was Contact or contact I changed to EigeneMitarbeiter and eigeneMitarbeiter. Please be beware of the little and big characters in writing here.

    This is the Code for list.js:

    define('views/portal-user/list', 'views/list', function (Dep) {

    return Dep.extend({

    defaultOrderBy: 'createdAt',

    defaultOrder: 'desc',

    setup: function () {
    Dep.prototype.setup.call(this);
    },

    actionCreate: function () {
    var viewName = this.getMetadata().get('clientDefs.EigeneMitarbeit er.modalViews.select') || 'views/modals/select-records';

    var viewName = 'crm:views/eigenemitarbeiter/modals/select-for-portal-user';

    this.createView('modal', viewName, {
    scope: 'EigeneMitarbeiter',
    primaryFilterName: 'notPortalUsers',
    createButton: false,
    mandatorySelectAttributeList: [
    'salutationName',
    'firstName',
    'lastName',
    'accountName',
    'accountId',
    'emailAddress',
    'emailAddressData',
    'phoneNumber',
    'phoneNumberData'
    ]
    }, function (view) {
    view.render();

    this.listenToOnce(view, 'select', function (model) {
    var attributes = {};

    attributes.contactId = model.id;
    attributes.contactName = model.get('name');

    if (model.get('accountId')) {
    var names = {};
    names[model.get('accountId')] = model.get('accountName');

    attributes.accountsIds = [model.get('accountId')];
    attributes.accountsNames = names;
    }

    attributes.firstName = model.get('firstName');
    attributes.lastName = model.get('lastName');
    attributes.salutationName = model.get('salutationName');

    attributes.emailAddress = model.get('emailAddress');
    attributes.emailAddressData = model.get('emailAddressData');

    attributes.phoneNumber = model.get('phoneNumber');
    attributes.phoneNumberData = model.get('phoneNumberData');

    attributes.userName = attributes.emailAddress;

    attributes.type = 'portal';

    var router = this.getRouter();

    var url = '#' + this.scope + '/create';

    router.dispatch(this.scope, 'create', {
    attributes: attributes
    });
    router.navigate(url, {trigger: false});
    }, this);

    this.listenToOnce(view, 'skip', function (model) {
    var attributes = {
    type: 'portal'
    };

    var router = this.getRouter();
    var url = '#' + this.scope + '/create';
    router.dispatch(this.scope, 'create', {
    attributes: attributes
    });
    router.navigate(url, {trigger: false});
    }, this);
    }, this);
    }

    });
    });​

    The other file I changed the path like that:

    define('crm:views/eigenemitarbeiter/modals/select-for-portal-user', ['views/modals/select-records'], function (Dep) {

    return Dep.extend({

    setup: function () {
    Dep.prototype.setup.call(this);

    this.buttonList.unshift({
    name: 'skip',
    text: this.translate('Weiter mit Mitarbeiter', 'labels', 'User')
    });
    },

    actionSkip: function () {
    this.trigger('skip');
    this.remove();
    },
    });
    });​

    But I only get error "404 not found". What does this error mean? Is it possible that this error occurs because of missing values like:
    'salutationName',
    'firstName',
    'lastName',
    'accountName',
    'accountId',
    'emailAddress',
    'emailAddressData',
    'phoneNumber',
    'phoneNumberData'​ etc. so in the Peron Template we used there are none of these fields called like that.
    So if this is the problem, we can delete the entity an make a new one with the right fields.

    We are looking forward your answer. Thank you very much.
    Attached Files

    Leave a comment:


  • esforim
    replied
    Welcome Mr Coder! Always good to have people with these skill set. This thread might be relevant for you to create Custom Portal:

    Custom Portal Setup (multiple-portal) - https://forum.espocrm.com/forum/gene...up-help-apache

    Taken from: https://github.com/o-data/EspoCRM-Le...nd-Design/wiki

    Leave a comment:


  • Kharg
    replied
    Let me know if you need any help!

    Leave a comment:


  • biocronic
    replied
    Thanks for the quick response. We will try and let you know if we succeeded.

    Leave a comment:


  • Kharg
    replied
    Hi,

    You can create a custom portal-user list view, just clone this view https://github.com/espocrm/espocrm/b...l-user/list.js and change it with your entity.
    also this https://github.com/espocrm/espocrm/b...portal-user.js

    then in your custom folder define a custom list view for PortalUser.json https://github.com/espocrm/espocrm/b...ortalUser.json

    I think that it could work like this, needs more investigation.

    Leave a comment:


  • Created Custom Entity called "Own employed" and like connect for portalUser Creation

    Dear Team,
    Please don't reprimand me, I posted this question in the German-speaking area first, but I think I might get more response here.

    I created a custom entity called like "own-employed" (in german: "Eigene Mitarbeiter - eigeneMitarbeiter") as Person with the Person Template.

    After that we filled the employee data. Then we created a portal for the employees and started to create portal users.

    At this point we realized that only the people who are listed in contacts are displayed when creating a portal user.

    So we started and tried to connect them with relations. But there was no success yet.

    We also tried some .json example coding but without any effect.

    We also have read these:
    Hi, i wanna ask something related to entity management and user portal. So.. my custom entity is not shown on the user portal management, can I add my custom


    Please help solve an important problem using the Workflow or other formula. Condition: The client first registers on the third-party Terminal service and is assigned terminalAccountID (int) there. Then this value is passed to ESPOCRM in the terminalAccountID (integer) field of the "Contact", with all other data for


    I'm evaluating the best way to support job applicants in EspoCRM using portals / portal users. Is it correct that portal users are bound to Contacts? Since


    Note: It's possible to create custom entity through Admin UI. This article is outdated. I'm going to show you how to create new entities in EspoCRM manually. We will make new simple module called PM (Project Management) with Projects and Tasks entities.


    Maybe something simple is missing that I do not see right now.

    We will be happy, if you have a solution for this case. I am also good in PHP and WebCoding. So any programming advice should be easily realized.
    Thank you for your time.
Working...