Get user-account and limit his/her access in FM10

Limiting access of an FM user.

  1. Set a variable and get the account name
    Set Variable [$$username; Value: Get (AccountName)]
  2. From the script where you want the set user limitation:
    Perform Script ["getUserAccount"] //the script created in step 1
    If [$$username = "some_user_name"]
    Perform Script ["noAccessScript"]
    Exit Script[]
    else

    …proceed normally

create a relationship using global var in FM10 (view or new rec)

Creating a relationship using a global variable in FM10:

  1. create the relationship in the graph of FM (i.e. person: person_pk to history: person_fk)
  2. from inside a script, if you need to view the relationship:
    Set Variable [$$person_id; Value:person::pk_person_id]
    If [IsValid(person_pk2fk_history::fk_person_id]
    Go to Related Record [Show only related records; From table: "person_pk2fk_history" Using layout: "history_edit" (person_pk2fk_history)
  3. from inside a script, if you need to create a new record as no relation exists yet:
    Go to Layout ["history_edit"(person_pk2fk_history)
    New Record/Request
    Set Field[person_pk2fk_history::fk_person_id; $$person_id]
    Commit Records/Requests[No dialog]

Some remarks: (more…)