Hi there
i have a custom entity called "BusinessOpportunity" with an attribute called "internalName"
Every time that a new "BusinessOpportunity" is created, i'd like to prepare an expected DocumentFolder hierarchy to put their all the document related to this entity BusinessOpportunity.
I have created a hook... with a beforeSave function to force the internalName in uppercase.
now... i need to create the documentFolder structure, afterSave, like that:
Top-level Document Folder = $BusinessOpportunity->internalName
Then, sub-folders (subfolder1, subfolder2)
Ex:
For a BusinessOpportunity row with internalName = "Example 1",
I want to create a DocumentFolder hierarchy to put there my future documents:
Example 1
... -> subfolder1
.... -> subfolder2
Any clues about how to do my afterSave webhook to create this related-entities rows ?
I check an example between Cases and KnowledgeBaseArticles (cf http://forum.espocrm.com/forum/devel...elated-entites)
but i have some issues to make what i want.
Thanks for your help
i have a custom entity called "BusinessOpportunity" with an attribute called "internalName"
Every time that a new "BusinessOpportunity" is created, i'd like to prepare an expected DocumentFolder hierarchy to put their all the document related to this entity BusinessOpportunity.
I have created a hook... with a beforeSave function to force the internalName in uppercase.
PHP Code:
class Base extends \Espo\Core\Hooks\Base
{
// beforeSave | afterSave | beforeRemove | afterRemove
// if ($entity->isNew())
public function beforeSave(Entity $entity)
{
$entity->set('nomInterne', strtoupper($entity->get('nomInterne')));
}
}
Top-level Document Folder = $BusinessOpportunity->internalName
Then, sub-folders (subfolder1, subfolder2)
Ex:
For a BusinessOpportunity row with internalName = "Example 1",
I want to create a DocumentFolder hierarchy to put there my future documents:
Example 1
... -> subfolder1
.... -> subfolder2
Any clues about how to do my afterSave webhook to create this related-entities rows ?
I check an example between Cases and KnowledgeBaseArticles (cf http://forum.espocrm.com/forum/devel...elated-entites)
but i have some issues to make what i want.
Thanks for your help
Comment