July 16, 2013

SBL-SCR-00128 : Script compilation failed at line Expected '}'


Siebel Tools Error

Script compilation failed at line 36 in procedure 'BusComp_WriteRecord':
Syntax error at Line 368 position 35:Expected '}'
(SBL-SCR-00128)


This is one of the compile time error which can waste a lot of time, the worst thing about this error is that it does not indicate the actual problem and point to unrelated section of the code.


This error can occur because of multiple reasons, and can force developer to check the whole code. Some of tips that one can use to resolve this error are:


  1. Check for Semicolons(;) after end of every statement in script. It is possible to leave assignment statement without semicolons.
  2. Go to last updated script of the object and try to find syntax errors line by line.
  3. Verify all if statements, all must have at least single statement to execute if condition is true.
  4. Verify all for and while loops and make sure all have some exit clause.
Although this error could be due to a product defect in ST script engine, In my case I was able to resolve this error by from point 1,2 and 3. Please feel free to share your experience with this error.



This error can also come in another form for IP2014:

SBL-SCR-00128 : Not All Control Paths Lead To A Return Statement

It is easily resolvable by unchecking the Deduce Type scripting option flag in Siebel Tools, read more here.

Hope it helps.

2 comments :

  1. Hi Team,
    Can anyone find out the syntax error in this code:
    function DelResp()
    {
    /************************************
    Set Responsibility and Employee Status
    for already Terminated users
    ************************************/
    try
    {
    var tEmpBO = TheApplication().GetBusObject("Employee");
    var tEmpBC = tEmpBO.GetBusComp("Employee");
    var rCnt;
    with (tEmpBC)
    {
    InvokeMethod("SetAdminMode", "TRUE");
    SetViewMode(AllView);
    ClearToQuery();
    ActivateField ("Responsibility");
    ActivateField ("Termination Date");
    ActivateField("Employment Status");
    SetSearchSpec("Termination Date","IS NOT NULL");
    ExecuteQuery();
    rCnt= CountRecords();
    if (FirstRecord())
    {
    var RespMVG = GetMVGBusComp("Responsibility");
    // Set Responsibility to Empty
    with (RespMVG)
    {
    InvokeMethod("SetAdminMode", "TRUE");
    SetViewMode(AllView);
    ClearToQuery();
    ExecuteQuery();
    while (FirstRecord())
    {
    DeleteRecord();
    }
    }
    SetFieldValue ("Employment Status","Terminated");
    WriteRecord();
    }
    }
    }
    cache (e)
    {
    TheApplication().RaiseErrorText("Error: " + e.toString());
    }
    finally
    {
    return (rCnt);
    }
    }

    ReplyDelete
  2. Hi Anonymous,
    You have wrong spelling of catch block. It should not be cache

    ReplyDelete