‏הצגת רשומות עם תוויות Automation. הצג את כל הרשומות
‏הצגת רשומות עם תוויות Automation. הצג את כל הרשומות

יום שלישי, 15 בינואר 2013

How to time trigger workflows through command prompt

If you have workflows in your CRM system that are required to be run everyday, but for some reason you are running them manually, this might be a good solution for you to save some time.

This solution demonstrates how you can trigger your Siebel workflows at specific intervals of time on windows. For, Siebel environments on other operating systems, you will have to create a solution similar to this, the only difference being the batch file will have to be written in shell (for Linux/Unix) or the programming language that is supported by the OS.

Step 1 - Write the batch file

Copy the below code in a text file and save it with the .bat extension

::Set Localization
  setlocal
::Gets The Parameters and sets into Environment Variables
   set GTYSRV=%1
   set ENTSRV=%2
   set SIEBSRV=%3
   set SIEBUSR=%4
   set SIEBPWD=%5
  
chdir C:\sia81\siebsrvr\BIN
  
   :: The workflow process name
   set wf=Test Workflow
   set command=run task for comp WfProcMgr with ProcessName='%wf%'
   c:\sia81\siebsrvr\bin\srvrmgr /g %GTYSRV% /e %ENTSRV% /s %SIEBSRV% /u %SIEBUSR% /p %SIEBPWD% /c "%command%"


This will connect to the siebel server via the command prompt and call the "Test Workflow" Workflow process.

Step 2 - Schedule the batch file

The next step would be to schedule the workflow process to run at a certain interval in the day. On windows you will need to schedule this through the Windows task scheduler. On Linux/Unix you will probably have to use crontab.

How to schedule a task in windows

How to schedule a task via Crontab

Note: You will have to add the following parameters in the Add Parameters section each separated by a space.

<ENTSRV> <SIEBSRV> <SIEBUSR> <SIEBPWD>

example: Siebel81G siebelDev siebelDev sadmin sadmin@123

יום חמישי, 31 במאי 2012

Generate Quote using Narrative Reports in CRM On Demand

Hey Guys,

One thing we all think about is how to design a simple solution to a complicated requirement and so today lets see how to create a Narrative report for a 1:M relation. As you may know Narrative Report can be used only on one record. But, using a combination of reports, we can do the a LOT more!

All we need to do is create 2 reports linked to each other and add them to a Dashboard. let me show you how.

Step 1: Create a Opportunity Parent Report

Using Opportunities Subject Area (Reporting  or Real-Time) Add the fields you would like to use on the Opportunity Information Section of the Quote report.














In Step 2: Create Layout, Add a Narrative View and use the this code
Opportunity Parent Narrative View Code. Make sure you use the @"Number" symbol in the right places, or the values would display against the wrong columns.











You'll notice that the values are not correct in this preview, don't worry. since this report is not being filtered from the Prompt yet, the right values do not appear.

Save the report

Step 2:  Create a Opportunity Product Report










Using Opportunity Product Revenues Subject Area (Reporting  or Real-Time) Add the fields you would like to use on the Product List.
Note that I am filtering the contents of this report based on the results of the Opportunity Parent Report.
In Step 2: Create Layout, Add a Table or Pivot Table (Whichever works for you) and a Narrative View and use the this code Opportunity Parent Product Narrative View Code.




















You'll notice that the values are not correct in this preview, don't worry. since this report is not being filtered from the parent yet, the right values do not appear.

OK. Save the Report.

Step 3: Create a Dashboard

Create a New Dashboard and give it a name. In the Design Section add both the above reports.











Save the Dashboard.

Step 4: Create a Web Link (Last Step)

Create a Web Link on  Opportunity and in the URL text area, add the link to your Dashboard you created in Step 3. You can get the URL by Viewing the Source Code

Ex: https://secure-ausomxxxx.crmondemand.com/OnDemand/user/analytics/saw.dll?Dashboard&PortalPath=%2fshared%2fCompany_XXXXX_Shared_Folder%2f_portal%
2fOpportunityQuote+Report&Options=rfd&Action=Navigate&P0=1&P1=eq&P2=Opportunity%2E%22Opportunity%20ID%22&P3=%%%Id%%%

