Questions tagged [pagemessages]

The tag has no usage guidance.

Filter by
Sorted by
Tagged with
1
vote
1answer
86 views

I want to display an error message on top and bottom of a Visualforce page using Apex. How to do so?

We have used this code previously for showing error, but now we want to show the error on top and on the bottom of the page: ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.ERROR, ...
10
votes
2answers
612 views

How do you clear the ApexPages.getMessages() collection in a test?

The longtime frustration of not being able to clear the messages in tests is marked as a delivered idea in Summer '18 here Add support for clearing PageMessages via Apex. A failing of that forum is ...
1
vote
3answers
126 views

Make fields mandatory when status is complete

I have a status field on contact,when status is complete,remarks should get mandatory..I wrote if condition for this in controller,but it is not taking remarks field as mandatory..how to write this? ...
4
votes
1answer
132 views

Does ApexPages.Messages support multiple message severities?

When running the following method the final debug shows that only the fatal severity messages are included. The other debugs show that it does see the other severities and does at least attempt to add ...
0
votes
1answer
294 views

How to show user a message and stop APEX Class execution

I have a APEX Class that runs from a button on a standard record page. It creates a related record in another table. The code works fine as it is now. But I want to add a feature that does a ...
2
votes
1answer
2k views

how to stop firing oncomplete if save action has errors

My requirement is to stop oncomplete call if save action has errors. I know I am doing some silly mistake. Here I am unable to stop calling oncomplete function. Requirement is, from VFP save method,...
2
votes
2answers
1k views

How to addmessage from a trigger to a visualforce page

I have a visualforce page with a controller extention. This page has some inputfields where I want to send a waring on the page before insert if the fielsd are filled in incorrectly. I am using a ...
0
votes
0answers
100 views

How to remove The Red 'Error' Text and the Exclamation mark from apex page message [duplicate]

I want to remove the red 'Error' text and the exclamation mark from apex page message and want to show only the Message. Please see image below: Providing sample code for reference: Page: <apex:...
1
vote
3answers
455 views

Show same pagemessage multiple times on top of VF page

I have a VF Page with a lot of fields and most of them are mandatory. I am handling the required part via my Apex Controller and not "required=true" attribute as I have used too much Javascript on my ...
1
vote
2answers
209 views

Why am I getting duplicate ApexMessages when concatenating string in a try/catch

I have two different approaches for adding an error to my visualforce page. The first approach I am concatenating a string at the end of exception. The second approach I am simply returning the ...
1
vote
2answers
88 views

pageMessages should ignore Database.insert(records, false) errors

I am creating some records in my controller but some of them might fail during insert due to duplication, so I use Database.insert(records, false). It works just fine and ignores records that already ...
0
votes
1answer
29 views

Visualforce Error Message displaying the save mode instead of displaying the edit mode

I'm facing a simple issue where I'm displaying an validation error message from trigger based on some condition in the visualforce page. Upto this it is working fine. But after displaying the error ...
0
votes
0answers
97 views

Display of a dialog window

I'd like to know how to display a dialog or pop-up window in Salesforce. I'm overriding the standard convert button by using associated custom visualforce page. I use the custom visualfoce page to ...
1
vote
1answer
552 views

Display custom message using Visualforce depending on custom field criteria

I have used the answer to this question on Stack exchange to create a message to display on my custom object. What do I need to add to it to only display the message if a certain condition in my ...
3
votes
1answer
601 views

Overriding Standard error message in VF Page

For a currency field (say 10,2) , Salesforce displays a standard error message below the field as Error: Number is too large. My requirement would be to display an apex page message instead. I ...
2
votes
1answer
178 views

pageMessages not showing when commandButton disabled

I have the following VF page: <apex:page controller="Invoices"> <apex:form > <apex:pageBlock id="pageBlock1"> <apex:pageMessages id="messages" /> <apex:...
0
votes
1answer
3k views

Show page message and reload page

I have a VF page and extensions for it where I perform update operation. If it is successful or not I want to display page message - on VF I have <apex:pageMessages /> and in Apex controller ...
0
votes
1answer
31 views

pagemessages not showing on vfpage when contact lastname not entering

