AnsweredAssumed Answered

Date search range

Question asked by thong127 on Nov 24, 2016
Latest reply on Nov 28, 2016 by karen_joy

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.

Outcomes