The %%%Id%%% will dynamically change on clicking the Web-Link from your Opportunity Detail Page and display the Opportunity and Opportunity Product Information on your Quote Report


Make sure you test the URL by Adding a Opportunity ID and running the URL in your browser.

After creating the Web-Link, add it onto your Opportunity Layout.


Finally: Let's see how this report works in reality.

Goto any Opportunity that has at least One Product associated











Now click the "Generate Quote" link that you added. You should now see your Opportunity and Opportunity Product Information in a beautifully formatted Quote Report.




















Now, it's time for you to go and impress your customers!

If you have any questions about the post, feel free to add your comments!

Cheers!
Ryan

Automate Siebel EIM Mapping using SQL

Hey Everybody,

Hope you all are doing Great!

It's been a long time since my last post, apologies for that! Anyway, I have decided to make up for that time and give you some great stuff!

Recently, I had a LOT of people asking for a way to Automatically generate EIM Mappings. I have written a post previously called Generate EIM mapping using SQL Script. However I made some new changes that will give you more information than before.

So here are the updated versions for Oracle and MS SQL

Output Preview











Document Links : Do what the document tells you are you're good!

Automate Siebel EIM Mapping using SQL_MSSQL
Automate Siebel EIM Mapping using SQL_Oracle

Watch out for more interesting Stuff!


Cheers!
Ryan


יום שישי, 26 באוגוסט 2011

Generating Data to UI mappings in Siebel just got easier!

This is one of those tasks which is fairly simple to do. However, can be very time consuming considering you have to generate a mapping for an entire/multiple repositories. We've all have had to do this at some point, not enjoying it one bit!

Well, here is a code that will save you some time and your sanity :).

The below code generates a screen to Applet, and an Applet to BC mapping which can be then exported to excel.


Screen to Applet - 


select scr.name "Screen Name"
      ,nvl(nvl(ptabi.tab_text, scri.viewbar_text), scr.viewbar_text) "Screen"
      ,scrv.sequence "View Seq"
      ,vw.name "View Name"
      ,vwi.title "View"
      ,vw.busobj_name "Business Object"
      ,vwti.item_num "Item Num"
      ,ap.name "Applet Name"
      ,api.title "Applet"
      ,ap.buscomp_name "Business Component"
from   siebel.s_repository rep
       inner join siebel.s_screen scr on scr.repository_id = rep.row_id
       left outer join siebel.s_screen_intl scri on scri.screen_id = scr.row_id and scri.repository_id = rep.row_id and scri.name = 'ENU-STD'
       inner join siebel.s_screen_view scrv on scrv.screen_id = scr.row_id and scrv.repository_id = rep.row_id
       inner join siebel.s_application appl on rep.row_id = appl.repository_id
       left outer join siebel.s_page_tab ptab on ptab.application_id = appl.row_id and ptab.repository_id = rep.row_id and ptab.screen_name = scr.name
       left outer join siebel.s_page_tab_intl ptabi on ptabi.page_tab_id = ptab.row_id and ptabi.repository_id = rep.row_id and ptabi.name = 'ENU-STD'
       inner join siebel.s_view vw on vw.name = scrv.view_name and vw.repository_id = rep.row_id
       left outer join siebel.s_view_intl vwi on vwi.view_id = vw.row_id and vwi.repository_id = rep.row_id and vwi.name = 'ENU-STD'
       inner join siebel.s_view_web_tmpl vwt on vwt.view_id = vw.row_id and vwt.repository_id = rep.row_id
       left outer join siebel.s_view_wtmpl_it vwti on vwti.view_web_tmpl_id = vwt.row_id and vwti.repository_id = rep.row_id
       inner join siebel.s_applet ap on ap.name = vwti.applet_name and ap.repository_id = rep.row_id
       left outer join siebel.s_applet_intl api on api.applet_id = ap.row_id and api.repository_id = rep.row_id and api.name = 'ENU-STD'
