Showing posts with label Scriptless Solutions. Show all posts
Showing posts with label Scriptless Solutions. Show all posts

Monday, May 9, 2016

Auto Fix the Product structure in Quote/Order Line Items

There are situations when due to some business requirements you make changes in the existing Products/Promotions (configured in Administration – Products screen), may be you add a simple product at the second level hierarchy with a minimal cardinality as 1 or add some attribute with some pre-default value and so on.
So, in these kind of situations, while you are working on Asset based ordering (ABO) processes, on the existing Assets (which are based on such Promotions/Products where structure got changed), system doesn’t bring newly added product (in the hierarchy with min cardinality as 1) in the Quote/Order line item automatically, unless you open the Product Configurator window manually by clicking Customize button and then you will see a warning message there. Then you click on Accept button and after that click on Done button so that system fixes the Line items structure for you.
(Please note that we are just talking about fixing the “Default” structure of the complex product here)
So, bottom line is you have to open Product Configurator window to get it fixed. But what about the scenarios where ABO operations are performed by third party systems with the help of some web-services and no manual intervention would be there. How to get the Promotion/Product structure fixed in such situations?
And the answer is you can make use of headless configuration and achieve this using  RCOIS  business service: Remote Complex Object Instance Service (RCOIS)
So, here below are the steps that you can call as part of a sub-process:
(Let’s assume we are working on some Quote, and the quote line items structure would be fixed)




·        Load EAI
BS Name         :           ISS Copy Service
BS Method     :           LoadEAI
Input Arguments
Input Argument
Type
Value/Property Name
IntegrationObjectName
Literal
7.7 Quote Integration Object
(IO to query Quote)
ParentObjectId
Process Property
ActiveDocumentId
(Row Id of the Quote)
RootId
Process Property
RootId
(RowId of the Root quote line item)
SearchSpec
Expression
"[Header.Id] = '" + [&ActiveDocumentId] + "' AND [Line Item.Root Id] = '" + [&RootId] + "'"
Output Arguments
Property Name
Type
Output Argument/Value




·        Load Instance
BS Name         :           Remote Complex Object Instance Service
BS Method     :           LoadInstance
Input Arguments
Input Argument
Type
Value/Property Name
IntObjName
Literal
7.7 Quote Integration Object
ObjId
Process Property
ActiveDocumentId
RootId
Process Property
RootId
ExternalScript
Literal
Y
Output Arguments
Property Name
Type
Output Argument/Value




·        Get Instance
BS Name         :           Remote Complex Object Instance Service
BS Method     :           GetInstance
Input Arguments
Input Argument
Type
Value/Property Name
IntObjName
Literal
7.7 Quote Integration Object
ObjId
Process Property
ActiveDocumentId
RootId
Process Property
RootId
Output Arguments
Property Name
Type
Output Argument/Value




·        Sync Instance
BS Name         :           Remote Complex Object Instance Service
BS Method     :           SyncInstance
Input Arguments
Input Argument
Type
Value/Property Name
IntObjName
Literal
7.7 Quote Integration Object
ObjId
Process Property
ActiveDocumentId
RootId
Process Property
RootId
TriggerEvent
Literal
Y
Output Arguments
Property Name
Type
Output Argument/Value




·        Unload Instance
BS Name         :           Remote Complex Object Instance Service
BS Method     :           UnloadInstance
Input Arguments
Input Argument
Type
Value/Property Name
IntObjName
Literal
7.7 Quote Integration Object
ObjId
Process Property
ActiveDocumentId
RootId
Process Property
RootId
Output Arguments
Property Name
Type
Output Argument/Value




So, these small set of steps will help in achieving the same end result that you would achieve by manually clicking the “Customize” button on the UI, then “accept” the warning displayed in the Product Configurator window and then click “Done” button.


Thursday, July 25, 2013

How to get Carriage Return in Siebel Workflow?

I was working on a requirement where in one of the step in the Workflow using "Outbound Communications Manager" business service for sending an email using method "SendMessage". And depending upon the value of some process property, I need to add some more texts at the end of email body. 

The problem came in when I tried adding extra text using expression, the carriage return was not working like:

[&EmailBody] + "\n" + [&ExtraText]

So, easy way is to get the carriage return in a string process property and use it in the expression. The business service you can use :

Name : SSSE Address Parser (eScript)
Method: GetCRLF 


Saturday, December 22, 2012

How to add number of Hours to a Date Field


I am back with a very basic requirement which might looks very easy, but the solution might not be that easy to implement.

Requirement:
I have a Service Request form applet where I have following fields exposed on the UI:
  • Severity - LOV field values: a) 1-Critical b) 2-High c) 3-Medium d) 4-Low
  • Commit Date - Date Time field
