1

I built a visual workflow for a meeting rescheduling process. The flow needs to be handled by anyone, not just the meeting creator. The flow is called from the Event object itself. Note that Share Activities are enabled. The flow steps are:

  1. Check whether the event from which the flow was called is the ParentEvent. If not, find the ParentEvent and work with that ID going forward.
  2. Check for EventInvitees. If they exist, capture their Relation Ids and Statuses and assign them to an sObject Collection variable for later reference.
  3. Cancel the old meeting, deleting any EventInvitees which were on it (removing the old meeting from their calendars and from any resource calendars to which the meeting was assigned).
  4. Collect the date and time for the new meeting from the running user.
  5. Create a new meeting with the appropriate values (mostly copied from the original event)
  6. Add the original EventInvitees to the new meeting. I get this error: Error Occurred: INSERT --- INSERT FAILED --- ERRORS : (INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY) insufficient access rights on cross-reference id: 023A0000000e5go The ID referenced is of one of the "resources" (conference rooms) that I'm trying to add to the meeting.

I tried to find a way to update the object settings for the EventRelation object but to no avail. Anyone else have issues with shared activities and flow? Thanks!

1

This is basically what's happening in the background:

void invite() {
    insert new EventRelation(
        EventId = '00U000000000123',
        RelationId = '00Q000000000123',
        Status = 'New'
    );
}

The Event is owned by some Calendar or Resource with 023 prefix. It will throw the exception even if the "Full Access" share is granted. You could work around it using a Process.Plugin to trash the sharing, eg:

void invite() {
    new InsertEventRelation(insert new EventRelation(
        EventId = eventId,
        RelationId = relationId,
        Status = status
    ));
}

without sharing class InsertEventRelation {
    InsertEventRelation(EventRelation eventRelation) {
        insert eventRelation;
    }
}
| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.