If you really need to invoke a macro method after the submission of a form, with a value entered in the form, you could add the macro to a
- Autoresponder template, or
- Notification template
Honestly this is a bad idea, and you are better off writing a global handler to execute a method upon the submission of a form.
Something along the lines of:
protected override void OnInit()
{
// Attach a handler to the 'biz form item inserted' event
BizFormItemEvents.Insert.After += BizFormItem_Insert_After;
}
. . .
private void BizFormItem_Insert_After(object sender, BizFormItemEventArgs e)
{
// Check if this is the correct form
if (e.Item.BizFormClassName.ToLower() == "bizform.YourForm") {
var zipCode = e.Item.GetStringValue("ZipCode");
// Run your method
MyClass.MyMethod(zipCode);
}
}
Another option is to customise the On-line form webpart, which I only recommend as a last resort if all fails.