where  rep.name = 'Siebel Repository'
and    appl.name = 'Siebel Power Communications'
and    nvl(rep.inactive_flg,'N') = 'N'
and    nvl(scr.inactive_flg,'N') = 'N'
and    nvl(scri.inactive_flg,'N') = 'N'
and    nvl(scrv.inactive_flg,'N') = 'N'
and    nvl(vw.inactive_flg,'N') = 'N'
and    nvl(vwi.inactive_flg,'N') = 'N'
and    nvl(vwt.inactive_flg,'N') = 'N'
and    nvl(vwti.inactive_flg,'N') = 'N'
and    nvl(ap.inactive_flg,'N') = 'N'
and    nvl(api.inactive_flg,'N') = 'N'
union
select scr.name "Screen Name"
      ,nvl(nvl(ptabi.tab_text, scri.viewbar_text), scr.viewbar_text) "Screen"
      ,scrv.sequence "View Seq"
      ,vw.name "View Name"
      ,vwi.title "View"
      ,vw.busobj_name "Business Object"
      ,vwti.item_num "Item Num"
      ,apta.name "Applet Name"
      ,api.title "Applet"
      ,apta.buscomp_name "Business Component"
from   siebel.s_repository rep
       inner join siebel.s_screen scr on scr.repository_id = rep.row_id
       left outer join siebel.s_screen_intl scri on scri.screen_id = scr.row_id and scri.repository_id = rep.row_id and scri.name = 'ENU-STD'
       inner join siebel.s_screen_view scrv on scrv.screen_id = scr.row_id and scrv.repository_id = rep.row_id
       inner join siebel.s_application appl on rep.row_id = appl.repository_id
       left outer join siebel.s_page_tab ptab on ptab.application_id = appl.row_id and ptab.repository_id = rep.row_id and ptab.screen_name = scr.name
       left outer join siebel.s_page_tab_intl ptabi on ptabi.page_tab_id = ptab.row_id and ptabi.repository_id = rep.row_id and ptabi.name = 'ENU-STD'
       inner join siebel.s_view vw on vw.name = scrv.view_name and vw.repository_id = rep.row_id
       left outer join siebel.s_view_intl vwi on vwi.view_id = vw.row_id and vwi.repository_id = rep.row_id and vwi.name = 'ENU-STD'
       inner join siebel.s_view_web_tmpl vwt on vwt.view_id = vw.row_id and vwt.repository_id = rep.row_id
       left outer join siebel.s_view_wtmpl_it vwti on vwti.view_web_tmpl_id = vwt.row_id and vwti.repository_id = rep.row_id
       inner join siebel.s_applet ap on ap.name = vwti.applet_name and ap.repository_id = rep.row_id
       inner join siebel.s_applet_toggle apt on apt.applet_id = ap.row_id and apt.repository_id = rep.row_id
       inner join siebel.s_applet apta on apta.name = apt.applet_name and apta.repository_id = rep.row_id
       left outer join siebel.s_applet_intl api on api.applet_id = apta.row_id and apta.repository_id = rep.row_id and api.name = 'ENU-STD'
where  rep.name = 'Siebel Repository'
and    appl.name = 'Siebel Power Communications'
and    nvl(rep.inactive_flg,'N') = 'N'
and    nvl(scr.inactive_flg,'N') = 'N'
and    nvl(scri.inactive_flg,'N') = 'N'
and    nvl(scrv.inactive_flg,'N') = 'N'
and    nvl(vw.inactive_flg,'N') = 'N'
and    nvl(vwi.inactive_flg,'N') = 'N'
and    nvl(vwt.inactive_flg,'N') = 'N'
and    nvl(vwti.inactive_flg,'N') = 'N'
and    nvl(ap.inactive_flg,'N') = 'N'
and    nvl(api.inactive_flg,'N') = 'N'
order by "Screen"
        ,"View Seq"
        ,"View Name"
        ,"Item Num"
        ,"Applet Name"


Output looks like -








Applet to BC mapping -

