it returns a ? because you're using GetField() incorrectly. You don't need to use getfield at all. Just remove that and leave the "comments::id_comments" as your calculation.
line 10, use perform find, not perform quickfind.
line 18, again don't use getfield() here, just grab the employee::id_employee in the calculation dialog.
line 31, no need to flush external data, the portal is considered join results.
line 2, add in a "allow user abort: off" step here, that way a user doesn't press escape and strand themselves somewhere along the way.
Also as a note, usually GetField() is used when you need to calculate the field name you are getting.
Filemaker does an awesome job of updating field references for you, say for instance if you had:
as your calculation, and then in manage database you changed the field name to ID_Comments. Filemaker would automatically update that calculation to say comments::ID_Comments.
That's one thing FM does that's worth it's weight in gold compared to native SQL, MySQL or other database engines.
Wow...amazing difference. Thank you so much for your help. Would have taken me hours to figure out those changes. Kinda proud that for the most part I was on the right track. Your insight is welll appreciated
No worries, soon enough you'll be writing scripts in minutes instead of hours too.