You can create a scripted button in the designer to copy the contents of one field to another or multiple fields to multiple fields. First you need to open the data-entry form in the designer by clicking on the DESIGN button on the top toolbar
Explain
Follow these steps below to add the scripted button from the designer.
Click on the BUTTONS icon on the top toolbar
Drag the "Button [Run Script]" from the toolbox on the left onto your form.
In the lower right corner click on the '...' ellipse button next to the ACTCode property
This will open the 'Code Editor" window as shown above.
Copy the example script from below into this editor.
Remember to change the source and destination field names which are in bold below.
Click on the SAVE button to close the 'Code Editor'
Click on the SAVE icon then close the designer.
Use this script to copy one field in the custom table to another field in the custom table '---------------------------------------------------------------------------------------------
' START SCRIPT
' Get the value from the source field
Dim val as object = Durkin.Common.Classes.CustomSubEntity.GetFieldDescriptorByANYString("ChangeToSourceFieldName", SubEntityForm.getEntityManager).getValue(SubEntityItem)
' Replace this value into field the destination field
Durkin.Common.Classes.CustomSubEntity.GetFieldDescriptorByANYString("ChangeToDestinationFieldName", SubEntityForm.getEntityManager).SetValue(SubEntityItem,val)
' Refresh the UI ( User Interface) to update the controls on the screen
SubEntityForm.RefreshUI()
' END SCRIPT
'---------------------------------------------------------------------------------------------
Use this script to copy one field in the CONTACT table to another field in the custom table '---------------------------------------------------------------------------------------------
' START SCRIPT - CONTACT
' Get the value from the CONTACT attached to the curren record
Dim val as object = Durkin.Common.Classes.Contacts.GetContactFieldDescriptorByANY("ChangeToSourceFieldName", Me.HostFramework).GetValue(SubEntityItem.GetContacts(nothing)(0))
' Replace this value into field the destination field
Durkin.Common.Classes.CustomSubEntity.GetFieldDescriptorByANYString("ChangeToDestinationFieldName", SubEntityForm.getEntityManager).SetValue(SubEntityItem,val)
' Refresh the UI ( User Interface) to update the controls on the screen
SubEntityForm.RefreshUI()
' END SCRIPT - CONTACT
'---------------------------------------------------------------------------------------------