//Check if the user has pressed the submit button
//If Yes validate and insert the company details into the company table
if form(addCompany)
if form(txtCompanyName)
//open the an instance of the company table for inserting data
table company=contacts.company
//Check if the company exists
select from company where CompanyName={txtCompanyName}
if company(selected)>"0"
"Company Name already exist
"
over
endif
//assgin all the input values to respective fields.
company(CompanyName)=form(txtCompanyName)
company(Address)=form(txtAddress)
company(City)=form(txtCity)
company(StateorProvince)=form(txtState)
company(Region)=form(txtRegion)
company(Country)=form(txtCountry)
company(PostalCode)=form(txtPostalCode)
company(Website)=form(txtWebsite)
// insert the record
company(insert)
//Check if the records was succesfully inserted
if company(recordno)>"0"
"Company added succesfully
"
else
"Error occured while inserting record !!
"
endif
else
//Give an error messsage to the user
"Company Name cannot be Empty
"
endif
//end further execution
over
endif
include sample_top.html
Caravan
Business Server>Examples>Date & Time Variables |
|
|
|
include sample_bottom.html