public class contact_fetch_List_method_controller{ public contact consave{get;set;} public contact_fetch_List_method_controller(){ consave = new contact(); } public pageReference Save(){ if(...
2
votes
1answer
1k views

Apex PageMessages are not displayed when using OnComplete JS for CommandButton

I have VF page shown in the service console. When Apex command button is clicked it is invoking controller action method. OnComplete on the command button executes the JS function which refreshes the ...
1
vote
2answers
4k views

Show error message in Visualforce Page

I have a visualforce page with custom controller. I have added apex:pagemessages in a helper static class and for some reason the messages are not displaying on my Visualforce page and I'm not sure if ...
0
votes
2answers
70 views

not showing pageMessages when search box is empty and direct click on the search button

class code public class democlass { public string searchboxstring{get; set;} public list<contact> result {get; set;} public Integer counter{get;set;} public democlass(){ //result = new ...
0
votes
1answer
58 views

How to modify a Visualforce error message

When I update a record from a details page I get the error You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your ...
1
vote
1answer
134 views

Display message

I would like to display message with particular information in Salesforce. I have created a custom field of type rich text and made it read only but it does not allow me to display the message I want....
0
votes
2answers
5k views

Id Value is not valid for standard controller

I am getting the error mentioned in subject with below code when execution runs through Else condition without DML statement. I am not getting how to change Pagereference? Apex Code AllocQ= ...
2
votes
1answer
238 views

Page displays apex scripts while using render=“true” in <apex:page message> visualforce page?reasons?

When I am trying to display page message in vf page I am getting the following issue and that is because of using rendered="true" Page getting displayed with following code: visualforce page code: ...
1
vote
2answers
136 views

Page message Problem?

I have four scenarios with catch exceptions in controller and used "apex:pageMessages" only once in Visualforce page.But that is not working for all the scenarios? Is it mandatory to use "apex:...
2
votes
1answer
742 views

Error Message in Visualforce page

I have a visualforce page which has a apex:pagemessage tag. A method on the controller is checking if a field in the visualforce page is valid. I want to display an error message but I do not want ...
0
votes
1answer
185 views

Apex Page Message

I have a custom page, and it has a field which is inline editable. If the value of the field is changed to null, an apex page message is displayed, the logic of which is written in the controller: ...
0
votes
1answer
3k views

Rerender two visualforce elements after each other?

I have a Visualforce page, with a pageblocktable that is dependent on some date fields. When the dates change I would like to rerender the table, and then rerender the pageMessages. At the moment, ...
0
votes
1answer
2k views

Lightning - how to use apex:pageMessages in a VisualForce page with SLDS

I'm using SLDS library to decorate a VisualForce page and have got some standard validation rules defined at the back, How could I throw the error message to the VF page with using apex:pageMessages? ...
0
votes
1answer
30 views

How to clear the Info message appearing on the Lookup popup window

As we can see in the above image, when user is trying to selecting a lookup record, I have this page message appearing on the lookup window. I am confused on how to debug this. Searched the whole ...
0
votes
1answer
317 views

Display warning message in page

I need to know how to be able to display the following warining message in salesforce page: There is an existing Merchant: corresponding account.Id for this Lead: corresponding objLead.Id_ in ...
0
votes
1answer
403 views

apex page messages are not working in javascript

I want to show apex:pageMessage when validation error occured. In the below code i called save method from the javascript. previusly save method called from action function. after changing code based ...
1
vote
2answers
819 views

Display warning message

I would like to know how to be able to display a warning message in a page. I have created my own custom visual force page: <apex:page standardController="Lead" extensions="...
0
votes
2answers
235 views

Do not rerender a panel when there is an error

Is there a way I could not rerender a certain <apex:outputPanel /> when there is an error in a <apex:pageMessages />? EDIT: I tried, I use two actionFunction. the first one is to ...
0
votes
1answer
770 views

How to give file upload success message in vf page

I want to give a file upload and record insert success message. I am udsing the below apex class. Can anyone help me how to give success message. public with sharing class devoteeinsert{ //...
2
votes
1answer
556 views

Set up an Alert on the “New” opportunity button

Is there any way to set up an alert message when a user clicks the "New" button either on the Opportunity object or on the account related list? I don't think creating a new button will help because ...
2
votes
1answer
138 views

Visualforce Apexpage 'AJAX' like response

I have written a VF Page: <apex:page controller="DocumentObjects"> <apex:form > <apex:pageBlock title="Document objects"> <apex:pageMessages /> <apex:...
1
vote
1answer
4k views

Rerendering apex:pageMessages (when clicking button) causes the message to be not displayed

I had an issue when re-rendering apex:pageMessages when a command button is clicked. If I remove the re-render from the apex:commandButton, the apex:messages is displayed correctly. Here's my ...
2
votes
1answer
722 views

DML Exception and validation rule in Salesforce

Today I had a very unusual experience while working on a VF page. It's a very simple page and controller but the results were quite strange. Actually, I am trying to save an Opportunity and if there ...
0
votes
2answers
3k views

Page Message not show in my VF Page

I just used the below code in my application but the page message not show. What i doing wrong VF Page: <apex:pageMessages id="msgs"/> <apex:pageBlock > <apex:outputpanel id="outid" &...
0
votes
0answers
264 views

DMLException error not coming properly

I am trying to upsert a record and and I am expecting, when I hit the button, then it will check for Invalid Email address, and if there is any then it will show me the error in the pageMessage. ...
7
votes
3answers
9k views

How to test page messages in unit test?

I have an Apex controller which unsubscirbes users from email via an opt-out form. I have written a test class which tests the method (or atleast partially at the moment). I would like to know how I ...
0
votes
1answer
1k views

Display error message from controller fails

I have below apex page where I am trying to catch a custom apexpages.addmessage from the controller. But it is not working , simply not displaying the error message in page. Can someone please help? ...
2
votes
3answers
4k views

How to display different error messages at different places on a Visualforce page

How can I control how error messages from apex show at different places on a page? I`d like to show ErrorA to RegionA if ErroA occured, and ErrorB to RegionB if ErrorB occured. Does anyone have any ...
1
vote
1answer
4k views

Return apex page message to Java script alert popup

I want to show the error message on Javascript alert popup.Is it possible? I have a custom detail button which calls below page and creates a related record.If related record exists then I want to ...
2
votes
1answer
610 views

Output label not conditional

I have a requirement to show page message for a particular selected template. The template selection done here. But render is always returning true in this case. Can someone help me here? <apex:...
2
votes
0answers
28 views

Render based on TemplateId [duplicate]

I have a requirement to show an apex page message "XX YY" if the selected template id to email is "Update Status". (This message needs to be displayed when they make the selection not when they click ...
0
votes
1answer
764 views

Hiding page messages for required fields

I am showing few required fields on my VF page. I am also using apex:pagemessages to show custom error messages. Below is my code <apex:pageblock mode="edit" title="Agreement Address Edit" ...
2
votes
3answers
2k views

Best way Optional warning message on page load

I have to show a message on top of a visual force on load page,if certain conditions are met. I know 2 ways: 1) in the constructor: if (Querycondition){ ApexPages.Message myMsg = new ...