views:

92

answers:

1

Hi all,

according to Siebel documentation, eScript supports varargs. The following sample is taken from the Siebel documentation:

function SumAll()
{
  var total = 0;
  for (var ssk = 0; ssk < SumAll.arguments.length; ssk++)
  {
    total += SumAll.arguments[ssk];
  }
  return total;
}

However, if I call this method like SumAll(1,2,3) I get the following exception:

TypeError: Can't convert 'Undefined' to Object. Service.SumAll line xxx

where xxx is the line number of the for statement.

Any idea, why? Thanks!

+1  A: 

Instead of typing "SumAll.arguments", try using just "arguments" like this:

function SumAll()
{
  var total = 0;
  for (var ssk = 0; ssk < arguments.length; ssk++)
  {
    total += arguments[ssk];
  }
  return total;
}
Mike M. Lin
Thanks, that works. However, I get a semantic warning "Undefined identifier arguments..." in Siebel Tools when saving this code. So I have two unpleasant options: Ignore the semantic warning and accept a nasty popup window whenever I save; or disable all semantic warnings inclusing useful ones (BusCop field does not exist, etc.). Or is there another option, like supressing certain warnings?
nang
Interesting. That's clearly a product defect, with the defect being either: 1) Siebel Tools and the Book Shelf documentation are wrong, or 2) The scripting engine doesn't behave as intended. I'd say your next steps are to log a service request through your Oracle TAM to get this product defect understood and fixed, then do whatever you can to get it to functionally work -- possibly in a way that won't break as soon as the defect is fixed (whatever the defect actually is).Running into product defects as a fairly good indicator that you're making good use of the features available to you ;)
Mike M. Lin