EventMethod – a new way to enable the button.

This is nice trick that I came to know recently from Nidhi Puri a friend of mine working in siebel from past 2 years. Till now there were 2 ways known to me to enable a button on an applet in Siebel.

  • Scripting at PreCanInvoke event of Applet
  • Named Method n User property

But there is another way of enabling the button on applet apart from these two.

Just prefix EventMethod in front of the method name you have given and it will automatically enable the button example

If you create a button and give method name as CopyScript then change it to EventMethodCopyScript it will automatically enable the button. But you need to change the method name at BC level too. So at BC Level the scripting will change to

if(MethodName == “EventMethodCopyScript”)

Nice clean way to enable the button.

 Happy Siebel development 🙂

49 Responses to EventMethod – a new way to enable the button.

  1. u mean to say that if we give method name as “Hai” in applet control level then we need to use it as “EventMethodHai” in scripting..is that correct? please be clear…

  2. u mean to say that if we give method name as “Hai” in applet control level then we need to use it as “EventMethodHai” in scripting..is that correct? please be clear…

  3. but i didn’t work for me….My method name was “Remove” and in BC i have given it as
    if(MethodName == “EventMethodRemove”)..the button is not activated…did it work for u?

  4. but i didn’t work for me….My method name was “Remove” and in BC i have given it as
    if(MethodName == “EventMethodRemove”)..the button is not activated…did it work for u?

  5. You have to change the name at 2 places

    Applet : MethodName
    BC Scripting

    if your method was Remove then change Applet Method Name as EventMethodRemove

    It will activate the button if you have script associated with it then you will need to change the method name in scripting.

    Hope that clears how to do it

  6. You have to change the name at 2 places

    Applet : MethodName
    BC Scripting

    if your method was Remove then change Applet Method Name as EventMethodRemove

    It will activate the button if you have script associated with it then you will need to change the method name in scripting.

    Hope that clears how to do it

  7. Thankyou neel it is working fine now…Can u please tell me about the “Named Method n” user property to enable or disable a button..i havenot use that till now..Thanks in advance

  8. Thankyou neel it is working fine now…Can u please tell me about the “Named Method n” user property to enable or disable a button..i havenot use that till now..Thanks in advance

  9. I AM HAVING THIS ERROR WHILE I AM LOGGING TO SIEBEL TOOLS USING LOCAL DATABASE
    SBL-SEC-10018: You have entered an invalid set of logon parameters. Please type in your logon
    parameters again.(SBL-DAT-00446)
    Invalid user ID or password

  10. I AM HAVING THIS ERROR WHILE I AM LOGGING TO SIEBEL TOOLS USING LOCAL DATABASE
    SBL-SEC-10018: You have entered an invalid set of logon parameters. Please type in your logon
    parameters again.(SBL-DAT-00446)
    Invalid user ID or password

  11. Is this property work on specific version of Siebel Tools or with specific class. I tried but it doesnt work for me.

  12. Is this property work on specific version of Siebel Tools or with specific class. I tried but it doesnt work for me.

  13. HI, we r woking on Siebel 8.0.1
    We have chnaged the font for the whole application from 9 to 11.Now the problem is that the font of View Tabs is also increased and they are not properly visible in UI.Kindly help me in finding out the way?

  14. HI, we r woking on Siebel 8.0.1
    We have chnaged the font for the whole application from 9 to 11.Now the problem is that the font of View Tabs is also increased and they are not properly visible in UI.Kindly help me in finding out the way?

  15. Hey man this EventMethod is not working for me. I tried it just as R&D for enabling a button but it didn’t work.
    There is no script for that button.

  16. Hey man this EventMethod is not working for me. I tried it just as R&D for enabling a button but it didn’t work.
    There is no script for that button.

  17. i need to enable button on one view and need to disable to other views but applet is same in all the views..any idea, how can we do this through configuration?

  18. i need to enable button on one view and need to disable to other views but applet is same in all the views..any idea, how can we do this through configuration?

  19. there is a Applet User Property called CanInvokeMethod. Say you want to enable button Foo, which is invoking FooMethod method. Add a Applet User Property entry like this:
    Name: CanInvokeMethod : FooMethod
    Value: TRUE

    You may declare you want this method to be enabled depending on any expression. For example, only when record are showed:
    Value: [Id] IS NOT NULL

    Can’t think of a cleaner way to do this…

  20. there is a Applet User Property called CanInvokeMethod. Say you want to enable button Foo, which is invoking FooMethod method. Add a Applet User Property entry like this:
    Name: CanInvokeMethod : FooMethod
    Value: TRUE

    You may declare you want this method to be enabled depending on any expression. For example, only when record are showed:
    Value: [Id] IS NOT NULL

    Can’t think of a cleaner way to do this…

  21. VR: you could use the solution i provided earlier
    Add an Applet User Property like this:
    Name: CanInvokeMethod YourMethod
    Value: TheApplication().ActiveViewName() = YourEnabledButtonView

    I’m not sure ActiveViewName works there. If not use this on PreCanInvokeMethod of your applet:
    function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
    {
    var iReturn = ContinueOperation;

    if(MethodName==”YourMethod”){
    try{
    iReturn = CancelOperation;
    if(TheApplication().ActiveViewName() == “YourEnabledButtonView”) CanInvoke = “TRUE”;
    else CanInvoke = “FALSE”;
    }catch(e){}
    finally{}
    }

    return (iReturn);
    }

    tell me if any of it worked.

  22. VR: you could use the solution i provided earlier
    Add an Applet User Property like this:
    Name: CanInvokeMethod YourMethod
    Value: TheApplication().ActiveViewName() = YourEnabledButtonView

    I’m not sure ActiveViewName works there. If not use this on PreCanInvokeMethod of your applet:
    function WebApplet_PreCanInvokeMethod (MethodName, &CanInvoke)
    {
    var iReturn = ContinueOperation;

    if(MethodName==”YourMethod”){
    try{
    iReturn = CancelOperation;
    if(TheApplication().ActiveViewName() == “YourEnabledButtonView”) CanInvoke = “TRUE”;
    else CanInvoke = “FALSE”;
    }catch(e){}
    finally{}
    }

    return (iReturn);
    }

    tell me if any of it worked.

  23. >> Name: CanInvokeMethod YourMethod
    >> Value: TheApplication().ActiveViewName() = YourEnabledButtonView

    You should use GetProfileAttr (‘ActiveViewName’) instead.
    Value: GetProfileAttr (‘ActiveViewName’) = YourEnabledButtonView

  24. >> Name: CanInvokeMethod YourMethod
    >> Value: TheApplication().ActiveViewName() = YourEnabledButtonView

    You should use GetProfileAttr (‘ActiveViewName’) instead.
    Value: GetProfileAttr (‘ActiveViewName’) = YourEnabledButtonView

  25. EventMethod is working fine in thin client..
    but for protal is not working..

    what to done for portal applications?

  26. EventMethod is working fine in thin client..
    but for protal is not working..

    what to done for portal applications?

  27. Hi Neel, I just found that Named Method user property does not executes on CSSBusComp based BCs.

    I was configuring a button on a custom BC based on CSSBusComp but button was not becoming active .. then i just changed class to CSSBCBase .. button became active and running….

    Even user Event Method trick doesnt work on applet based on CSSBusComp class BCs.

    I think it is the simplest Class of Siebel BCs. can be quite usefull for thin BCs.

    Hope it helps somebody someday!

  28. Hi Neel, I just found that Named Method user property does not executes on CSSBusComp based BCs.

    I was configuring a button on a custom BC based on CSSBusComp but button was not becoming active .. then i just changed class to CSSBCBase .. button became active and running….

    Even user Event Method trick doesnt work on applet based on CSSBusComp class BCs.

    I think it is the simplest Class of Siebel BCs. can be quite usefull for thin BCs.

    Hope it helps somebody someday!

  29. hi Neel,

    did you ever try ‘EventMethod Enabled’ for conditionaly enabling / disabling button as its not working for me….

    Thanks!

  30. hi Neel,

    did you ever try ‘EventMethod Enabled’ for conditionaly enabling / disabling button as its not working for me….

    Thanks!

  31. Hi Neel,

    Could you please tell me how to change button caption dynamically.

    Thanks in Advance.

    Regards,
    Guru
    +91-9903008585

  32. What I observed is EventMethod only prevents that Specialized method error because I was able to configure enable/disable button with CanInvoke Method Applet UP itself and in Value column use Calc Field if wants to enable/disable on some condition. Remember this UP works with 1 or 2 Applet Classes only. But problem is when you will click on the button then it will throw specialized error so we need to use EventMethod but not for enablig/disabling.

  33. What I observed is EventMethod only prevents that Specialized method error because I was able to configure enable/disable button with CanInvoke Method Applet UP itself and in Value column use Calc Field if wants to enable/disable on some condition. Remember this UP works with 1 or 2 Applet Classes only. But problem is when you will click on the button then it will throw specialized error so we need to use EventMethod but not for enablig/disabling.

  34. EventMethod works with the CSSBCBase class and it's derived classes it was not working for CSSBusComp Please check at your end as well. Please let me know if I am wrong

  35. When we already have a Scripting option, then how this “EventMethod” is useful.

    It would be useful when we just give EventMethodxyz as method name in applet control level and with out scripting, then it would really help the developers

  36. Hi,

    I want a script to disable button in the upper applet when there are no records in the bottom applet.please can anyone help out for this

  37. It is not recommended to write this kind of script in Applet PreCanInvoke method.

    The only way to do this is to query on your child BC and see if it return any record for example

    GetBO
    GetBC(“Child BC”)
    execute query
    if(!firstrecord)
    CanInvoke = 'False';
    else
    CanInvoke = 'True'

    but this means that you are querying child BC lot of time which can result in performance issues.

    Try to get this requirement changed to display error message when you user clicks a button and no child records are present.

Leave a Reply

Contribute