Sugar 7 Contact module record view header add middle name

Hello,

I want to add middle name record view header pane in contact module.

Ramana Raju Santhana Francesca Shiekh Alan Apter

Thanks

Dipesh

Offshore Evolution Pvt Ltd

Parents
  • Picking this up again .
    We have this working in an on prem site on version 8 of enterprise, 
    We are upgrading them to V13.0.2 

    For the most part, the customisaion works in the contacts module as before.... but the name is showing as "undefined Undefined Undefined" in reports

    What could we be missing so the customised full name shows in reports?

    Regards
    Greg

  • Something of a work around resolution.

    The middle name functionality is retained in contacts, and other plasec, but we had an issue where it was showing as undefined when used on reports.

    So we amended the fullname.js file as follows for our on prem Enterprise V13.0.2 system:
    The full name only shows as firstname surname but that is good enough for our purposes

    /*
    * I only want to apply this change to the Contacts modules so put this file in:
    * custom/modules/Contacts/clients/base/fields/fullname/
    */
    ({
    extendsFrom: 'FullnameField',formatMap: {
    'f': 'first_name',
    'l': 'last_name',
    's': 'salutation',
    'm': 'sym_middle_name_c'
    },initialize: function(options) {
    // override the name format for this module
    app.user.setPreference('default_locale_name_format', 's f m l');this._super('initialize', [options]);
    },format: function() {
    	if (this.model.get('last_name')===undefined)
    	{
    		return this.model.attributes["full_name"];
    	}
    	var fullname = this.model.get('salutation') +' '+ this.model.get('first_name') +' ';
    	fullname += this.model.get('sym_middle_name_c') +' '+ this.model.get('last_name');
    	return fullname;
    
    },
    })

Reply
  • Something of a work around resolution.

    The middle name functionality is retained in contacts, and other plasec, but we had an issue where it was showing as undefined when used on reports.

    So we amended the fullname.js file as follows for our on prem Enterprise V13.0.2 system:
    The full name only shows as firstname surname but that is good enough for our purposes

    /*
    * I only want to apply this change to the Contacts modules so put this file in:
    * custom/modules/Contacts/clients/base/fields/fullname/
    */
    ({
    extendsFrom: 'FullnameField',formatMap: {
    'f': 'first_name',
    'l': 'last_name',
    's': 'salutation',
    'm': 'sym_middle_name_c'
    },initialize: function(options) {
    // override the name format for this module
    app.user.setPreference('default_locale_name_format', 's f m l');this._super('initialize', [options]);
    },format: function() {
    	if (this.model.get('last_name')===undefined)
    	{
    		return this.model.attributes["full_name"];
    	}
    	var fullname = this.model.get('salutation') +' '+ this.model.get('first_name') +' ';
    	fullname += this.model.get('sym_middle_name_c') +' '+ this.model.get('last_name');
    	return fullname;
    
    },
    })

Children
No Data