AnsweredAssumed Answered

Adding a third button to this script to re-login then new record request

Question asked by MarcMcCall on Mar 4, 2012
Latest reply on Mar 7, 2012 by philmodjunk

Title

Adding a third button to this script to re-login then new record request

Post

I would like to add a third button to this script that gives the user the option to create a new record after a re-login if no SSN # is found.  The script opens a search window that has a search field for a SSN#.  I have the layout set to only allow unique Data in that field so there are no duplicate SSN'# in the Account records.  If there is a SSN# that matches, they can select that record from the search popup, then create a new related interview record from a button on the Accounts layout.  If no SSN# match is present this is where I want the 3rd button to come in, I want them to have to re-login then a new record request.  I've been messing with this all day, and can't get it.

The first part and end of the script in place now, that searches for the SSN.

  • Allow User Abort [ Off ]
  • Set Error Capture [ On ]
  • #--------------------------------------Performs the script that searches the Accounts Module
  • Go to Layout [ “L10_ACCOUNTS_Data_Entry” (T01_ACCOUNTS) ]
  • Show All Records
  • Perform Script [ “ (0402) Account SSN # Search” ]
  • Enter Find Mode [ ]
  • Paste [ T01_ACCOUNTS::ClientsSocialSecurityNumber ] [ Select ]
  • Perform Find [ ]

The (402)  Account SSN # Search script.

 

  • Set Variable [ $portal; Value:Get ( ActivePortalRowNumber ) ]
  • Set Error Capture [ On ]
  • #--------------------------------------Sets a variable of the current window name
  • Set Variable [ $$Window_Name; Value:Get (WindowName) ]
  • #--------------------------------------Changes the current window to read "Searching..."
  • Set Window Title [ Current Window; New Title: "Searching..." ]
  • #
  • #--------------------------------------Creates a new window for the Account search.
  • #
  • New Window [ Name: "Account SSN # Search"; Height: 1; Width: 1; Top: 100; Left: 100 ]
  • #--------------------------------------Freezes the window for visual purposes
  • Freeze Window
  • #--------------------------------------Denies the user the privilege of aborting the script and then Hides and Locks the status area
  • Allow User Abort [ Off ]
  • Show/Hide Status Area [ Lock; Hide ]
  • #
  • #--------------------------------------Goes to the Account Popup screen, designed for searching.
  • #
  • Go to Layout [ “L13_ACCOUNTS_Search_Popup Copy” (T01_ACCOUNTS) ]
  • #--------------------------------------Enters Browse Mode and then sets the title of the button to the "Find"
  • Enter Browse Mode
  • Set Field [ T16n_census_PREFERENCES||id_constant|::g_search_button_status; "Find" ]
  • #
  • #--------------------------------------Enters Find Mode, goes to the Accounts SSN# field and pauses
  • Enter Find Mode [ ]
  • Refresh Window [ Flush cached join results ]
  • Adjust Window [ Resize to Fit ]
  • Go to Field [ T01_ACCOUNTS::ClientsSocialSecurityNumber ]
  • Show Custom Dialog [ Title: "Account SSN # Search"; Message: "Please enter the persons SSN # and perform search"; Buttons: “OK” ]
  • Pause/Resume Script [ Indefinitely ]
  • #
  • Perform Find [ ]
  • If [ Get(LastError) = 401 ]
  • #--------------------------------------If no records were found, a dialog gives the user the opportunity to retry
  • Show Custom Dialog [ Title: "Alert!"; Message: "No records were found. Would you like to modify your find?"; Buttons: “Modify”, “Cancel” ]
  • If [ Get(LastMessageChoice) =1 ]
  • Loop
  • Enter Find Mode [ ]
  • Go to Field [ T01_ACCOUNTS::ClientsSocialSecurityNumber ]
  • Pause/Resume Script [ Indefinitely ]
  • Perform Find [ ]
  • If [ Get(LastError) = 401 ]
  • Show Custom Dialog [ Title: "Alert!"; Message: "No records were found. Would you like to modify your find?"; Buttons: “Modify”, “Cancel” ]
  • If [ Get(LastMessageChoice) = 2 ]
  • Close Window [ Current Window ]
  • Set Window Title [ Current Window; New Title: $$Window_Name ]
  • Commit Records/Requests [ Skip data entry validation; No dialog ]
  • Exit Script [ ]
  • End If
  • End If
  • Exit Loop If [ Get(FoundCount) ≥ 1 or Get(LastMessageChoice) = 2 ]
  • End Loop
  • #--------------------------------------If the user does not wish to retry, the search window closes and orginal window is set back to the orginal title
  • Else If [ Get(LastMessageChoice) =2 ]
  • Close Window [ Current Window ]
  • Set Window Title [ Current Window; New Title: $$Window_Name ]
  • Commit Records/Requests [ Skip data entry validation; No dialog ]
  • Exit Script [ ]
  • End If
  • End If
  • #--------------------------------------Because there is not a found count based on the user's find, the button changes from "Find" to "Select" for the user to select a project
  • Set Field [ T16n_census_PREFERENCES||id_constant|::g_search_button_status; "Select" ]
  • #--------------------------------------Sorts the records alphabetically
  • Sort Records [ Specified Sort Order: T16_CENSUS::sort; ascending T16_CENSUS::Census_Name; ascending ] [ Restore; No dialog ]
  • Go to Record/Request/Page [ First ]
  • #--------------------------------------Pauses for the user to choose
  • Pause/Resume Script [ Indefinitely ]
  • Copy [ T01_ACCOUNTS::ClientsSocialSecurityNumber ] [ Select ]
  • #--------------------------------------Once the select button has been pressed for a certain Account, the appropriate information is set in variables
  • Go to Next Field
  • #--------------------------------------The search window is closed and the orginal window's title is set to the orginal text
  • Close Window [ Current Window ]
  • Set Window Title [ Current Window; New Title: $$Window_Name ]
  • #
  • If [ not IsEmpty ($$CC) ]
  • Exit Script [ Result: $Copy_CC ]
  • Else
  • Exit Script [ Result: $Copy_ID_Project ]
  • End If
  • Commit Records/Requests [ Skip data entry validation; No dialog ]

 

 

 

 

 

 

 

Outcomes