Announcement

Collapse
No announcement yet.

Resolve accounts parentId with the accounts name in JS

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • Resolve accounts parentId with the accounts name in JS

    Hello everybody,

    is there a possibility to resolve "o.parentId" from type "account" to the name of the account?

    We've got this in "\client\modules\crm\src\views\calendar\calendar.j s":

    Code:
    convertToFcEvent: function (o) {
        //alert(JSON.stringify(o));
        
        if (o.parentType == "Account") {        
            var event = {
                [COLOR=#FF0000]title: o.name + " " + o.parentId,[/COLOR]
                scope: o.scope,
                id: o.scope + '-' + o.id,
                recordId: o.id,
                dateStart: o.dateStart,
                dateEnd: o.dateEnd,
                dateStartDate: o.dateStartDate,
                dateEndDate: o.dateEndDate,
                status: o.status
            };                
        } else {
            var event = {
                title: o.name,
                scope: o.scope,
                id: o.scope + '-' + o.id,
                recordId: o.id,
                dateStart: o.dateStart,
                dateEnd: o.dateEnd,
                dateStartDate: o.dateStartDate,
                dateEndDate: o.dateEndDate,
                status: o.status
            };
        }
    }
    but wanna have the accounts name instead of the ID.


    Thanks in advance,

    Daniel

  • #2

    o.parentName is empty?

    Comment


    • #3
      Originally posted by tanya View Post
      o.parentName is empty?
      Yes, it's "undefined". If we stringify "o", there is no parentName, only the parentId which we wish to be resolved:

      Click image for larger version

Name:	stringify.PNG
Views:	164
Size:	16.3 KB
ID:	41530

      Comment


      • #4
        you need to extend queries
        EspoCRM – Open Source CRM Application. Contribute to espocrm/espocrm development by creating an account on GitHub.

        Comment

        Working...
        X