• Sam D.
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 7
    Replies
I have a controller that queries the CollaborationGroup table to pull Groups (the groups are part of a Community and therefore have a NetworkID).  However when the controller is run by a Site Guest User the query comes up empty, even though the controller is set to "without sharing".  Any idea why this would be, or how to fix/workaround?

Thanks.

  • September 18, 2014
  • Like
  • 1
We are trying to use a Permission Set to grant all necessary permissions for participation in a Community (so it can be used on multiple profiles).  That has worked well overall, but I wasn't able to find a way in the permset to enable access to the Feed, People, or Groups tabs (they don't appear in the Object Settings).  Could only enable them on the profile.  Does anyone know whether it's possible to enable those tabs via a permset?

I can't seem to remove the Topics and Tasks tabs from the Salesforce1 web app (/one/one.app) for a Salesforce Community.  It seems like the tabs selected in Mobile Navigation have no effect on Salesforce1 for Communities.  Rather it just takes the tabs selected in the Manage Communities screen.  However Topics and Tasks appear in the app regardless of them not being present in that list.  Anyone know how Topics and Tasks tabs can be removed or hidden in S1 for Communities?
Strange problem here. I have a trigger that does a simple SOQL query to retrieve an Event by its ID, e.g.:
List<sObject> theRecords = [select Id from Event where id = '00UC000000Pyy6c'];
It usually works with no problems. However when multiple contacts are added to the event and it becomes a shared activity, suddenly the query comes up empty when run in the trigger, even under a sysadmin profile.  Yet the same exact query is successful when run in SoqlXplorer, and when the code is executed using anonymous apex.

Any ideas for what might be going on? Does changing the Event to a shared activity with multiple contacts somehow change its ability to be queried via its ID?  

Thanks.
I'm trying to figure out why we would only intermittently get a MIXED_DML_OPERATION error inside Communities, but not consistently.  The code does update both User and Contact, but it works fine whenever we test it and most users have had no issue.  However we just today got an error from one user that says:

Update failed. First exception on row 0 with id <snip>; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): Contact, original object: User: []

Does anyone understand why this would only happen occasionally rather than consistently?  If that's the restriction it seems like it would happen every time, which is doesn't.

Code follows.  The error happened on "update theC" after having updated the user.

public PageReference saveProfileInfo() {
			saveMsgProfileInfo = null;
			Boolean updated = false;
			if (aboutme != aboutme_previous) {
				System.debug('AboutMe is changed, updating user.');
				u.AboutMe = aboutme;
				try {
			           update u;
			           updated = true;
				} catch (DMLException e) { log_error.logError(e); }				
			}
			if (theC!= null && mystory != mystory_previous) {
				theC.My_Story__c = mystory;
				System.debug('My Story is changed, updating contact.');
				try {
			           update theC;
			           updated = true;
				} catch (DMLException e) { log_error.logError(e); }
			}
			if (updated) {
		                saveMsgProfileInfo = 'Saved.';
			} else {
				saveMsgProfileInfo = 'Nothing saved.';
			}

			return null;
		}


I have a controller that queries the CollaborationGroup table to pull Groups (the groups are part of a Community and therefore have a NetworkID).  However when the controller is run by a Site Guest User the query comes up empty, even though the controller is set to "without sharing".  Any idea why this would be, or how to fix/workaround?

Thanks.

  • September 18, 2014
  • Like
  • 1
We are trying to use a Permission Set to grant all necessary permissions for participation in a Community (so it can be used on multiple profiles).  That has worked well overall, but I wasn't able to find a way in the permset to enable access to the Feed, People, or Groups tabs (they don't appear in the Object Settings).  Could only enable them on the profile.  Does anyone know whether it's possible to enable those tabs via a permset?

I can't seem to remove the Topics and Tasks tabs from the Salesforce1 web app (/one/one.app) for a Salesforce Community.  It seems like the tabs selected in Mobile Navigation have no effect on Salesforce1 for Communities.  Rather it just takes the tabs selected in the Manage Communities screen.  However Topics and Tasks appear in the app regardless of them not being present in that list.  Anyone know how Topics and Tasks tabs can be removed or hidden in S1 for Communities?
Strange problem here. I have a trigger that does a simple SOQL query to retrieve an Event by its ID, e.g.:
List<sObject> theRecords = [select Id from Event where id = '00UC000000Pyy6c'];
It usually works with no problems. However when multiple contacts are added to the event and it becomes a shared activity, suddenly the query comes up empty when run in the trigger, even under a sysadmin profile.  Yet the same exact query is successful when run in SoqlXplorer, and when the code is executed using anonymous apex.

Any ideas for what might be going on? Does changing the Event to a shared activity with multiple contacts somehow change its ability to be queried via its ID?  

Thanks.
I'm trying to figure out why we would only intermittently get a MIXED_DML_OPERATION error inside Communities, but not consistently.  The code does update both User and Contact, but it works fine whenever we test it and most users have had no issue.  However we just today got an error from one user that says:

Update failed. First exception on row 0 with id <snip>; first error: MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa): Contact, original object: User: []

Does anyone understand why this would only happen occasionally rather than consistently?  If that's the restriction it seems like it would happen every time, which is doesn't.

Code follows.  The error happened on "update theC" after having updated the user.

public PageReference saveProfileInfo() {
			saveMsgProfileInfo = null;
			Boolean updated = false;
			if (aboutme != aboutme_previous) {
				System.debug('AboutMe is changed, updating user.');
				u.AboutMe = aboutme;
				try {
			           update u;
			           updated = true;
				} catch (DMLException e) { log_error.logError(e); }				
			}
			if (theC!= null && mystory != mystory_previous) {
				theC.My_Story__c = mystory;
				System.debug('My Story is changed, updating contact.');
				try {
			           update theC;
			           updated = true;
				} catch (DMLException e) { log_error.logError(e); }
			}
			if (updated) {
		                saveMsgProfileInfo = 'Saved.';
			} else {
				saveMsgProfileInfo = 'Nothing saved.';
			}

			return null;
		}