1 Reply Latest reply on Aug 10, 2015 4:01 PM by philmodjunk

    Create new record loop



      Create new record loop



      I am trying to create a loop that checks to see if [ Get (AccountName) = Staff::Name ] and if it doesn't exist, create a new record with Staff:Name = Get (AccountName)

      My goal was to automatically create a new item when someone logs in that wasn't manually added into the Staff table. Is it efficient to run this after ever login? I don't plan on having more than 20 staff members.

        • 1. Re: Create new record loop

          Got to Layout ["Staff" (Staff) ]
          Enter Find Mode []  ---> clear the pause check box
          Set Field [Staff::Name ; get ( accountName ) ]
          Set Error Capture [on]
          Perform Find []
          IF [ Not Get ( FoundCount ) //no record found ]
             New Record/Request
             Set Field [Staff::Name ; get ( accountName ) ]
          End If