Announcement

Collapse
No announcement yet.

Prefilling fields in Meeting

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

  • Prefilling fields in Meeting

    Hi,

    I want to prefill some text fields from related Account when creating new Meeting and the prefilled values be visible to the user.

    I found a way to accomplish this by adding some lines to client\modules\crm\src\views\record\panels\activit ies.js after line 292

    However I guess this is "wrong" way to do it because it might be overwritten. What would be the optimal way?

    In my setup the values don't need to be dynamic/linked, just copy plain text from Account to the Meeting.

  • #2
    No need to hack core files.

    You can use the formula-function in Admin->Entitetsmanager->Meetings (see screendump)

    Read formula dokumentation here

    Click image for larger version

Name:	screendump.png
Views:	241
Size:	47.2 KB
ID:	39226

    Comment


    • #3
      You can override field view and in every creating place the value will be related on selected value, like contacts field in opportunity relates on account https://github.com/espocrm/espocrm/b...ontacts.js#L46

      You can override the panel view for Account activities sublanel


      Comment


      • #4
        Thank you both for your help

        dafnie: Correct me if I'm wrong, but I understood that custom formula is being run after user has submitted the form and not before as this setup would need?

        tanya: I tried the adding custom view and added getCreateAttributes function, but it seems it is not called. I tried simple command console.log("hello world"). Now I am wondering if it works only with field type link-multiple-with-role and not with simple varchar ?

        Edit: Ok I was editing entityDefs and not clientDefs, I'll try again.

        Edit2: I added custom\Espo\Custom\Resources\metadata\clientDefs\A ccount.json and client\custom\src\views\account\record\panels\hist ory.js but when in history.js I have first row:

        Espo.define('custom:views/account/record/panels/history', 'views/record/panels/history', function (Dep) {

        it can't find the original history.js ( I guess because it is not looking from the modules folder )
        Last edited by giant; 06-20-2018, 04:54 PM.

        Comment


        • #5
          Now it works, thank you. I was missing crm: in front of second parameter

          Espo.define('custom:views/account/record/panels/history', 'crm:views/record/panels/history', function (Dep) {

          Comment

          Working...
          X