Download Video Tutorial of How to Enable logs for Siebel Dedicated Client | Next Tip »?

Recent Posts

Recent Comment


Browser Script and Cancel Operation

By neel | January 15, 2008

I have found requirements involving Browser Scripts in Siebel are always source of instability in Siebel. Every time I work on them I get to know a new fact about them.

Recently a friend of mine and I were working on a requirement involving Browser Script. Requirement as something like

Requirement:

When a user chooses a status of SR to Close Denied then show a OK - Cancel prompt asking user if he wish to continue or not.

It seemed simple enough and we thought at max 2 hrs. The solution we thought was

Solution:

Write browser script on Applet PreInovke method check for the value and show a prompt then based on user choice execute a return cancel operation. Pseudo code was something like

if(fieldval == “Close Denied”)
{
    var val = prompt(”Do you want to continue?”)
  
    if(val == false)
       {
           return(”CancelOperation”);
        }
}

Problem:

Executing cancel operation here didn’t make Business Component events to stop. SetFieldValue and WriteRecord were still being fired which resulted in values being set even if the user choose to cancel operation.

New Solution:

After struggling with various alternatives like moving the code change field value event and other variations of the code for 2 days we ended up writing code on BusComp browser Script event which finally worked.

This brings an interesting question before us.

What is the flow of events and what happens when we issue a return Cancel Operation in between events?

I don’t know yet but I intend to find out. If you have any idea please share it with us.

And now comments are not the only way to share you can register at Siebel Unleashed Forum and post your quesitons, suggestions and experience.

Keep Reading :)


OkAvarageGoodVery GoodExcellent (No Ratings Yet)
Loading ... Loading ...

Related Posts

Categories: Problem-Solutions, eScript |

6 Responses to “Browser Script and Cancel Operation”

  1. stuandgravy MonsterID Icon stuandgravy Says:
    January 15th, 2008 at 5:34 pm

    I wrote this for my reference a while ago: http://blog.stuandgravy.com/2007/07/19/order-of-events/. Gives some context, although it’s missing the BusComp_PreSetFieldValue browser script event.

  2. neel MonsterID Icon neel Says:
    January 15th, 2008 at 9:26 pm
    I did read that stuand,

    but here what I would like to explore what happens when you issue a cancel opeartion between events.

    Especially what happens when to the flow of browser script and server script at applet and BC level.

    I guess this can be added to explaination that you have compiled :)

  3. s.k.gautam MonsterID Icon s.k.gautam Says:
    January 16th, 2008 at 8:35 am

    dear gautam today i visited ur site u r working well i congratulate u and keep it up

  4. mbchellam MonsterID Icon mbchellam Says:
    January 18th, 2008 at 1:20 am

    Hi Neel,
    in your script you had written

    if(val == false)
    {
    return(”CancelOperation”);
    }

    in browser script, Siebel doesnt decode boolean operator if u dont specify in quotes. that means, if u say false instead of “false”, browser script will treat it as a variable. so in your condition, it wont go inside the if condition at all and thats y it didnt cancel your operation.

    Browser Script can communicate with Server script directly whereas server script cannot do it but we can achieve this functionality using profile attributes though it wont change the order of events in which siebel triggers.

  5. neel MonsterID Icon neel Says:
    January 18th, 2008 at 1:27 am
    You might be quite right about this chellam.

    I will try it and will let all know if this was the reason for the script not working.
    Thanks a lot for this info :) Will keep it in mind for future

  6. SiebPaul MonsterID Icon SiebPaul Says:
    March 7th, 2008 at 8:48 am

    Your initial approach was doomed to fail because CancelOperation is being returned to the Applet Object which as nothing to do with saving records. Your eventual solution was on the BusComp which is the correct place for preventing methods like WriteRecord from firing.

    Regards,
    Paul

Comments