Skip to content
View in the app

A better way to browse. Learn more.

FMForums.com

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Need help with a script

Featured Replies

I have a form (CY 104 Form) that gets sent to the local police department. On the form, it has a list of the Child's name/info, the Mother's name/info, the Father's name/info, and the Perpetrator's name/info. These fields will be automatically filled in by this script that I'm attempting to create. The information comes from a 'significant other' database that is filled out and includes the victim's mother/father/brother/sister/perpetrator/etc. I want to have either checkboxes or a dropdown (or a combination of both) in the significant other records to display the relationship of the sig other to the victim. If I used a dropdown, I'd also have to have a checkbox for if the person is also the perpetrator of the case.

So, these people will be a mother/father/sibling and possibly even the perpetrator. I'm assuming I'll need some sort of loop to take whichever sig. others are related to the victim, and assign the information onto the form. How easy is this to do, I need help. Thanks!

Have you thought about doing this via relationships and a line items file?

you could have a CY104 file that held info specific to the form, and a CY104LineItem file that held people associated with the form sharing the same FormID#. You could export name info form significant other file to line item file, child info from child file to lineitem file, and perp info from perpfile to line item file, sort them and print as subsummary report (by title "perp, sig other, child" and then include relevant CY104 info in the header or footer as related fields to CY104 file. Essentially, modeling the whole thing as an invoice.

If you want to stick with the script idea, a series of if statements could do the job if you had specific perp, sig other fields you needed populated:

you would want a many to one relationship first (globalCY104ID in SigOthers file related to CY104ID)

set globalCY104ID to the ID of the Form you are working on.

find your set of relevant records,

go to rec req/first

loop

if [title="perp"]

set field (globalCY104ID::PerpName, Name)

end if

if [title = "father"]

set field (globalCY104ID::fatherNAme, Name)

end if...

go to rec/req next (exit after last)

end Loop

hth

-Raz

  • Author

Thanks for the reply. I will probably go with the script idea because (I should have mentioned this before) the form always has JUST the victim (Child), mother, father, and perp info. No more, no less. So there could be many significant others that never get included on the CY 104 form. I'm going to give it a shot and see what I get. Thanks again!

  • Author

I

  • Author

I don't think so, I look in the record after the script has run and there's nothing. I tried to even put in a few 'message boxes' to display the contents of fields in the loop and outside, I get nothing when I run the script.

The Loop part of your script needs to run as an external script in the SigOther database.

Make a Pause script after 5th line. If the global isn't populated, then check you relationship.

  • Author

Sorry I haven't touched this thread for a while. I didn't realise that I needed to run the loop part in the sig other database. I have it running from there now and it works like a charm! Thanks for your help, gentleman!

Create an account or sign in to comment

Important Information

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

Account

Navigation

Search

Search

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.