Calling Component Templates with PeopleCode
As with generic templates, component templates can be called directly with PeopleCode or with the DoModalComponent as follows:
import PT_WF_NOTIFICATION:NotificationTemplate;&name = "MYCOMPONENTTEMPLATE";&mynotifytemplate = create NotificationTemplate(%Component, %Market, &name, "C");&xmlVars = &mynotifytemplate.SetupCompVarsAndRcpts(GetLevel0());PT_WF_NOTIFY.RAWXML = &xmlVars;PT_WF_NOTIFY.MENUNAME = %Menu;PT_WF_NOTIFY.COMPONENT_ID = %Component;PT_WF_NOTIFY.MARKET = %Market;PT_WF_NOTIFY.PANELNAME = %Panel;PT_WF_NOTIFY.WL_TEMPLATE_ID = &name;PT_WF_NOTIFY.WL_TEMPLATE_TYPE = "C";PT_WF_NOTIFY.NOTIFY_TO = "targetemail@example.com";DoModalComponent(MenuName.WORKFLOW_ADMINISTRATOR, BarName.USE, Item⇒
Name.NOTIFICATION, Page.PT_WF_NOTIFY, "U", Record.PT_WF_NOTIFY);Related Topics