You need to sign in to do that
Don't have an account?
Hiteshkumar Chaudhari 2
how to throw error messege after evaluating a condition in apex code
how to throw error messege after evaluating a condition in apex code
i want to throw error before executing an opeartion
if(b1.Amount__c != Decimal.valueof(wamount))
{
// how to throw error msg in a visualforce page
}
i want to throw error before executing an opeartion
if(b1.Amount__c != Decimal.valueof(wamount))
{
// how to throw error msg in a visualforce page
}
here is basic visualforce page and controller code try this as create dummy page and controller output -:
when your component is load you got this error message
let me inform if it helps you
thanks
All Answers
here's my code :
public PageReference withdrawn()
{
BankApplication__c b1 = [Select id,Amount__c from BankApplication__c where BankApplication__c.Name =: wname];
if(b1.Amount__c >= Decimal.valueof(wamount))
{
b1.Amount__c = b1.Amount__c - Decimal.valueof(wamount);
update b1;
}
else
{
b1.addError('error message');
}
here is basic visualforce page and controller code try this as create dummy page and controller output -:
when your component is load you got this error message
let me inform if it helps you
thanks
https://developer.salesforce.com/forums/ForumsMain?id=9060G000000XgwDQAS
Let me inform if you have any issue with it
Thanks