My Oracle Support Banner

Headless Configuration Business Service Method ApplyPromotionDefaults Does Not Do Same As When The UI Applies Promotion Defaults (Doc ID 1503274.1)

Last updated on MARCH 02, 2017

Applies to:

Siebel Communications - Version 8.1.1.3 SIA[21219] to 8.1.1.6 SIA [21233] [Release V8]
Information in this document applies to any platform.
***Checked for relevance on 02-02-2016***

Symptoms

The “Headless Configuration" business service method "ApplyPromotionDefaults" produces different results when invoked by a script instead of the UI. The attributes are being set incorrectly.

For example, take the following:
 
  Attribute: Test Attr
  Enumerated with values A,B,C.
  Class: Test1 with above attribute.
  Simple Product: Child C1
  Complex Product: Root with above product.
  Promotion: Test Promo with above product. Set exclusions so attribute can only be C.

In the UI, add the promotion to an order. The attribute on the root is set to C.

Run script to add the promotion etc to an order (see example below), the attribute on the root is set to null.

  function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
  {
   try
   {
    var sOrderId  = "1-7TT2";
    var sProdId  = "1-7TQG";
    var OrderBO  = TheApplication().GetBusObject("Order Entry (Sales)");
    var OliBC   = OrderBO.GetBusComp("Order Entry - Line Items");
    var OrderBC  = OrderBO.GetBusComp("Order Entry - Orders");
    var bcProduct  = "";
    var svcInputs  = TheApplication().NewPropertySet();
    var svcOutputs  = TheApplication().NewPropertySet();
    var errorMess  = "OK";
    
    var sAssetIntId = "";
    
    with(OrderBC)
    {                                  
     SetViewMode(AllView);
     ClearToQuery();
     SetSearchSpec("Id","1-7TT2");
     ExecuteQuery(ForwardOnly);
     var orderExists = FirstRecord();
     if (orderExists)
     {                                  
      with(OliBC)
      {
       NewRecord(NewAfter);
 
       bcProduct = GetPicklistBusComp("Product");
      
       with(bcProduct)
       {
        ClearToQuery();
        SetViewMode(AllView);
        SetSearchSpec("Id", sProdId);
        ExecuteQuery(ForwardOnly);
        
        if (FirstRecord())
         Pick();
 
       }
       sAssetIntId = GetFieldValue("Id");
 
      }
     }
    }
              
    /****THEN  APPLY PROMOTION ****/
    
    var svcPromo = TheApplication().GetService("ISS Promotion Management
  Service");
    var svcHeadlessConfServ = TheApplication().GetService("Headless
  Configuration Service");
    
    with(svcInputs)
    {
     SetProperty("Active Document Id", sOrderId);
     SetProperty("Prod Prom Id", sProdId);
     SetProperty("Qty", 1);
     SetProperty("Prod Prom Instance Id",sAssetIntId);
     SetProperty("Target Document", "Order");
    }
    
  var MyFile = Clib.fopen('c:\\VFLog.txt', 'at');
  var sTime = Clib.ctime(Clib.time());
  sTime = sTime.replace('\n',' '); // Remove the Newline on the end.
  Clib.fputs(sTime + ': Calling ApplyPromotion' + '\n', MyFile);
  Clib.fclose(MyFile);
 
    svcPromo.InvokeMethod("ApplyPromotion", svcInputs, svcOutputs);
    
    // Apply promotion default
    
    with(svcInputs)
    {
     Reset();
     SetProperty("Promotion Automatch", "Min Max Cardinality");
     SetProperty("Document Id", sOrderId);
     SetProperty("Document Type", "Order");
     SetProperty("Integration Object", "SIS OM Order");
     SetProperty("Sync", "Y");
    }
    
    svcHeadlessConfServ.InvokeMethod("Apply Promotion Defaults", svcInputs,
  svcOutputs);
 
   } // end try
   catch(e)
   {
    errorMess = "Error in configurator: " + e.toString();
   }
 
   finally
   {
    Outputs.SetProperty("Error Message", errorMess);
    Outputs.SetProperty("Order Item Id", sAssetIntId);
    svcPromo  = null;
    svcHeadlessConfServ = null;
    OliBC   = null;
    OrderBC   = null;
    bcProduct  = null;
    OrderBO   = null;
   }
 
 
 
   return (CancelOperation);
  }

 

Cause

To view full details, sign in with your My Oracle Support account.

Don't have a My Oracle Support account? Click to get started!


In this Document
Symptoms
Cause
Solution
References


This document is being delivered to you via Oracle Support's Rapid Visibility (RaV) process and therefore has not been subject to an independent technical review.
My Oracle Support provides customers with access to over a million knowledge articles and a vibrant support community of peers and Oracle experts.