You need to sign in to do that
Don't have an account?
NinjaValidationException while inserting CollaborationGroup
Hi,
I have a strange issue with creating chatter group with my Apex code.
Simple code for creating CollaborationGroup works fine in development environment, but raises NinjaValidationException when installing uploaded package.
I didn't find any documentation about this exception and neither any information about what is wrong with the code.
Code:
CollaborationGroup grpRec = new CollaborationGroup();
grpRec.Name = 'New';
grpRec.CollaborationType = 'Public';
insert grpRec;
This code fails in insert statement
Exception log:
Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, com.ninja.common.exception.NinjaValidationException: workspaceId - This field is required: []
As you can see, it says that some field is required, but instead of required field names there is an empty list.
Can anybody advice what is wrong here, or is there any workaround for the issue?
Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, com.ninja.common.exception.NinjaValidationException: workspaceId - This field is required: []
Hi, at first glance it seems that you have to assign a workspaceId when you are creating a new CollaborationGroup.
try createing a workspace then put the id int code before inserting.
Code:
CollaborationGroup grpRec = new CollaborationGroup();
grpRec.workspaceId ='your newly created worspace id' ;
grpRec.Name = 'New';
grpRec.CollaborationType = 'Public';
insert grpRec;
As per http://www.salesforce.com/us/developer/docs/api/Content/sforce_api_objects_collaborationgroup.htm CollaborationGroup object doesn't have property workspaceId. I don't see a way to create workspace and add its ID to CollaborationGroup .
Hi,
I am curious if you found a solution to this issue.
I am seeing the same error when trying to create a CollaborationGroup. In my case it occurs when the group is being created from within a packaged class.
Thanks.
hi, I run into the same problem when my test methods are executed before installing a managed release package with namespace.
did you found any solutions on this?
Unfortunately no, sorry
Seen similar issue. Related to content not been enabled in the org where issue occurs.