Depending upon the Severity, being set by the user, system need to stamp the "Commit Date" field which is based on the calculation as per below table
If Severity Equals
Then SLA Hour =
Set Commit Date to [Created Date] + SLA Hour
1-Critical
10
[Created Date] + 10 Hours
2-High
20
[Created Date] + 20 Hours
3-Medium
30
[Created Date] + 30 Hours
4-Low
40
[Created Date] + 40 Hours
All this needs to happen whenever user changes the value for “Severity” field.

You can think of various ways to achieve this:
  1. The famous old method says extract the Year, Month, Date, Hours, Minutes and Seconds out of the “Created Date” field, get the SLA Hour depending upon the “Severity” value and do the calculation (add SLA Hour to the "Hours" variable ) and then combine the parts to get the date back. But the Problem with this method is, you need to be very careful with the calculation because while adding the "Hours" get exceeded by 24, then you need to increase the date by 1 and if then again adding 1 Day to the date reaches the month limit, you need to increase the month by 1 and so on ........................ problem, problem, problem :|
  2. I was also thinking to first convert the "Created Date" variable into "Seconds", then add the ("SLA Hour" * 60 * 60) to it and re-convert it back to Date. But didn't find the required function/methods available OOB for this in eScript. So, I dropped this idea as well.
So, the only tricky part here is how to get the number of “Hours” get added to a Date and after some of the experiment I was able to achieve it with some simple and easy method.

Here you go:
  1. Get the master data setup in the LOV:
  2. Create two calculated fields:
    Name
    Calculated
    Calc Value
    Type
    SLA Hour
    True
    LookupValue("SLA", [Severity])
    DTYPE_NUMBER
    Temp Commit Date
    True
    [Created] + ([SLA Hour]/24)
    DTYPE_DATETIME
  3. Check the “Immediate Post Changes” = True for field “Severity"
  4. Create a Business Component User Property:
Name       :           On Field Update Set
Value       :           "Severity", "Commit Date", "[Temp Commit Date]"

That’s it. Make sure you have the “Immediate Post Changes” checked for “Severity” and be careful about the “Type” for the two calculated field created, otherwise it won’t work.





Friday, August 19, 2011

How to update Child BC records on update of Parent BC record?

Siebel provides various ways of achieving the same solution, but you need to do the analysis beforehand to pick the right one. Recently I got one basic requirement that:

As soon as the Opportunity Sales Stage gets "Approved", all the Activities (Child of Opportunity) status should automatically set to "Approved".
Any Siebel Geek can offer multiple ways to achieve this solution:
1. Write a small script on "WriteRecord" event of the Opportunity business component.

2. People against scripting will not like Point#1 above and they might suggest to create a Workflow process with an Update operation on Action business component. And call this Workflow process in WriteRecord event of Opportunity or by Runtime event or by Workflow Policy.

3. Trigger a Workflow Policy when Opportunity Sales Stage = "Approved" which will call a WF Policy action with a program of type DB Operation.

I found another way of achieving the same solution (scriptless) and want to share with you. Using Data Validation Manager (DVM), you can achieve this as well. If you know how to update a field (SetFieldValue) using DVM, you might know what I am talking about.

Solution Details: 1. Navigate to Administration - Data Validation -> Rule Sets view.
2. Create a new record with the following data:

Name : Set Activity Approved
Business Component : Opportunity
Business Object : Opportunity

3. Drilldown on Rule Set Name.
4. Create new record under Rules view.

Sequence# : 1
Name : Set Status to Approve
Expression : [Status]="Approved"
Business Component : Action
Apply To : All Records
Return Code : Select any return code from the pick applet

5. Navigate to "Action" sub-view under the "Rules" view.
6. Create new record in Action applet:

Sequence# : 1
Type : Business Component
Business Component : Action
7. Create new record in "Field Values" applet
Field : Status
Value : Approved

8. Navigate to Administration - Data Validation -> Rule Sets view again and Activate the Rule set you just created.

9. Status changes to "Active".
10. Navigate to Administration - Runtime Events -> Action Sets view.
11. Create a new record:


Name : Activity Approved
Active : True
12. Create new action record:

Name : Call DVM
Action Type : BusService
Sequence : 1
Active : True
Business Service Name : Data Validation Manager
Business Service Method : Validate
Business Service Contect : "Rule Set Name", "Set Activity Approved", "Enable Log", "Y"
13. Navigate to Administration - Runtime Events -> Events view.
14. Create new record:

Sequence : -1
Object Type : BusComp
Object Name : Opportunity
Event : WriteRecord
Conditional Expression : [Sales Stage]="Approved"
Action Set Name : Activity Approved

15. Reload the runtime events.

You are done.

Now this is the time to test the solution:
1. Navigate to Opportunity -> Activities View.
2. Change the Sales Stage to "Approved".

3. See the change in activities status.