You need to sign in to do that
Don't have an account?
SV M
Display error on VF without Custom Controller
Hi,
I want to display an error message for the user who doesn't have Read Access to Lead Object when he opens a VF Page without using a custom controller. Is it possible to achieve it from VF Page itself...
Thanks in Advance...
I want to display an error message for the user who doesn't have Read Access to Lead Object when he opens a VF Page without using a custom controller. Is it possible to achieve it from VF Page itself...
Thanks in Advance...
We can add 5 different types of message in Visualforce Page. In the example below, we are showing 5 input fields of account. We have added a button on visualforce page. Different type of message will be shown on visualforce page if we will keep any field blank.
Please follow the below link for more info
http://www.sfdcpoint.com/salesforce/show-error-message-visualforce-page/
http://sfdcsrini.blogspot.com/2014/12/show-error-message-in-visualforce-page.html
Try the below code.
Apex:-
if (fieldname == null)
{
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter value'));
return null;
}
Insert the below tag inside the visualforce page within page block
<apex:pageMessages ></apex:pageMessages>
You have to make some changes based on your scnerio.
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
All Answers
If it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
We can add 5 different types of message in Visualforce Page. In the example below, we are showing 5 input fields of account. We have added a button on visualforce page. Different type of message will be shown on visualforce page if we will keep any field blank.
Please follow the below link for more info
http://www.sfdcpoint.com/salesforce/show-error-message-visualforce-page/
http://sfdcsrini.blogspot.com/2014/12/show-error-message-in-visualforce-page.html
Try the below code.
Apex:-
if (fieldname == null)
{
ApexPages.addmessage(new ApexPages.message(ApexPages.severity.WARNING,'Please enter value'));
return null;
}
Insert the below tag inside the visualforce page within page block
<apex:pageMessages ></apex:pageMessages>
You have to make some changes based on your scnerio.
Let me know if it helps you and close your query by marking it as solved so that it can help others in the future.
Thanks.
//Controller //Page
I am getting error for every user. How to solve this....