Quantcast
Channel: CRM Development forum
Viewing all articles
Browse latest Browse all 8223

Changing Team's BU and then assigning role - plugin issues

$
0
0

I am looking for a perfect solution for this:

I have a plugin which moves a team from BU1 to BU2 (using SetParentTeamRequest) and then assigns a role R2 (which is associated with BU2). I get an exception that, team and role belong to different BU. I put a Thread.Sleep(100) between the two operations, and the plugin processed without any exception.

Ok, so it takes some time to move to new BU and there should be some request using which I could check if the team has moved to new BU or not (just like we can check for privileges after assigning role to a team as it also takes some time). But I didn't find anything to check this. Checking for businessunitid in team is of no use as it gets updated right after the processing of SetParentTeamRequest, but then the plugin throws exception if processed with adding the sleep code. I tried to catch the exception and then wait and then try again. But once exception is thrown, no matter how much time I wait, it throws the same exception again on retry.

Has anyone faced this? Anyone has a better approach for this? I just need to change the BU of team and then assign a role to it.

I am on CRM2011-RU11.


- Arvind


Viewing all articles
Browse latest Browse all 8223

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>