Searching for no record
Searching for no record
I am building an app to collect hours and miles from various search and rescue team members. There are two forms. The first form is a contact information form and the second form contains fields for the hours information.
In the "hours" form I would like to automatically input the First Name, Last Name, email address and Team Name from the contact info form based upon the "radio callsign" input. That is, in the hours form the user would input the radio callsign and the other fields would automatically be populated.
What I don't know how to do, is to have an alert occur when a user enters a callsign into the "hours" form, but there isn't a corresponding entry in the contact info form. I want to restrict users from entering data until they have filed out the contact information form. Also, I don't know how to make entry lookups case insensitive. For example, I would like 54R5 and 54r5 to be found.
The code is below,
form AutoFill_Hour_Input
{
displayname = "AutoFill Hour Input"
Individual
(
type = checkbox
defaultvalue = false
)
Team_Summary
(
displayname = "Team Summary"
type = checkbox
defaultvalue = false
on user input
{
//You can drag and drop tasks from the immediate left pane
//Below is the SAMPLE script for dynamic, condition based field manipulation
}
)
must have Password
(
type = text
on user input
{
if (input.Password != "sarhours")
{
}
if (input.Password == "sarhours")
{
}
}
)
must have Radio_Callsign
(
displayname = "Radio Callsign"
type = text
maxchar = 6
on user input
{
for each fn in Contact_Information [SAR_Callsign == input.Radio_Callsign]
{
clear FirstName;
clear TeamName;
clear LastName;
FirstName.add(fn.First_Name);
LastName.add(fn.Last_Name);
TeamName.add(fn.TeamName);
input.Email_Address = fn.Email_Address;
}
}
)
FirstName
(
type = picklist
values = Contact_Information.First_Name
sortorder = ascending
)
LastName
(
type = picklist
values = Contact_Information.Last_Name
sortorder = ascending
)
Email_Address
(
displayname = "Email Address"
type = email
)
must have TeamName
(
type = picklist
values = Team_List.Team_Name
sortorder = ascending
)
must have Year
(
type = picklist
values = {"2007", "2008", "2009"}
defaultvalue = "2008"
)
must have Month
(
type = picklist
values = {"January", "February", "March", "April", "May", "June", "July", "August", "September", "October", "November", "December"}
)
Administration1
(
displayname = "100 Administration"
type = number
width = 20
)
Equipment_Up_Keep
(
displayname = "112 Equipment Up-Keep"
type = number
width = 20
)
Fundraising
(
displayname = "115 Fundraising"
type = number
width = 20
)
Inter_Unit_Support
(
displayname = "116 Inter-Unit Support"
type = number
width = 20
)
Personal_Fitness
(
displayname = "119 Personal Fitness"
type = number
width = 20
)
Public_Relations
(
displayname = "122 Public Relations"
type = number
width = 20
)
Rescue_Operations
(
displayname = "123 Rescue Operations"
type = number
width = 20
)
Rescue_Standby
(
displayname = "124 Rescue Standby"
type = number
width = 20
)
Rescue_Operations1
(
displayname = "125 Search Operations"
type = number
width = 20
)
Training
(
displayname = "127 Training"
type = number
width = 20
)
Team_Meeting
(
displayname = "128 Team Meeting"
type = number
width = 20
)
Staff_Meeting
(
displayname = "129 Staff Meeting"
type = number
width = 20
)
Other
(
displayname = "130 Other"
type = number
width = 20
)
Miles
(
displayname = "145 Miles"
type = number
width = 20
)
on add
{
on load
{
clear TeamName;
clear FirstName;
clear LastName;
}
on success
{
sendmail
(
To : input.Email_Address
From : zoho.adminuserid
BCC : "sardata@sbsar.org"
Reply to : "jlehman@caverescue.net"
Subject : "Individual Hour Report"
Message : "" + input.formdata
)
}
}
}