0

I'm using the $Action.clone as a simple command button on a VisualForce page. This works for my user account and profile as an admin. However other users can create the interim SObject but get the following error when saving it.

Invalid Account Id.


<apex:commandButton value="Clone" 
     action="{!URLFOR($Action.Account_Summary__c.Clone,Id,[retURL=Id],true)}"  
     styleClass="button" style="background:lightblue;color:blue;border-radius:15px;" />

<p>
<b>Account:</b>  &nbsp; 
  <apex:outputField style="font-style:italic;color:blue" 
                    value="{!Account_Summary__c.Account_Name__c}"/>  
  &nbsp; <b>Acct No. </b> 
  <apex:outputField value="{!Account_Summary__c.AccountExt_ID_BA__c}"  /><br></br>
</p> 

After saving the interim sObject the resulting VisualForce page shows the following outPutfields as null:

Account_Summary__c.Account_Name__c is a lookup field related to the Account object. Account_Summary__c.AccountExt_ID_BA__c is a text formuala where the expressions is : Account_Name__r.External_ID_BA__c

I'm stuck on why these fields show properly for me but not any other users not set to my profile.

  • do these other user's profiles have atleast read access to the Account_Summary__c object – Rao Oct 4 '17 at 21:57
  • Yes they do. Actually have create and edit . – rickmac Oct 5 '17 at 2:04
  • What is Id? Are you getting the value from thr controller – Rao Oct 5 '17 at 2:47
  • Is is the parent account object. Even without the controller getting same issue. There has to be something with clone action or URLfor? – rickmac Oct 5 '17 at 2:50
  • Did you try to use a hardcoded value of parebt account object to test your theory of clone being the issue ? – Rao Oct 5 '17 at 3:04

Your Answer

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

Browse other questions tagged or ask your own question.