views:

8

answers:

1

Hi,

I would like to get all instances of a repeating action via a eScript bcAction query.

What I already found out about repeating actions:

  • I create an repeating action, repeat interval = daily
  • I can see multiple instances for this action in Siebel calendar applet.
  • If I query all actions by eScript, I get a single row for the repeating action, kind of the "template" of all repeating instances
  • If I modify a specific action instance via Siebel calendar, a new row is created for that instance.
  • If query all actions again, I get 2 actions which relate to the repeating action. The "template" and the modified instance.
  • When I open an unchanged repeating action instance in Siebel calendar and open Menu "Help -> About Record...", I see that the row id of the instance is somehow special, like a temporary rowid: 8SIA-81UT810/10/2010

So far, so good. Now I want to get all instances of the repeating action in eScript, whether they have been changed or not. Just like in the Siebel calender applet.

In Bookshelf I found a promising method:

CSSBCActivity.SetGridBeginEndDate(startDate, endDate)

It should set the business component into calendar mode. My hope is that by doing this, for all repeating action instances of the given time frame temporary action rows will be created, which I can query then.

var args = new Array(2);
args[0] = "10/01/2010";
args[1] = "10/31/2010";
bcActivity.InvokeMethod("SetGridBeginEndDate", args);
...
bcACtivity.ExecuteQuery(ForwardOnly);

However, executing the query fails with an exception "00/00/0000 cannot be converted to a timestamp". I traced the query and found the following:

SELECT ... FROM SIEBEL.S_EVT_ACT T1 ...
WHERE 
      ((T1.APPT_REPT_FLG = 'Y' AND (T1.APPT_REPT_END_DT IS NULL OR T1.APPT_REPT_END_DT >= '00/00/0000') AND T1.TODO_PLAN_START_DT < '01/02/,)/.' OR T1.TODO_PLAN_START_DT >= '00/00/0000' AND T1.TODO_PLAN_START_DT < '01/02/,)/.' AND T1.APPT_REPT_FLG = 'N' OR T1.TODO_PLAN_START_DT < '00/00/0000' AND T1.TODO_PLAN_END_DT >= '00/00/0000' AND T1.APPT_REPT_FLG = 'N') AND

There is obviously something wrong with some date literals here. So I bet I am doing something wrong. Any idea how to do it right? Thanks!

A: 

I found the error. The parameters of InvokeMethod must be passed like this:

bcActivity.InvokeMethod("SetGridBeginEndDate", "10/01/2010", "10/31/2010");

Getting the temporary instances of the repeating action works this way as expected. Cool!

nang