Jump 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.

To get related records from related record and back

Featured Replies

I don’t know much about scripting and I’m getting crazy with this.

What I want to accomplish is to get related records of related records but when I get the related records of the first related record I can’t come back to the second "first" related record. Sounds weird :shocked:

I got months that has many exams that has many answers.

I want the questions to be listed first and then the questions and it’s answers, like

1. Question...

2. Question...

3. Question...

---

1. Question...

a) Answer...

b )Answer...

c) Answer...

2. Question...

a) Answer...

b )Answer...

c) Answer...

Everything goes fine but I can’t come back from the answers of question one to go on on the second question.

This is my script and where I get lost.

Go to Related Record [ From table: "T013c_Exams"; Using layout: "L013c_Exams" (T013c_Exams) ]

[ Show only related records ]

Sort Records [ Specified Sort Order: T013c_Exams::Number; ascending ]

[ Restore; No dialog ]

Go to Record/Request/Page

[ First ]

#----Questions

Loop

Set Variable [ $Questions; Value:$Questions & "¶" & TextStyleAdd ( T013c_Exams::Number ; Bold ) & " " & T013c_Exams::Text & "¶"

-FROM HERE-

#----AnswersByQuestion

Go to Related Record [ From table: "T013c1_Answers"; Using layout: "L013c1_Answers" (T013c1_Answers) ]

[ Show only related records ]

Sort Records [ Specified Sort Order: T013c1_Answers::Number; ascending ]

[ Restore; No dialog ]

Go to Record/Request/Page

[ First ]

Set Variable [ $Answer; Value:"" ]

Loop

Set Variable [ $Answer; Value:$Answer & T013c1_Answer::Number & " " & T013c1_Answer::Text ]

Go to Record/Request/Page

[ Next; Exit after last ]

End Loop

-TO HERE-

Set Variable [ $QuestionsAndAnswers; Value:$QuestionsAndAnswers & "¶" & TextStyleAdd ( T013c_Exams::Number ; Bold ) & " " & T013c_Exams::Text & "¶" & $Answer ]

Go to Record/Request/Page

[ Next; Exit after last ]

End Loop

Thank you very much for your help.

Well you need a

Go to Layout "L013c_Exams"

at the -TO HERE- mark. This layout will be in the same state you left it, so it will just continue as you want it to.

  • Author

First of all, thank you very much for your help.

I was very near but I was using Go to Related Record instead of Go to Layout.

It works fine, but I have found another problem I wasn't aware of.

It works fine only if all questions have answers (related record) if a question doesn't it stops there and the script gives wrong data.

Thanks again.

  • Author

I can't believe it :laugh2: I think I have solved it.

In exams table made a field, answered yes-no, and right before going to the answers put an If [T013c_Exams::Answered = "Yes"] and the End If right after the next End Loop, and It Works!!!!!!

FM rocks, I wish I'd have more knowledge of it, but step by step.... as a script :hmm:

Create an account or sign in to comment

Important Information

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

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.