You need to sign in to do that
Don't have an account?
Raj R.
How to allow users to modify a field that is not on the page layout?
Hi,
We currently have two buttons on the Contact page layout, Activate and Deactivate. When the Deactivate button is pressed, a custom hidden field, Deactivated__c, is set to TRUE. When the Activate button is pressed, then the custom Deactivated__c field is set to FALSE. Upon clicking of either buttons, the user is redirected to a custom VisualForce (VF) page. Upon successful load of the VF page, the Deactivated__c field is to TRUE when user clicks on Deactivate and Deactivated__c field is set to FALSE when the user clicks on the Deactivate button.
Here is the caviot, regular users cannot see the field because it is not on the page layout. It is essentially a hidden field on the backend that is set.
The problem is that when the field is placed onto the page layouts, the users are able to click both buttons and the flag is set to TRUE and FALSE depending upon action. When the field is removed from the page layout (current situation), the users are not allowed to update that field even though I have provided them appropriate access to the VF page.
I need help if figuring out how I can hide the field and still be able to set the Deactivated__c field to TRUE or FALSE depending upon which button is clicked.
We currently have two buttons on the Contact page layout, Activate and Deactivate. When the Deactivate button is pressed, a custom hidden field, Deactivated__c, is set to TRUE. When the Activate button is pressed, then the custom Deactivated__c field is set to FALSE. Upon clicking of either buttons, the user is redirected to a custom VisualForce (VF) page. Upon successful load of the VF page, the Deactivated__c field is to TRUE when user clicks on Deactivate and Deactivated__c field is set to FALSE when the user clicks on the Deactivate button.
Here is the caviot, regular users cannot see the field because it is not on the page layout. It is essentially a hidden field on the backend that is set.
The problem is that when the field is placed onto the page layouts, the users are able to click both buttons and the flag is set to TRUE and FALSE depending upon action. When the field is removed from the page layout (current situation), the users are not allowed to update that field even though I have provided them appropriate access to the VF page.
I need help if figuring out how I can hide the field and still be able to set the Deactivated__c field to TRUE or FALSE depending upon which button is clicked.
The solution was to add a function on the VF page that does something along the lines of the following below (for simplicity i did not use direct syntax).
<button onclick="activate();>Activate </button>
Contact.activate(){
this.Contact.Deactivated__C = false;
Database.Update(this.Contact);
}
Thanks Aditya for the quick response.
All Answers
The solution was to add a function on the VF page that does something along the lines of the following below (for simplicity i did not use direct syntax).
<button onclick="activate();>Activate </button>
Contact.activate(){
this.Contact.Deactivated__C = false;
Database.Update(this.Contact);
}
Thanks Aditya for the quick response.