Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7986097
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 4, 20262026-06-04T11:45:06+00:00 2026-06-04T11:45:06+00:00

As my Apex code show in below, when once user execute ‘saveSearchItems’ action with

  • 0

As my Apex code show in below,

when once user execute ‘saveSearchItems’ action with ‘apex:commandButton’,
if result of the validation got ‘false’,
I want to show confirmation dialog box to user message with ‘Validation failed, do you want to continue?’.

When user press ‘OK’ button I want to save the items (by executing saveSearchItems method) and if user press ‘NO’ I want to stop the saving (do nothing).

Can anyone please tell me how I can achieve this with Apex & Visualforce.
Thanks a lot.

 /**
  * Save list of SearchItems 
  */
 public void saveSearchItems()  { 

    // Validate values of SearchItems 
       Boolean validateResult = validateSearchItems(this.searchItemList);

    // Save SearchItems   
       saveSearchItems(this.searchItemList);         
 }
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-04T11:45:08+00:00Added an answer on June 4, 2026 at 11:45 am

    Apex code executes at server, not at client so showing dialog boxes cannot happen from Apex. For that reason you will either have to move the validation to the client (using javascript onclick handler) or you will have to split the saving process in two Ajax calls to server, one to validate the other to save and then use the intermediary validation result to optionally show dialog box. The choice depends on the complexity of the validation (validateSearchItems)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

How to remove special characters from a string in apex. Code: selectedStatus = ApexPages.currentPage().getParameters().get('ideaStatus');
i have a VF page code <apex:pageBlockSection collapsible=false columns=2 > <apex:inputField value={!Opp.field1__c}/> <apex:inputField value={!Opp.field2__c}/>
Is there any way to integrate version control system for Apex & Visualforce code?
We've been given a C++ code base that was apparently developed using Rational Apex
This is an APEX code related question and is specific to a VisualForce controller
I'm looking into the feasibility of writing a code formatting tool for the Apex
When i'm calling this code in the link of a chart in apex javascript:window.open('http://google.pt','mywindow','width=400,height=200',
I'm trying to replicate the code found in: http://asktom.oracle.com/pls/apex/f?p=100:11:0::::P11_QUESTION_ID:59412348055 I did a copy and
I need to convert this java code in force.com apex. i tried to use
In Oracle APEX, is it possible to create a validation so that field B

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.