AnsweredAssumed Answered

Set field not working in script

Question asked by rado on Mar 7, 2016
Latest reply on Mar 8, 2016 by sreese

I have tried 3 hours worth of things to get this to work and cannot figure our why this script will not clear my field.  The Project::Project Number Find Field will not clear when I enter a project number that is not found but choose not to create a new record by choosing cancel in the Show custom dialog box.  I should mention also that when it goes back to the Home Screen - Easy Find" layout the field is highlighted and everything selected but it takes pressing delete 2x before it will delete anything.

 

Home Screen Find Script

Copy [ PROJECTS::PROJECT NUMBER FIND FIELD ]

[ Select ]

Go to Layout [ “PROJECTS” (PROJECTS) ]

View As

[ View as Form ]

Enter Find Mode [ ]

Paste [ PROJECTS::PROJECT NUMBER ]

[ Select ]

Set Error Capture [ On ]

Perform Find [ ]

Set Field [ PROJECTS::Error Capture ; Get(LastError) ]

If [ PROJECTS::Error Capture <> 0 ]

Show Custom Dialog [ Title: "JOB NUMBER NOT FOUND"; Message: "PROJECT NUMBER NOT FOUND. WOULD YOU LIKE

TO CREATE A NEW RECORD?"; Default Button: “OK”, Commit: “Yes” ; Button 2: “CANCEL” , Commit: “No” ]

If [ Get(LastMessageChoice) = 1 ]

New Record/Request

Paste [ PROJECTS::PROJECT NUMBER ]

[ Select; No style ]

Go to Field [ PROJECTS::PROJECT NAME ]

Show All Records

Exit Script [ ]

Else

Perform Script [ “CANCEL” ]

End If

End If

Show All Records

 

CANCEL Script

Go to Layout [ “HOME SCREEN - EASY FIND” (PROJECTS) ]

Set Field [ PROJECTS::PROJECT NUMBER FIND FIELD ; "" ]

Show All Records

Outcomes