select  "Applet Name"
,"BC Name"
,"BC Field"
,"Required"
,"Calculated"
,"Calculated Value"
,"Join Name"
,"Table"
,"Column"
,"Data Type"
,"Length"
,"Multi-valued"
,"MV Link"
,"Pick List"
,"LOV Name"
,min("Caption") "Caption"
,"Display Order"
from (
select ap.name "Applet Name"
      ,bc.name "BC Name"
      ,fld.name "BC Field"
      ,fld.required "Required"
      ,fld.calculated "Calculated"
      ,fld.calcval "Calculated Value"
      ,fld.join_name "Join Name"
      ,(case when fld.mvlink_name is null then nvl(nvl(jotab.name, fld.join_name), case when fld.calculated = 'Y' then null else bc.table_name end) else null end) "Table"
      ,fld.col_name "Column"
      ,fld.type "Data Type"
      ,(case when fld.prec_num is null then to_char(fld.textlen)
             else to_char(fld.prec_num) || to_char(case when fld.scale is null or fld.scale = 0 then '' else ',' || fld.scale end)
        end) "Length"
      ,fld.multi_valued "Multi-valued"
      ,fld.mvlink_name "MV Link"
      ,pl.name "Pick List"
      ,pl.type_value "LOV Name"
      ,coi.caption "Caption"
      ,co.sequence "Display Order"
from   siebel.s_control co
       inner join siebel.s_control_intl coi on coi.control_id = co.row_id and coi.name = 'ENU-STD'
       inner join siebel.s_applet ap on co.applet_id = ap.row_id
       inner join siebel.s_buscomp bc on ap.buscomp_name = bc.name
       inner join siebel.s_field fld on fld.name = co.field_name and fld.buscomp_id = bc.row_id
       inner join siebel.s_repository rep on bc.repository_id = rep.row_id
       left outer join siebel.s_join jo on jo.buscomp_id = fld.buscomp_id and fld.join_name = jo.name
       left outer join siebel.s_table jotab on jotab.name = jo.dest_tbl_name and jotab.repository_id = rep.row_id
       left outer join siebel.s_picklist pl on fld.picklist_name = pl.name and pl.repository_id = rep.row_id
where  rep.name = 'Siebel Repository'
and    ap.repository_id = rep.row_id
and    co.repository_id = rep.row_id
and    bc.repository_id = rep.row_id
and    fld.repository_id = rep.row_id
and    nvl(co.inactive_flg,'N') = 'N'
and    nvl(ap.inactive_flg,'N') = 'N'
and    nvl(bc.inactive_flg,'N') = 'N'
and    nvl(fld.inactive_flg,'N') = 'N'
and    nvl(rep.inactive_flg,'N') = 'N'
and    nvl(jo.inactive_flg,'N') = 'N'
union all
select ap.name "Applet Name"
      ,bc.name "BC Name"
      ,fld.name "BC Field"
      ,fld.required "Required"
      ,fld.calculated "Calculated"
      ,fld.calcval "Calculated Value"
      ,fld.join_name "Join Name"
      ,(case when fld.mvlink_name is null then nvl(nvl(jotab.name, fld.join_name), case when fld.calculated = 'Y' then null else bc.table_name end) else null end) "Table"
      ,fld.col_name "Column"
      ,fld.type "Data Type"
      ,(case when fld.prec_num is null then to_char(fld.textlen)
             else to_char(fld.prec_num) || to_char(case when fld.scale is null or fld.scale = 0 then '' else ',' || fld.scale end)
        end) "Length"
      ,fld.multi_valued "Multi-valued"
      ,fld.mvlink_name "MV Link"
      ,pl.name "Pick List"
      ,pl.type_value "LOV Name"
      ,coi.display_name "Caption"
      ,co.sequence "Display Order"
from   siebel.s_list li
       inner join siebel.s_applet ap on li.applet_id = ap.row_id
       inner join siebel.s_list_column co on co.list_id = li.row_id
       left outer join siebel.s_list_col_intl coi on coi.list_column_id = co.row_id and coi.name = 'ENU-STD'
       inner join siebel.s_buscomp bc on ap.buscomp_name = bc.name
       inner join siebel.s_field fld on fld.name = co.field_name and fld.buscomp_id = bc.row_id
       inner join siebel.s_repository rep on bc.repository_id = rep.row_id
       left outer join siebel.s_join jo on jo.buscomp_id = fld.buscomp_id and fld.join_name = jo.name
       left outer join siebel.s_table jotab on jotab.name = jo.dest_tbl_name and jotab.repository_id = rep.row_id
       left outer join siebel.s_picklist pl on fld.picklist_name = pl.name and pl.repository_id = rep.row_id
where  rep.name = 'Siebel Repository'
and    li.repository_id = rep.row_id
and    ap.repository_id = rep.row_id
and    co.repository_id = rep.row_id
and    bc.repository_id = rep.row_id
and    fld.repository_id = rep.row_id
and    nvl(li.inactive_flg,'N') = 'N'
and    nvl(co.inactive_flg,'N') = 'N'
and    nvl(ap.inactive_flg,'N') = 'N'
and    nvl(bc.inactive_flg,'N') = 'N'
and    nvl(fld.inactive_flg,'N') = 'N'
and    nvl(rep.inactive_flg,'N') = 'N'
and    nvl(jo.inactive_flg,'N') = 'N'
)
group by  "Applet Name"
,"BC Name"
,"BC Field"
,"Required"
,"Calculated"
,"Calculated Value"
,"Join Name"
,"Table"
,"Column"
,"Data Type"
,"Length"
,"Multi-valued"
,"MV Link"
,"Pick List"
,"LOV Name"
,"Display Order"
order by "Applet Name"
        ,"BC Name"
        ,"MV Link" desc
        ,"Table"
  ,"Display Order"

