//Check if the user has pressed the modify button //If Yes modify the contact information and update the contact table if form(ModifyContact) if form(txtfirstname) //open the an instance of the contatcttype table for modifying data table contacts=contacts.contacts //moving pointer to selected record contacts(recordno)=form(HdnRecPointer) //assgin all the input values to respective fields. contacts(Company)=form(TxtCompanyName) contacts(firstname)=form(txtfirstname) contacts(lastname)=form(txtlastname) contacts(title)=form(txttitle) contacts(delim)="," contacts(Workphone)=form(txtphone) contacts(delim)="null" contacts(homephone)=form(txthomephone) contacts(mobilephone)=form(txtmobilephone) contacts(Faxnumber)=form(txtfaxnumber) contacts(EmailAddress)=form(txtemailaddress) contacts(contacttype)=form(txtContactID) // modify the record contacts(modify) //Check if the records was succesfully inserted if contacts(recordno)>"0" "

Contact modified succesfully

" else "

Error occured while modifying record !!

" endif else //Give an error messsage to the user "

Contact First name cannot be Empty

" endif //end further execution over endif // Check if user has pressed delete button // if yes validate and delete record from contacts table. if form(DeleteContact) if form(txtfirstname) //open the an instance of the contatcttype table for deleting data table contacts_delete=contacts.contacts //assgin all the input values to respective fields. //moving pointer to selected record contacts_delete(recordno)=form(HdnRecPointer) // delete the record contacts_delete(deleterecord) //Check if the records was succesfully deleted if contacts_delete(recordno)>"0" "

Contact deleted succesfully

" else "

Error occured while deleting record !!

" endif endif //end further execution over endif
include sample_top.html
Caravan Business Server>Examples>Date & Time Variables

Modify/Delete Information

Select Company name
// -- Combo Box For Company Name ----- // display all the companies from contcats table // Contacts table is relational with company table. table show_contacts=contacts.contacts //------------------------------------------------------------------------- // -- If Company Name is selected from combo box. if form(txtCompanyID) // -- To get details of selected record. select * from show_contacts where company="{txtCompanyID}" // -- If record is selected then display company name in Textbox. // -- Textbox is read only and can not change the company name. // -- This textbox is displayed after submitting the form for // -- first time. else if form(newtxtCompanyID) // -- This textbox is displayed when form is submitted for the // -- second time. // -- This is also readonly textbos as we can not change the // -- name of comany. else // -- To display all unique companies from contacts table. select * from show_contacts where company is unique
// -- Combo Box For First & Last Name ----- // Here we are displaying first name and last name for selected company // -- if contact person is selected if form(cmbName) // -- opening the instance of contacts table // -- to get all informations of selected contact // -- person. table show_contactdetails=contacts.contacts // -- taking record pointer to selected record. show_contactdetails(recordno)=form(cmbName) First Name
Last Name else // -- After selecting company name, we are displaying all // -- available persons first name and last name combined // -- in combo. table disp_contacts=contacts.contacts if form(txtCompanyID) delete sql var sql sql(company_no)=form(txtCompanyID) select * from disp_contacts where Company="{company_no}" endif First Name + Last Name endif
Title
Work Phone
(Separate Multiple phones using ",")  
Mobile Phone 
Fax Number 
Home Phone 
Email Address
Contact type 

  include sample_bottom.html