1 2 Previous Next 17 Replies Latest reply on Nov 28, 2016 8:57 AM by karen_joy

    Date search range

    thong127

      Hello All,

       

      I have a script to find  my invoice date order range ; Im getting an error "Start date must be before end date"

       

      The script is below:

       

      Show Custom Dialog ["Specify Date Range" ; "Please enter your Date Range to search." Invoices:: Invoices Order BeginDate ;

      Invoices:: Invoices Order EndDate]

       

      Set Variable [$begin ; Value: Invoices::Invoices Order BeginDate]

      Set Variable [$end ; Value: Invoices:: Invoices Order EndDate]

       

      Set Variable [ $errorMessage ; Value: Case ( not Count ( $begin ; $end ) ; "Please fill in both date fields." ; IsEmpty ( $begin ) ; "Please fill in the start date." ; IsEmpty ( $end ) ; "Please fill in the end date." ; $begin > $end ; "Start date must be before end date." )

      If [ not IsEmpty ( $errorMessage )]

      Show Custom Dialog ["Problem with the search dates" ; $errorMessage]

      Exit Script [Text Result: ]

      End If

      Set Error Capture [On]

      Enter Find Mode [Paused:off]

      Set Field [Invoice::Order Date ; $begin & "..." & $end]

      Perform Find []

      If [not Get ( FoundCount )]

      Show Custom Dialog ["Problem with the search dates" ; $errorMessage]

      End If

       

      Can you please help me with my script.

       

      Thank you.

        1 2 Previous Next