Jump to content
Claris Engage 2025 - March 25-26 Austin Texas ×

This topic is 4330 days old. Please don't post here. Open a new topic instead.

Recommended Posts

Posted

I have the following script:

 

Set Error Capture [ On ]

Set Variable [ $filterDate; Value:Get ( CurrentDate ) - 2 ]


Go to Layout [ “SecPrices” (SecPrices) ]


Perform Find [ Specified Find Requests: Find Records; Criteria: SecPrices::date: “≤$filterDate” AND SecPrices::secPriceValid: “Invalid Price” Find Records; Criteria: SecPrices::date: “≤$filterDate” AND SecPrices::secPriceValid: “Ccy Mismatch” ]
[ Restore ]


Set Variable [ $lastError; Value:Get ( LastError ) ]


Set Variable [ $foundcount; Value:Get ( FoundCount ) ]


Send Mail [ Send via SMTP Server ]
[ No dialog ]


If [ $lastError ≠ 401 ]


// Delete All Records


[ No dialog ]   End If 

 

The script works fine on a client but running scheduled in server ends up deleting all the records in the table. Therefore, the Delete All Records step is commented out so not to execute and I have put in a send mail step to be able to capture the error. Running in client I get an email saying that the error was 0 and the found records were 908. However, if run via schedule on server, I get error 500, found 21327 (which is the total number of records in the table).

 

Error 500 is "Date value does not meet validation entry options". I cannot figure out where the problem is. I have tried replacing the "≤" in the find criteria with "..." but this does not help.

Posted

For the table that the layout "SecPrices" is based on, check what fields have validations set and then inspect all records to see on what records those conditions are not met.

Posted

Hi Wim. Did that before posting. Doesn't seem to be the issue. Although I still have not found the answer to what I have posted, I remembered that I encountered a similar problem some time ago and have just tried the same solution. It did work.

 

The fix is to change the Find[Restore] to Enter Find Mode, Set Field..., Perform Find. This works without a hitch. I had just forgotten about this. Would still be interested if someone has an answer as to why the other does not work, but I can live with the workaround.

 

Thanks for taking the time to respond.

Posted

Look more closely at the server error logs.

 

Error 500 implies that you didn't actually get into find mode as FM cannot perform validation in find mode - otherwise you wouldn't be able to enter "≤$filterDate" as a criteria.

This topic is 4330 days old. Please don't post here. Open a new topic instead.

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.