locked
Detecting a new relationship in a plugin RRS feed

  • Question

  • Greetings,

    Is it possible to write a plugin that will detect when a relationship exists between 2 custom entities?

    I have custom entities "device" and "install," which have a many-to-many relationship.

    I would like to make edits to either entity once I know they are associated with each other.  I thought about writing a triggre in SQL as I can see when the relationship exists there, but it is my understanding a plugin would be a better option.

    Any guidance is appreciated - I'm just digging into plugins and am a newbie.

    Thanks!
    gg

    Thursday, October 8, 2009 3:03 PM

Answers

All replies

  • Hi.

    This can be done by plugin. Check this url .
    Truth is opened the prepared mind My blog - http://a33ik.blogspot.com
    • Marked as answer by geeky girly Friday, October 9, 2009 4:22 PM
    Thursday, October 8, 2009 7:12 PM
    Moderator
  • What is the purpose of the plugin, when does it have to run? on what does it have to run? Is it running on the entity itself or a record of that entity? etc. etc.

    If its something that just needs to check on a relationship when you open up a record or save it then you can get a list of relationships that a entity has with the Metadata service.

    But if it is something that needs to be grabbed during the relationship itself being created then that is another thing.
    Friday, October 9, 2009 12:43 AM
  • My thought is that it needs to run when the entities are associated/disassociated.  I will think about if there is another way to achieve the same goal.

    Friday, October 9, 2009 3:57 PM
  • This looks great - I'll give it a go and post back my results.
    Friday, October 9, 2009 3:57 PM
  • This worked to add associate and disassociate to the plugin registration tool.  Now I just have to give it a go and see if it works for our needs.  Thanks!
    Friday, October 9, 2009 4:23 PM