You need to sign in to do that
Don't have an account?
Rendering a delete button only when the record meets certain criteria
Hi, I'm trying to make the VF record view page that I created to have a Delete button that deletes the record, but only to render that when the record itself is owned by the user that's trying to delete it AND if a certain field in that record equals "Original".
Not sure how to do either, I've yet to make any VF code that directly uses something within the record itself.
Is this possible? And can anyone point me in the right direction?
Not sure how to do either, I've yet to make any VF code that directly uses something within the record itself.
Is this possible? And can anyone point me in the right direction?
if resolved marked as answer.
All Answers
---------------------------------------------
<apex:commandButton id="deleteBtn"
value="Delete"
action="{!Delete}"
rendered="{!Record.OwnerId = $User.ID
AND Vencorr__c.Inquiry_Status__c= 'Original'}"/>
The above code gives me the following error: Error: Syntax error. Found '$User.ID'
The code below gives me the error: [Error] Error: Unknown property 'Vencorr__cStandardController.RecordId'
<apex:commandButton id="deleteBtn"
value="Delete"
action="{!URLFOR($Action.Vencorr__c.Delete,RecordId)}"
rendered="{!Record.OwnerId = $User.ID
AND Vencorr__c.Inquiry_Status__c= 'Original'}"/>
Am I missing something fairly obvious?
if resolved marked as answer.