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

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

Recommended Posts

Posted

The attached .pdf file shows the layout that I am working in.

My hope is that a calculation or script can be created that will do the following:

~Copy the current record's project number

~Enter Find Mode

~Paste the project number

~Perform Find for records that have the pasted project number and where the Consultant Affected checkbox has at least "A" checked.

--From that "found set"...

Because the "RFI number" is not always sequential, I need to count the number of records that contain data in the "Date Received" field. (this field always has a date)

If the total number of records (containing at least "A") for that project exceed 30 records, I need to display a custom message in the "ALERT" field that states "Fixed Fee RFI limit reached. Please code time to Excessive RFI phase and task."

If the total number of records containing "A" for the specific project is less than or equal to 30 - the "ALERT" field can remain blank.

rfi_record.pdf

Posted

Dana--

You don't really need to count the date field; you just need to count the found records. the following script should do what you're describing. Others no doubt have a trickier way to do this.

David

Script:

# This script uses a passed script parameter for ProjectID. set in calling layout

Set Error Capture [On]

Enter Find Mode []

Set Field[ProjectID; Get(ScriptParameter)]

Set Field[ConsultantAffected; "A"]

Perform Find []

If [Get ( FoundCount ) > 30]

Show Custom Dialog["ALERT"; "Fixed Fee RFI limit reached. Please code time to Excessive RFI phase and task."]

End If

Posted

It's almost as playing sheet music, one thing though is that Copy/Paste is a bad habit tampering with what the user have stashed away in the clipboard. This is why I since you're using FM7 and not FM8, uses a scripted recursion:

If [ IsEmpty ( Get ( ScriptParameter ) ) ] 

     Perform Script [ “TheSearch”; Parameter: test::RFI ] 

Else 

     Enter Find Mode [  ] 

     Set Field [ test::RFI; Get ( ScriptParameter ) ] 

     Perform Find [  ] 

     If [ Get ( FoundCount ) ≥ 30 ] 

          Show Custom Dialog [ Title: "Alert!"; Message: "Fixed Fee RFI limit reached. Please code time to Excessive RFI phase and task"; Buttons: “OK” ] 

     End If 

End If 

One more thing is, littering a field with Alert messages is not my style when custom dialogs are around.

--sd

Posted

OK, I did this the way you said. I don't completely understand how the [color:red]Set Field [ProjectID; Get (ScriptParamenter) works but it seemed to do what you intended it to do.

[color:blue]The only problem is that I need to have the custom dialog actually entered into a field so that it will show up when the RFI is printed.

The pop up box would work wonderfully if the person entering the information was also the one coding their time. In our case, our receptionist enters the data in and gives the printed RFI to an architect. The architect is the one that will need to code their time so they need to be able to see the alert on the paper they are given.

Posted

I guess I don't understand the Get(ScriptParameter) step.

Will this work even though the project number will be different everytime?

I keep running the one that T-Square set up but it keeps running off of the same project number.

I'm sorry but it seems that I am a little slow at this.

Thanks for your patience.

Posted

The Get (Script Parameter), gets the parameter value that was passed.

You still have to assign the Script Parameter a value prior to the script. This can be done by attaching it to a button, or if calling a subscript from a master script, you have the option of passing a parameter as well.

So in order for the script to work you have to have a button pass the current project number to the script or pass it within a subscript if you are using a master script.

When you are defining a button or calling a subscript, you will see on the bottom an area for passing an optional parameter value. This can be hardcoded or a field reference.

I hope that cleared stuff up.

Good luck

Posted

Using the scripts above I came up with this one:

Set Errot Capture [On]

Enter Find Mode []

Go to Field [RFI Tracker::project_number]

Insert from Last Visited [select; RFI Tracker::project_number]

Set Field [RFI Tracker::rfi_consultant_affected; "A"]

Perform Find []

If [Get (FoundCount) > 30]

Go to Record/Request/Page [Last]

Set Field [RFI Tracker::excessive_rfi_alert; TextColor ("EXCESSIVE RFI'S! Code time to excessive RFI task."; RGB (255;0;0) ) ]

Else

Go to Record/Request/Page [Last]

End If

Print

I took this route so that if the found count was less than 30 they script didn't just stop at 0 found records. I needed it to continue and take the user back to the original record and print it.

If anyone knows of a better way to always be taken back to the last active record let me know.

Posted

Thanks John,

That makes sense. I thought I had to enter a whole calculation string into the box, not just the field name.

OK so I changed it again from my last post.

I replaced:

Go to Field [RFI Tracker::project_number]

Insert from Last Visited [select; RFI Tracker::project_number]

with...

Set Field [RFI Tracker::project_number; Get(ScriptParameter)]

Then when I set up the button I used the "RFI Tracker::project_number" field as the Parameter.

Wow - looks like I might have learned a little something new today!

Thanks all and I'm still open to ideas!

Posted

if calling a subscript from a master script

Or by a recursion as I did it, by the way has some of subscripts funtionality evaporated into thin air with FM8 listen to Ray Cologons explanation in:

http://podcast.buddysystems.com/media/Filemaker_PodCast_10182005.mp3

--sd

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