an example of macros in Form Designer.
1. Go to the Form Designer => Under Macros in the Design Object pane, click
Create New Macro.
2. Name the macro Update from Parent.
3. Leave the language as JavaScript.
4. Select Selected records for the Run this macro on: option.
Note: This is a good setting for testing a macro; when you know the macro
works, you can expand the scope.
5. Enter the script into the RunMacro function. following is an example of
updating field from Parent.
try
{
if ( i_FormRecord.HasParentRecord )
{
var i_ParentRecord = i_FormRecord.OpenParentRecord();
var ParentSubject = i_ParentRecord.OpenField("Subject");
i_FormRecord.SetField("Subject", ParentSubject );
}
}
catch(e)
{
alert("An error has occurred: " + e.description + " (" + e.number + ")");
}
6. Click Save to save the macro design to your local drive.
7. Click Save to Groove to save the design to the workspace.
8. To test the macro, edit an existing Site Evaluation record from the Sites
and Comments view.
* Change the site name.
* Click Update to save your changes to the Site Evaluation record.
* Select a Comment record in the view.
* Click Run Macro - Update from Parent.
* To verify that the update worked, open the Comment record to see if the
Site Name was changed.