Macro's - Can anyone point to an example

M

Marc Dimmick

I have read we can use macros in a form. Can anyone point me to an example
of how it works


--

Regards
Marc Dimmick

"The best way to predict the future is to create it" - Dr.Peter F. Drucker
 
E

Emily

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.
 
M

Marc Dimmick

This looks great. The site evalutation is that a test workspace or somthing?

--

Regards
Marc Dimmick

"The best way to predict the future is to create it" - Dr.Peter F. Drucker
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top