locked
Setting owner on opportunity converted from email RRS feed

  • Question

  • Hi, my client is not happy with CRM default functionality to set the owner of opportunity to the owner of email when converting the email to opportunity. I tried to find a clue which would indicate that opportunity is created from email, but no luck. Then I thought I could register a plugin on opp. create and query for activities with subject equal to opp. name, but it executes before CRM attaches the activity to opp.

    How does CRM connect these 2? Would async plugin be guaranteed to execute after this CRM operation?

    Thanks in advance

    Thursday, June 25, 2015 7:07 AM

Answers

  • I ended up with plugin on pre-create which just checks if owner id of Target input parameter is different from calling user id from execution context. That condition will pass only when converting from activities.
    • Marked as answer by Radevic Friday, June 26, 2015 7:38 AM
    Friday, June 26, 2015 7:38 AM

All replies

  • Hello Radevic,

    How did you register the plugin step? opportunity post-create (async)? if this scenario won't work, try the assign step of the opportunity and implement your logic there.


    Cornel Croitoriu - Senior Software Developer

    If this post answers your question, please click "Mark As Answer" on the post and "Mark as Helpful"

    Biz-Forward.comCroitoriu.NET

    Thursday, June 25, 2015 8:14 AM
  • Hi, I did not try on create async because I don't know how CRM does this assign. Is it also a kind of system plugin or something else? I am not sure if it would always execute after the inner operation.

    I could register the plugin on assign but how would I separate the assign CRM does from normal assign which a user could perform on opportunity?

    Thursday, June 25, 2015 8:19 AM
  • I ended up with plugin on pre-create which just checks if owner id of Target input parameter is different from calling user id from execution context. That condition will pass only when converting from activities.
    • Marked as answer by Radevic Friday, June 26, 2015 7:38 AM
    Friday, June 26, 2015 7:38 AM