function readOnly(count){ }
Starting November 20, the site will be set to read-only. On December 4, 2023,
forum discussions will move to the Trailblazer Community.
+ Start a Discussion
DennoPDennoP 

My VisualForce site won't update CASE using workflow. Why?

I have a custom object (Score__c) that is a child of CASE.  I have workflow that updates a field on CASE when a new score__c record is created for reporting purposes.  

 

I have a visualforce page setup as a site to allow customers to create a score__c record.

 

Problem:

The problem is that the when the workflow is turned on that updates the CASE I get the error "Authorization Required".  

 

I don't get this error when the workflow is switched off and through the online profile I don't seem to be able to amend the CASE access permission to anything other than 'READ' & 'CREATE' (which I think may be the issue).  I have tried 'public without sharing class CaseNPSCardController{}' on the controller without any luck.

 

Any ideas how to work around this??

 

Any help or advice is appretiated.

 

Thanks,

Best Answer chosen by Admin (Salesforce Developers) 
bob_buzzardbob_buzzard

The first thing I'd do is turn on debug logging to see exactly what the problem is.  If the change is being blocked due to the user license, you will get an error message to that effect, and in my experience there's nothing you can to do about this - even firing off asynchronous apex figures out that the transaction originated in the context of a particular user license.

 

The update needs to be triggered by a correctly licensed user - which may mean a scheduled apex job to process all of the changes on a periodic changes, or notifying a licensed user who completes the update.  Neither of which are great solutions.

All Answers

bob_buzzardbob_buzzard

The first thing I'd do is turn on debug logging to see exactly what the problem is.  If the change is being blocked due to the user license, you will get an error message to that effect, and in my experience there's nothing you can to do about this - even firing off asynchronous apex figures out that the transaction originated in the context of a particular user license.

 

The update needs to be triggered by a correctly licensed user - which may mean a scheduled apex job to process all of the changes on a periodic changes, or notifying a licensed user who completes the update.  Neither of which are great solutions.

This was selected as the best answer
DennoPDennoP

Thanks very much.  Not the happy ending I was looking for very helpful.