Jump to content
Salesforce and other SMB Solutions are coming soon. ×

aholbrow
 Share

Recommended Posts

I have a database hosted on FM Server and authenticating remotely to Active Directory. I’m trying to create a script that will run when the database opens so that the opening layout uses a merge variable to say “Welcome, $$staffname” and then shows a list of that users active clients.

 

I have a Staff table that maps the AD AccountName (Staff_Account) to the user’s full name (Staff_Name). Following is the first step of my script:

 

Set Variable [

$$staffname

;

Value: Case (Get(AccountName) = Staff:Staff_Account

;

Staff::Staff_Name

;

Get(AccountName)

)

]

 

The script then goes on to perform finds based on Staff_Name.

 

The script works fine for me when I open the database. However, for all other users, $$staffname reverts to their AccountName and the subsequent finds don’t work.

I’ve granted the script Full Access Privileges. Can anyone suggest anything that might help? Thanks in advance!

Link to comment
Share on other sites

How is it getting to the correct record in the Staff table? You aren't performing an initial Find (unless you left that part out).

 

Is your own record the first record in that table? If so, then yeah, no matter who logs in it's going to set $$staffname to their account name because YOUR OWN record will be the Staff record that everyone would be on at the time. And for anyone else but you, AccountName won't equal your record's value for Staff::Staff_Account so it sets it to Get (AccountName) instead.

 

(This does assume that the layout you're on is a layout showing records from Staff, not a layout that is home to a related table instead).

Edited by AHunter3
Link to comment
Share on other sites

 

(This does assume that the layout you're on is a layout showing records from Staff, not a layout that is home to a related table instead).

 

Thank you very much for your response, AHunter3. The opening layout is based on a related table, not the Staff table. If I can provide you with any additional information, please don't hesitate to let me know; thanks for any additional input you might have.

Link to comment
Share on other sites

Please provide a complete description of the relationship between the opening layout's native table and the related Staff table you're referencing in your script, and if you left out any script steps in your opening script, please type out an unabridged version (or at least unabridged up through the step where you set the value of $$staffname.

Link to comment
Share on other sites

This thread is quite old. Please start a new thread rather than reviving this one.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share



×
×
  • Create New...

Important Information

Terms of Use