handlers/kinetic_request_submission_create_v1/handler/init.rb
# 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['Category'] = @parameters['template_catalog_name']
	@field_values['SurveyInstanceID'] = get_survey_template_id(@parameters['template_name'], @parameters['template_catalog_name'])
	if !@parameters['message_template_name'].nil? && @parameters['message_template_name']!=""
		@field_values['MessageTemplateInstanceID'] = get_message_template_id(@parameters['message_template_name'])
	end
    entry = @@remedy_forms['KS_SRV_CustomerSurvey_base'].create_entry!(
      :field_values => @field_values,
      :fields       => ['instanceId']
    )
    results = <<-RESULTS
    <results>
      <result name="Instance Id">#{escape(entry['instanceId'])}</result>
	  <result name="KSR">#{escape(entry.id)}</result>
    </results>
    RESULTS
    puts("Results: \n#{results}") if @debug_logging_enabled
    return results
  end
def execute ( ) @field_values [ 'Category' ] = @parameters [ 'template_catalog_name' ] @field_values [ 'SurveyInstanceID' ] = get_survey_template_id ( @parameters [ 'template_name' ] , @parameters [ 'template_catalog_name' ] ) if ! @parameters [ 'message_template_name' ] . nil? && @parameters [ 'message_template_name' ] != "" @field_values [ 'MessageTemplateInstanceID' ] = get_message_template_id ( @parameters [ 'message_template_name' ] ) end entry = @@remedy_forms [ 'KS_SRV_CustomerSurvey_base' ] . create_entry! ( :field_values => @field_values , :fields => [ 'instanceId' ] ) results = <<-RESULTS 
    <results>
      <result name="Instance Id"> #{ escape ( entry [ 'instanceId' ] ) } </result>
	  <result name="KSR"> #{ escape ( entry . id ) } </result>
    </results>
     RESULTS puts ( "Results: \n#{results}" ) if @debug_logging_enabled return results end
This is a required method that is automatically called by the Kinetic Task
Engine.
This is a required method that is automatically called by the Kinetic Task Engine .
# Use the Template Name and Template Catalog Name # parameters to retrieve and add the SurveyInstanceID to the @field_values # hash. # Use the Message Template Name parameter to retrieve and add the # MessageTemplateInstanceID to the @field_values hash. # Create the KS_SRV_CustomerSurvey_base record using the @field_values hash # that was built up.  Pass 'instanceId' is passed to the fields argument to # explicitely specify the field values to return (this improves performance # over retrieving all fields on the submission record). # Build the results xml that will be returned by this handler. # Return the results String