I have a custom module that creates a bunch records. I can create most of the by using BeanFactory::newBean(āModuleā). The issues is when trying to storage a record on email to be presented on the history panel.
Doing some research I found that ArchiveEmail under History panel calls a sugar widget called SubPanelTopArchiveEmailButton.
Code for this button can be found under include\generic\SugarWidgets\SugarWidgetSubPanelTopArchiveEmailButton.php.
My question is how to achieve the same result from a logic hook.
Sorry, I donāt quite understand. This email you want to appear on the āActivitiesā panel already exists in SuiteCRM? Is it already imported?
Maybe you just need to link it, create the relationship, not create the email, thatās why I am asking.
Also, please be more detailed: which version of SuiteCRM is this, which Module you want it to appear in, which logic hook youāre trying to use. Just so I can get a clearer picture.
Iām using version 7.10.10. As you know, there are ACTIVITIES and HISTORY sub-panels under accounts. From the ACTIVITIES sub-panel you can āComposeEmailā. A pop-up window comes up (three as there is a bug on this version) and you can create and send your email. It will automatically be logged to the next sub-panel called āHISTORYā.
Now from HISTORY sub-panel, you can āArvhiveEmailā. When doing this, a new window comes up with three fields only: Assigned to, Related to and Category. When saved, it is logged to the HISTORY sub-panel. This is the same function I want to achieve from my custom module.
I donāt know how to call the BeanFactory::newBean to create the record.
Today Iāll try to do direct insert into the DB. Any suggestion is welcome.
If you can share your code here, it might help someone else in the future. Make sure you put it inside the Forumās ācodeā tags, otherwise parts of it will be stripped out.