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

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

Recommended Posts

Posted

Hi there,

I do my cashouts from 4pm to 4pm opposed to daily. I developed a script that searches in part the sales.

Fields:

Date (Date): Creation Date

Time (Time): Creation Time

Yesterday Today(Calculation - text): DateToText(Today- 1) & "..." & DateToText(Today)

Four Oclock (Time - Auto Enter data): 16:00:00

Four Oclock Minus one Second (Time - Auto Enter Data): 15:59:59

Four Oclock String (Calculation - text): TimeToText(Four OClock) & "..." & TimeToText(Four OClock Minus One Second)

The Script:

Copy (Select "Yesterday Today")

Enter Find Mode()

Paste (Select "Date")

Go To Field (Time)

Pause/Resume Script()

Insert Text (Select "Time")

Perform Find (Replace Found Set)

---

I know there is something wrong but I can't pin point the problem. I want to use the Four Oclock String field but I don't how to make it work with the search script!

Any help is welcome,

bk17

Posted

Hi bk17,

I would recommend a couple of changes in your calculations and script:

It is better to use the function Status(CurrenDate) instead of Today.

You will find that you'll have better control over results by using Insert Calculated results instead of paste.

Date and Times can be tricky, so if the changes don't do it, be sure and check that the calculations are Date and Time (fields or Results are in Date and Time), or you may need to convert them by using Text to Date and Text to Time in your calculations.

HTH

Lee

cool.gif

Posted

I modified Today to Status(CurrentDate) and replace Paste by Insert Text but no result.

I modified the script. It looks like this now:

Copy (Select "Yesterday Today")

Enter Find Mode()

Insert Text (Select "Date")

Copy (Select "Four Oclock String"

Insert Text (Select "Time")

Perform Find (Replace Found Set)

---

Any help-

bk17

Posted

I would split this into two requests, one for yesterday after 3:59, and one for today before 4 PM.

Enter Find Mode [ ]

Set Field [Date, Status(CurrentDate) - 1]

Insert Text [select, Time, ">=16:00:00"]

New Record/Request

Set Field [Date, Status(CurrentDate)]

Insert Text [select, Time, "<16:00:00"]

Perform Find[ ]

I haven't tested this too much. So let me know how it works out.

Posted

Try Insert Calculated Result instead of Insert Text, and be more specific about how it didn't work. What were the results?

Posted

It doesn't work because Four Oclock string does not exist in Find Mode, so you can't copy it. You're only finding records from yesterday and today.

I don't think it will work that way anyway, because 16:00:00...15:59:59 is like saying Status(CurrentDate) & "..." & Status(CurrentDate) - 1. The starting value is greater than the ending one, which is why I split it into two days.

Posted

You are right of course. Duh. I didn't get an error beep, so it appeared to work.

Lee

Posted

Hi Queue

I am a bit puzzle with your comment: Try Insert Calculated Result instead of Insert Text.

Do I use that with the four oclock string?

Do I enter any information in Specify?

In any case, can you build me a script that would work?

looking for your reply

bk17

Posted

Use the same steps I provided earlier, just substitute Insert Calculated Result for Insert Text.

Insert Text worked fine for me, but I haven't done much work with time fields. They seem much more persnickity than date fields.

Add Pause/Resume steps after setting the time field to see what data is being entered.

Posted

Queue,

The Insert Calculated Result doesn't let me enter '>=16:00:00' in Specify. There is a syntax error.

bk17

Posted

Are you using single or double ticks around the text?

Can you attach the file?

Posted

Queue,

OKay, I added the quote. I performed the script but it didn't work. I decided to build you a little file. I created 5 records. The script should find 2 out 5. I imported the script and it worked with the little file. I almost step out of my chair. What's wrong with my genuine file?

Some clues...

Date and Time fields are creation fields.

When I perform the script, the view is a form.

All fields can be seen on screen.

Gosh, any idea!!

bk17

Posted

Firstly, the Insert Calculated Result script step requires that the referenced field is on the current layout. If it isn't the insert won't happen. It's caught me before.

Secondly, are the date and time fields *really* date and time fields? (Not data type text.)

Posted

Hey Vaughan,

Thanks for your comments. They sparked a solution. I realized that my Date and Time fields were located in the header. I moved them and it worked perfectly. I use a view form to do my cash out. All fields are displayed to do a nice print out.

bk17

This topic is 7490 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.