Announcement

Collapse
No announcement yet.

Parse imprint to create account or contact

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

  • Parse imprint to create account or contact

    Hello,
    when creating an account or a contact, I find it tedious to populate each field manually.
    In my previous CRM I simply used to click "Create Account from Clipboard" and the system would attempt to parse the free text into the respective field.
    This works especially well when copying the imprint text from a website.

    Cheers,
    Phil

  • #2
    Which CRM you used before ?

    I think you ca build such feature using this

    Rabii
    Web Dev

    Comment


    • #3
      Thanks Rabii,
      I will investigate what the ModelDefaultsPreparator does.
      We used to use Cobra CRM but I prefer EspoCRM

      Comment


      • #4
        Hi Rabii,
        do you know if this is this how the ModelDefaultsPreparator is to be used?

        ../clientDef/Account.json
        Code:
        "modelDefaultsPreparator": "create-from-clipboard-module:defaults-preparator",
        ../src/defaults-preparator.js
        Code:
        define('create-from-clipboard-module:create-from-clipboard-handler', ['handlers/model/defaults-preparator'], (Dep) => {
          return class extends Dep {
            prepare(model) {
              model.name = "Company Name.. Will be fetched from Clipboard";
              return Promise.resolve(model);
            }
          };
        });​

        Comment


        • #5
          Hey,

          You can access model attributes as model.attributes.attribueName and promise needs to resolve the attributes see the class here



          This is how it could be used
          PHP Code:
          define('create-from-clipboard-module:create-from-clipboard-handler', ['handlers/model/defaults-preparator'], function (DefaultsPreparator) {

              return 
          DefaultsPreparator.extend({
                
                
          prepare: function(model) {
                    const 
          name model.attributes.name;
                    
          name "Company Name.. Will be fetched from Clipboard";
                    
                    const 
          attributes = {};

                    
                    
          attributes.name name;
                    
                    return 
          Promise.resolve(attributes);
                }
                
              });
          });
          ​ 

          I hope this helps
          Rabii
          Web Dev

          Comment

          Working...
          X