handlers/kinetic_request_email_message_create_v2/handler/init.rb
# Creates a KS_MSG_Message record targeting the recipient specified in the
# 'To' parameter using the KS_MSG_MessageTemplate record associated to the
# specified 'Message Template Name' parameter (and the "Kinetic Request"
# application), and the customer survey submission associated to the specified
# 'Originating Id' parameter.
#
# This is a required method that is automatically called by the Kinetic Task
# Engine.
#
# ==== Returns
# An Xml formatted String representing the return variable results.


This is a required method that is automatically called by the Kinetic Task
Engine.

Returns
An Xml formatted String representing the return variable results.
This is a required method that is automatically called by the Kinetic Task Engine . Returns An Xml formatted String representing the return variable results .
def execute()
    @field_values['MessageTemplateInstanceID'] = get_message_template_id(
      @parameters['message_template_name'], @parameters['application_name'])
    log format_hash("Message Record Field Values:", @field_values)
    entry = @@remedy_forms['KS_MSG_Message'].create_entry!(
      :field_values => @field_values, :fields => ['instanceId']
    )
    results = <<-RESULTS
    <results>
      <result name="Instance Id">#{escape(entry['instanceId'])}</result>
    </results>
    RESULTS
    log "Results: \n#{results}"
    return results
  end
def execute ( ) @field_values [ 'MessageTemplateInstanceID' ] = get_message_template_id ( @parameters [ 'message_template_name' ] , @parameters [ 'application_name' ] ) log format_hash ( "Message Record Field Values:" , @field_values ) entry = @@remedy_forms [ 'KS_MSG_Message' ] . create_entry! ( :field_values => @field_values , :fields => [ 'instanceId' ] ) results = <<-RESULTS 
    <results>
      <result name="Instance Id"> #{ escape ( entry [ 'instanceId' ] ) } </result>
    </results>
     RESULTS log "Results: \n#{results}" return results end
Creates a KS_MSG_Message record targeting the recipient specified in the
'To' parameter using the KS_MSG_MessageTemplate record associated to the
specified 'Message Template Name' parameter (and the "Kinetic Request"
application), and the customer survey submission associated to the specified
'Originating Id' parameter.
Creates a KS_MSG_Message record targeting the recipient specified in the ' To ' parameter using the KS_MSG_MessageTemplate record associated to the specified ' Message Template Name ' parameter ( and the " Kinetic Request " application ) and the customer survey submission associated to the specified ' Originating Id ' parameter .
# Use the Message Template Name parameter to retrieve and add the # MessageTemplateInstanceID to the @field_values hash. # Create the entry and only return the instanceId field value # Build the results xml that will be returned by this handler. # Return the results String