Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

N°1681 - Add new trigger for attachment creation #534

Open
wants to merge 4 commits into
base: support/3.1
Choose a base branch
from

Conversation

accognet
Copy link
Contributor

@accognet accognet commented Aug 3, 2023

Create a new trigger "on object's attachment creation"

@accognet accognet added the internal Work made by Combodo label Aug 3, 2023
@accognet accognet self-assigned this Aug 3, 2023
Copy link
Member

@Molkobain Molkobain left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Discussed IRL with Anne-Catherine, several things to change:

Point 1
Hacking the standard "Trigger on update" with JS to remove the "Attachment" class from proposed value doesn't seem like a good option.

Instead we would rather improve the \AttributeClass class to add a class_exclusion_list like we do for \AttributeClassAttCodeSet with attribute_definition_exclusion_list. Check with @rquetiez or @eespie , they can guide you.

Point 2
The way it is currently done, you can't limit the trigger to attachments of a specific class only, which is most likely something we'll want to do.

Point 3
Because of the previous points, you can't rely on the ComputeValues method and the fact it derived from the standard TriggerOnObjectUpdate, you'll need to call your trigger when attachments are finalized. We might want to add an event for that actually, check with Eric.

@Molkobain Molkobain changed the title N°1681 - Notification on Attachment creation N°1681 - Add new trigger for attachment creation Aug 22, 2023
@Hipska
Copy link
Contributor

Hipska commented Aug 30, 2023

May I ask why the existing triggers aren’t sufficient?

@accognet
Copy link
Contributor Author

It does but to get an attachment creation notification, we need to create an "on object update" trigger on the attachment with the temp_id field. It's not really logical.

@Molkobain
Copy link
Member

During the technical review, we'll need to discuss the possible impacts of adding the class_exclusion_list property on the existing AttributeClass attribute:

  • Can it be omitted in an AttributeClass instantiation (existing customizations using that type of attribute)
  • Create the corresponding Designer ticket
  • ...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
internal Work made by Combodo
Projects
Status: Pending support PRs review
3 participants