4

I created one system workflow in CRM 2011 to assign a record to Team on creation of an activity as shown in the below figure.

enter image description here

When workflow triggered, its not assigning record to team, instead its giving an error "Invalid Argument". In error details, error message is, "There should be only one owner party for an activity" as in below figure.

enter image description here

How to fix this issue..? How can we assign a record to Team..?

Charan Raju C R
  • 758
  • 5
  • 21
  • 43
  • Do you still get this error if you change the new owner to a user record? – Greg Owens Jun 07 '12 at 12:18
  • Yes, I'm getting same error even when we change owner to user. – Charan Raju C R Jun 11 '12 at 06:00
  • So to confirm - you have a workflow that runs on create of an `incident` record. The workflow simply tries to assign the record to a new user (or team) but it fails to do so. The workflow logs then reports the aforementioned error? – Greg Owens Jun 11 '12 at 08:14
  • Now its working fine with combination of Custom and System workflows.. – Charan Raju C R Jun 19 '12 at 15:36
  • Did you change anything to get it to work? – Greg Owens Jun 19 '12 at 16:49
  • No, I dint change anything. Retrieving team from record using Custom workflow and assigning record to retrieved team through System Workflow(Process). – Charan Raju C R Jun 20 '12 at 11:56
  • Greg explained it why this error occurs. Similar problem reported here. This is based on code base. http://stackoverflow.com/questions/7173482/crm-2011-assign-new-owner-to-appointment-there-should-be-only-one-owner-part – mydevexperience Sep 05 '12 at 13:58

2 Answers2

1

The solution is a bit more complex, as far as i managed to see. First thing is to execute the following query:

select subject
                , RegardingObjectIdName
                , statecodename
                , owneridname
                , Activitytypecodename
                , CreatedOn
from filteredactivitypointer ap
where not exists(select *
                      from filteredactivityparty ay
                      where ap.activityid=ay.activityid
                       and ay.participationtypemaskname = 'Owner')

This query should yield all activities that do not have an Owner defined as an activity party. After this i took all the subjects and using an Advanced Find query deleted all these activities, that were invalid.

The next thing is to find all activities that have defined more than one Activity Party of type Owner.

select subject
                , RegardingObjectIdName
                , statecodename
                , owneridname
                , Activitytypecodename
                , CreatedOn
from filteredactivitypointer ap
where (select COUNT(1)
                      from filteredactivityparty ay
                      where ap.activityid=ay.activityid
                       and ay.participationtypemaskname = 'Owner') > 1

These should either be corrected with only one Owner(either directly in the database, or by using re-assign).

This thread helped: http://social.microsoft.com/Forums/en-US/6f67ffaa-7162-4030-b2ee-af23af6b4cf5/error-when-assigning-certain-record-in-crm-error-there-should-be-only-one-owner-party-for-an?forum=crm even if it's for CRM 4.0, it worked also on 2011.

GxG
  • 4,491
  • 2
  • 20
  • 18
-1

It may be that while record is getting created, it must have some owner but at the same time WF triggered and it tries to assign this record to someone else as till now record's owner has not been set yet.

So, when there is no owner is set for this reord, how this record can be assigned?

May be this is the problem.

To get rid from this, Make Workflow to wait for 1 minute, then assign record to someone else. This can solve this problem in a very easy way..:)

Thanks,

Anish

Anish
  • 588
  • 6
  • 21
  • This is not a valid resolution, as it does not fix the error. Instead this creates another problem with lag. The problem comes from activities related to the main entity. If the activities are parental with cascade then the assignment tries to add another activity party as owner, instead of replacing the owner. – GxG Mar 13 '14 at 11:29