Output looks like -








So there you go...you could later consolidate both to have a full UI to Data level mapping.

Oh! Almost forgot, Your welcome ;)

Cheers!

יום חמישי, 14 ביולי 2011

How to Integrate Google maps with Siebel for multiple addresses

A few days back a client asked me if we could have Google maps integrated with their Siebel application, that would enable their reps to locate their contacts/accounts on Google maps, and find the best way to reach them based on their mode of commute. Initially, they had planned to do this for single addresses. However, I tried to convince them to go for multiple address selection.

The key business driver here in my opinion would be that, the user can optimize his/her travel route based on the proximity of his/her reps, thus saving time and money. Google maps also offers a few more features like checking for traffic, avoiding tolls, taking highways etc.

Google maps is really cool, and integrating it with Siebel makes it cooler ;)

Really!! show me how?

Step 1: The first step would be to get the Google map applet setup on your Siebel application. There are many ways to do this. For this example lets go with Mash-up your CRM with Google maps in < 30 minutes.

Step 2: Once you have this setup, just copy the below script on the contact/ account list applet or where ever you would like to have this integrated.

The below script will automatically refresh your Google map to give you a route of your selected contact addresses and will plot A, B, C pins on the map. Alternatively, you could also use a button to invoke this script.

Script -

 

































Step 3: Make sure you change the field names in the script to match your contact BC. 
Step 4: Compile and test!

This is what map would look like






















Almost forgot, Thanks to Benny and Alex for their post on Siebel Essentials

Cheers!

יום רביעי, 25 במאי 2011

Multiple Email Validation Script in Siebel

This post is a result of my sheer frustration for not getting this right in a 100 tries. I had been trying to validate the email addresses being entered in Siebel. I tried a lot of ways to get it to work (Data Validation Manager, Runtime events, Configuration etc) but the darn thing would just not work. I had to ultimately resort to the "boo hoo"- Script!

I thought this would be useful for a lot of Siebel guys out there, will save you from all that frustration.(Checks/validates for a comma separated list of emails as well)

Code:

function BusComp_PreWriteRecord ()
{
    try
    {
        this.ActivateField("Email Address");
        if (this.GetFieldValue("Email Address") != "")
        {
            var sEmail = this.GetFieldValue("Email Address");
            var sPattern = /((\w+([-+.']\w+)*@\w+([-.]\w+)*\.\w+([-.]\w+)*)*([, ])*)*/;
            var isValid = sEmail.replace(sPattern,"Y");
            if(isValid != "Y")
            {
                TheApplication().RaiseErrorText("Please enter a valid email address");
                return (CancelOperation);
            }
            else
                return (ContinueOperation);
            }
        else
            return (ContinueOperation);
    }
    catch (e)
    {
        throw (e);
    }
    finally
    {
        sEmail = null;
        sPattern = null;
        isValid = null;
    }
}

And last but not least. I must give credit to this post which was the only one that actually worked for me. 
Regular ​Expression ​for ​multiple ​email ​validation

Tip: It is advisable to try out string manipulation, validation scripts in a script simulator before coding it in Siebel. Saves you a lot of time and effort.(for eScript you could use the W3Schools JavaScript Simulator)

Cheers!