AnsweredAssumed Answered

script trigers on start-up window

Question asked by yasirali on Oct 26, 2016
Latest reply on Oct 27, 2016 by yasirali

Hi all

I'm using file maker 13 and trying to create a data base for multiple users on the web with a privilege set. and it would also be controlled by two people with full access privilege.

one of the requirement is to set a lay out for the members where the would be able to submit requests to the full access privilege people. and a message should pop-up on the Admin (full access) start-up window when a new query is submitted, also a message should pop-up on the member's who submitted the query  start-up window when  the request is answered.

I wrote a script that obviously didn't work, it looks so complicated to me,

set Error Capture [on]   
If [Get (AccountPrivilegeSetName) = "[Full Access]"]  
Go to layout ["Query"(Query)]  
Enter find mode   Set Field [Query::query_status; "Active" ]  
perform find     if [Get (LastError) = 0]    
go to layout ["Home"(members)]    
show custom dialog [" New Queries" ; "You have" & Get ( FoundCount ) & "queries"]    
perform script ["find active queries"]      
Else If [Get (LastError) / 0]      
go to layout ["Home"(members)]      
show custom dialog [" New Queries" ; "You don't have active queries"]      
End If 
End If 
set Error Capture [off] 
set Error Capture [on] 
If [Get (AccounName) = Query::email_query] 
go to layout ["query"(query)] 
Enter find mode 
Set Field [Query::email_query;Get( AccountName )] 
Set Field [Query::status_query; "Answered"]  
show custom dialog ["Queries" ; "Your request was answered"] 
Go to layout ["Home"(members)] 
Enter find mode 
Set Field [Home::email_address;Get( AccountName )] 
perform find 
enter browse mode 
If [Get (LastError) + 0] 
Go to layout ["Home"(members)] 
Enter Find Mode 
Set Field [Home::email_address;Get( AccountName )] 
perform find 
enter browse mode 
End If 
End If 
set Error Capture [off] 
Exit Script

 

I would really appreciate any help or  suggestion if you were able to find what's wrong

Outcomes