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 7854319
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:01:28+00:00 2026-06-02T20:01:28+00:00

if((!submittedBy( ‘button1’ )) && (!submittedBy( ‘button2’ ) { return true; } else { var

  • 0
if((!submittedBy( 'button1' )) && (!submittedBy( 'button2' ) 
{
    return true;
}
else
{
    var IsL2UserTxt = sessionScope.get("IsL2User");

    if(IsL2UserTxt == "Yes")
    {
        //Bring the issue Date&Time
        var start = getComponent("label_IssueDateDt").getValue();

        //Bring the Permenent Fix Target Date&Time 
        var end = this.getSubmittedValue();
        var dStart:NotesDateTime = session.createDateTime(start);
        var dEnd:NotesDateTime = session.createDateTime(end);

        if (!start)
        {
             return false;
        }
        else if (!end) 
        {
            return false;
        }
        else
        {
             print("Start: "+start+", End: "+end+",DStart: "+dStart+", DEnd: "+dEnd+", Time Diff: "+dEnd.timeDifference(dStart));
             return (dEnd.timeDifference(dStart) > 0 )
        }
    }
    else
    {
        return true;
    } 
}

I have two Date Timestamp editboxes in my xpage, I written a validateExpression code as shown above on my second datetime stamp(Permenent Fix tartget Date&Time) editbox. Here validation is required such a way that permaenent fix Target date&Time should be greater that Issue date&time( dEnd.timeDifference(dStart) > 0 ).

*The above code works in scenario such that, if issue date is 24/04/2012 11:16:51 AM and permaenent fix Target date&Time 23/04/2012 11:16:51 AM . But it fails if my permaenent fix Target date&Time is between 05/04/2012 to 12/04/2012. I think there is problem with date time formats as the submitted value of the permaenent fix Target date is coming like this e.g 2012-04-12T11:16:45+05:30.*

So is there any solution to format date time value of the submitted value to avoide above issue.

One more thing about the order of evaluation of validation in xpages.. As validation error message control showing messages randomly not in proper order.

Looking for your positive responses.

Regards,
Yogesh

  • 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-02T20:01:30+00:00Added an answer on June 2, 2026 at 8:01 pm
    var doValidate = (submittedBy( 'button1' ) || submittedBy( 'button2' )) &&   (sessionScope.get("IsL2User") == "Yes");
    if (!doValidate) return true;
    var dtIssue = getComponent("label_IssueDateDt").getSubmittedValue();
    var dtPermFix =  this.getSubmittedValue();
    if ( (dtIssue == null) || (dtPermFix == null) ) return false;
    var difference = I18n.parseDateXMI(dtPermFix) - I18n.parseDateXMI(dtIssue);
    return difference > 0;
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I submitted a form via jquery, but I need the ActionResult to return true
In the HTML below, I would like to copy the submittedby beside message, within
In a .NET web site I need to get code submitted by users, compile
I've got a simple .NET web service that is supposed to return a string
I am attempting to query a LDAP server to return a Directory Entry based
I am building a Zend Framework application that performs jobs submitted by the user.
I'm trying to resize an image in Silverlight 3 that has been submitted by
I submitted 5 jobs to an ExecutorCompletionService , but it seems like the jobs
I submitted an iPhone application to the app store, but it is failed to
I submitted my application to apple for review.Apple rejected and gave me the following

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.