• snodskov_secunia
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
We are using Communities and have a Trigger in place preventing Users with certain Profiles from deleting specific records (in this case a Question record).

The Trigger uses "addError" to prevent a record from being deleted. So, in short, the code validates if the User trying to delete the Question has a Profile that allows this or not. If not, the record is marked using addError along with an error message.

This works perfectly for our internal users but when a Community User tries to delete a Question they get this error message instead of the more userfriendly one:

"An internal server error has occurred
Error ID: 201458473-277641 (853642360)"

My question is this: Do we need to do something special in order to display the userfriendly error message defined when calling addError?

Does it have to do with the latest release of Communities? We found that displaying validation errors also was a bit tricky with the latest release.

Thanks.

/Søren Nødskov Hansen

Hi,

 

I would like to know if anyone has any experience in building an approval process where the approvers are picked by the user before submitting the record for approval?

 

Basically, our use-case is as follows:

 

  1. We want to have a reference to multiple User objects (e.g. multi-select, multiple lookups - just assume this has been handled)
  2. Before submitting a record, the user picks one or several users as approvers
  3. When submitting the record, an approval process should be initiated
  4. Whenever an approver approves a record, it should go on to the next approver selected in the user list in step 1

I'm not sure if we can use the native approval process at all or if we are forced to basically code the whole flow ourselves?

 

Is it even possible to create approval processes in Apex? Can one intercept approval processes build by the native functionality and basically override who the next approver should be based on a set of criteria in the code?

 

I've found, and read, some topics on the boards but none of them seem to cover what we would like to achieve. Basically, we're looking for an extremely flexible solution where the submitter of the record decides the list of approvers.

 

I'm looking forward to some great input you guys.

 

Kind regards,

Søren Nødskov Hansen

We are using Communities and have a Trigger in place preventing Users with certain Profiles from deleting specific records (in this case a Question record).

The Trigger uses "addError" to prevent a record from being deleted. So, in short, the code validates if the User trying to delete the Question has a Profile that allows this or not. If not, the record is marked using addError along with an error message.

This works perfectly for our internal users but when a Community User tries to delete a Question they get this error message instead of the more userfriendly one:

"An internal server error has occurred
Error ID: 201458473-277641 (853642360)"

My question is this: Do we need to do something special in order to display the userfriendly error message defined when calling addError?

Does it have to do with the latest release of Communities? We found that displaying validation errors also was a bit tricky with the latest release.

Thanks.

/Søren Nødskov Hansen

Has anyone done dynamic approval routing based on a custom field on a record instead of using the User's approver?