How can create new dashlet

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • wmoghes
    Member
    • Aug 2017
    • 30

    How can create new dashlet

    Hey,

    How can I add dashlet depending on filter for example:
    I have an entity called AccountOpening inside it. we have column called request stage contain ['started', 'closed', 'pending']
    If i add a new dashlet for AccountOpening all account openings will be appears
    So I need to add filter for the dashlet like I will add 3 dashlets each one of them will depend on one of request stage option
    in this case the result should be like this:
    the first dashlet will display all account openings have request stage 'started' and the second one will display all account openings have request stage 'closed' .. etc

    I hope if you can help
    Thanks in Advanced
  • tanya
    Senior Member
    • Jun 2014
    • 4308

    #2
    Hello
    You need to create filters and set it in dashlet defs.
    Use Task as example application/Espo/Modules/Crm/Resources/metadata/dashlets/Task.json

    Comment

    • DevMostafa
      Member
      • Mar 2017
      • 36

      #3
      tanya Yes, I did this
      But now I have know where is the error. It happened when using methods dealing with "Enum|MultiEnum" fields as we using this method to get its options in the old version:

      PHP Code:
      public function getFieldDef($fieldName)
          {
              $fileManager = new Manager();
              $config = new Config($fileManager);
      
              $metadata = new Metadata($fileManager, $config);
              $field = $metadata->get('entityDefs.AccountOpening.fields.' . $fieldName);
              return $field['options'];
          } 
      
      Can you help me how to do this into the newer version

      Comment

      Working...