I am using Servoy 2.0.3 Developer on a PC running WindowsXP.
I have a Company Details form, that displays amongst other things a related contacts portal.
I have a create ‘New Contact’ button that creates a new related contact record, and then takes the user to that related record using a ‘Contact Details’ form ready for editing. (see ‘New Contact’ code below).
I then edit the fields on that form, with Name and address etc.
If I navigate around my solution, and come back to this newly created contact record, everything is OK, the edited details are present.
However, if I look at the record on another PC, or exit Servoy and go back into the solution and navigate to the newly created record, the edited details are not there, the record has reverted back to the original record creation details. In other words, the changes have not been recorded.
The ‘New Contact’ code:
var thePressedButton = plugins.dialogs.showQuestionDialog( 'Question', 'Are you sure you want to create a new Company Contact?', 'OK', 'Cancel');
if ( thePressedButton == "Cancel" )
{
return
}
else
{
var theCompany_ID = companyid
var theSGB_Branch_Nbr = sgb_branch_nbr
forms.BranchCustomerContactDetails.controller.newRecord()
forms.BranchCustomerContactDetails.company_id = theCompany_ID
forms.BranchCustomerContactDetails.contact_title = "***Title***"
forms.BranchCustomerContactDetails.contact_first = "***First Name***"
forms.BranchCustomerContactDetails.contact_last = "***Last Name***"
forms.BranchCustomerContactDetails.contact_mobile ="**Mobile**"
forms.BranchCustomerContactDetails.contact_jobtitle ="***Job Title***"
forms.BranchCustomerContactDetails.company_name = "**Company Name**"
forms.BranchCustomerContactDetails.contact_office_address1 = "**Address1**"
forms.BranchCustomerContactDetails.contact_office_address2 = "**Address2**"
forms.BranchCustomerContactDetails.contact_office_address3 = "**Address3**"
forms.BranchCustomerContactDetails.contact_office_town = "**Town**"
forms.BranchCustomerContactDetails.contact_office_county = "**County**"
forms.BranchCustomerContactDetails.contact_office_postcode = "**Postcode**"
forms.BranchCustomerContactDetails.contact_office_country = "**Country**"
forms.BranchCustomerContactDetails.contact_office_tel = "***Telephone***"
forms.BranchCustomerContactDetails.contact_office_fax = "***Fax***"
forms.BranchCustomerContactDetails.sgb_branch_nbr = theSGB_Branch_Nbr
databaseManager.refreshRecordFromDatabase(companies_to_contacts, 1)
forms.BranchCustomerContactDetails.controller.show()
}
The company details form:
The contact details form following ‘New Contact’ and before editing:
The contact details form post edit:
The company details form post edit showing the record in the portal:
The company details form following Servoy exit and re-entry, showing record is now back to original state: