Apply Promotion Does Not Add Default Products In Headless Mode
(Doc ID 1913404.1)
Last updated on MARCH 28, 2022
Applies to:
Siebel CRM - Version 8.1.1.6 [21233] and laterInformation in this document applies to any platform.
Symptoms
On : 8.1.1.6 [21233] version, Order Management
ISSUE CLARIFICATION:
--------------------------
Issue is customer is trying to create promotion products using headless mode. In this case, they are not able to see the default products defined at
the product level.
ACTUAL BEHAVIOR
---------------
Customer is trying to create promotion products using headless mode. In this case, they are not able to see the default products defined at the
product level
EXPECTED BEHAVIOR
-----------------------
Applying promotion should add default products defined at promotions as well as product level.
Step 1: Prepared the following product structure:
Product Name Default
CP 1
SP1 1
SP2 1
SP3 0
SP4 0
Create Promotion AXXXX Promo default as 1
Add CP to Promotion AXXXX Promo Default as 1
Drilldown on CP and define SP3 and SP4 default cardinality as 1
Identify the promotion id: 1-8XXS
Now Go to Quote-->Create New Quote and identify the quote id: i.e 1-8XXU
I tried to simulate the following business Service with below code:
Step 2: Crete script for simulation
Go to Administration Business Service
Create New Script: "ApplyPromotionCardinilaty"
Bottom Business Service Script create two following records:
1.Name:Service_PreInvokeMethod
Program Language: eScript
Copy the following script in script area:
function Service_PreInvokeMethod (MethodName, Inputs, Outputs)
{
if (MethodName == 'CreatePromotion')
{
CreatePromotion(Inputs,Outputs);
return (CancelOperation);
}
return (ContinueOperation);
}
2.
Name = (declarations)
Program Language: eScript
Copy the following script in script area:
function CreatePromotion(Inputs,Outputs)
{
var sQuoteId = Inputs.GetProperty("QuoteId");
var sProdId = Inputs.GetProperty("ProductId");
var QuoteBO = TheApplication().GetBusObject("Quote");
var OliBC = QuoteBO.GetBusComp("Quote Item");
var QuoteBC = QuoteBO.GetBusComp("Quote");
var bcProduct = "";
//TheApplication().RaiseErrorText(sQuoteId);
var svcInputs = TheApplication().NewPropertySet();
var svcOutputs = TheApplication().NewPropertySet();
//var errorMess = "OK";
var sAssetIntId = "";
with(QuoteBC)
{
SetViewMode(AllView);
ClearToQuery();
SetSearchSpec("Id",sQuoteId);
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");
}
}
}
var svcPromo = TheApplication().GetService("ISS Promotion Management
Service");
var svcHeadlessConfServ = TheApplication().GetService("Headless
Configuration Service");
with(svcInputs)
{
SetProperty("Active Document Id", sQuoteId);
SetProperty("Prod Prom Id", sProdId);
SetProperty("Qty", 1);
SetProperty("Prod Prom Instance Id",sAssetIntId);
SetProperty("Target Document", "Quote");
}
svcPromo.InvokeMethod("ApplyPromotion", svcInputs, svcOutputs);
with(svcInputs)
{
Reset();
SetProperty("Promotion Automatch", "Min Max Cardinality");
SetProperty("Document Id", sQuoteId);
SetProperty("Document Type", "Quote");
SetProperty("Integration Object", "SIS OM Quote");
SetProperty("Sync", "Y");
}
svcHeadlessConfServ.InvokeMethod("Apply Promotion Defaults", svcInputs,
svcOutputs);
}
Step 3:
========
Go to Methods: Create New Record name as "ApplyPromotionCardinilaty"
Crete the method: CreatePromotion
Crete following Method Arguments:
1. Name = ProductId,
Type: Input / Output
Storage Type: Property
2. Name =QuoteId
Type: Input / Output
Storage Type: Property
Step 4:
========
Go to simulator Cretae new record
ServiceName: ApplyPromotionCardinilaty
Method: 1
Input Arguments:
PropertyName: ProductId
PropertyValue: 1-8XXS
PropertyName : QuoteId
PropertyValue: 1-8XXU
Simulated the Service:
Results: Promotion created with following line items in Quote:
Promotion: Aditya Promo with Qty as 1
CP Qty as 1
SP3 Qty as 1
SP4 Qty as 1
Actual Result: SP1 and SP2 were not created, only SP3 and SP4 are getting
created.
Expected Result: Along with Promotion and CP, SP1 and SP2,SP3 and SP4 should get created.
BUSINESS IMPACT
-----------------------
The issue has the following business impact:
Due to this issue, users cannot do Apply Promotion when called through Workflow
Changes
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 |
Changes |
Cause |
Solution |
References |