Oyseka Posted 16 hours ago Posted 16 hours ago Hi all. I am trying to find records in a date range and exclude certain records from that find. I am unable to get the desired result from the following script steps, could anyone point me in the right direction please. I am trying to find all records in the date range that have a value in the BankExpenditure and PettyCash field while excluding records that have a Type description of Transfer Receipt and where the Description_BankData field contains CostFranch as part of the description # TEST - COST / EXPENSES FOR DATE RANGE Go to Layout [ “Costs” (Costs) ; Animation: None ] Enter Find Mode [ Pause: Off ] Set Field [ Costs::DateStatement ; $DateReportStart & "..." & $DateReportEnd ] Set Field [ Costs::Amount_BankExpenditure ; ">0" ] New Record/Request Set Field [ Costs::DateStatement ; $DateReportStart & "..." & $DateReportEnd ] Set Field [ Costs::Amount_PettyCash ; ">0" ] Perform Find [] Constrain Found Set [] Set Field [ Costs::DateStatement ; $DateReportStart & "..." & $DateReportEnd ] Set Field [ Costs::Type ; "≠" & "Transfer Receipt" ] Constrain Found Set [] Set Field [ Costs::DateStatement ; $DateReportStart & "..." & $DateReportEnd ] Set Field [ Costs::Description_BankData ; "≠" & "*Costfranch*" ] Sort Records [ Restore ; With dialog: Off ] # Set Variable [ $Path ; Value: Get (TemporaryPath) & "Expenses" & ".xlsx" ] Export Records [ With dialog: Off ; Create folders: Off ; “$Path” ; Unicode (UTF-16) ] # Set Variable [ $AttachmentList ; Value: If ( IsEmpty ( $AttachmentList ) ; $Path ; $AttachmentList & "¶" & $Path) ]
comment Posted 15 hours ago Posted 15 hours ago You don't need to use Constrain Found Set[] to exclude specific records from being found. You just need to add an Omit request/s to your find. Here is a simple example that finds records in the given date range but excludes records whose Type is "Transfer Receipt": Set Variable [ $startDate ; Value: ... ] Set Variable [ $endDate ; Value: ... ] Enter Find Mode [] Go to Layout [ “Costs” ] Set Field [ Costs::DateStatement ; $startDate & ".." & $endDate ] New Record/Request Set Field [ Costs::Type ; "Transfer Receipt" ] Omit Record Perform Find []
Oyseka Posted 14 hours ago Author Posted 14 hours ago 17 minutes ago, comment said: You don't need to use Constrain Found Set[] to exclude specific records from being found. You just need to add an Omit request/s to your find. Here is a simple example that finds records in the given date range but excludes records whose Type is "Transfer Receipt": Set Variable [ $startDate ; Value: ... ] Set Variable [ $endDate ; Value: ... ] Enter Find Mode [] Go to Layout [ “Costs” ] Set Field [ Costs::DateStatement ; $startDate & ".." & $endDate ] New Record/Request Set Field [ Costs::Type ; "Transfer Receipt" ] Omit Record Perform Find [] Thank you, so blasted simple
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now