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[]

    …proceed normally

create a related global list-of-values in FM10

The logic is to have the various list-of-values (or combo-values) in a related global table.

  1. in global table: create the table that will hold the values -i.e. ‘city’
  2. in related table: add an ‘unrelated’ relationship from global of the new ‘city’ table
  3. from layout to be used:
    – Manage > Value Lists… > New… > Use values from field > Specify field…
    – find the newly added global table from the list
    – select the name/description of the lov
  4. add a field to layout and set the field to use ‘Radio button set’
  5. select ‘Display values from’ and select the newly created Value List
  6. finally select in which field the values should be stored

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…)