EventMethod – a new way to enable the button.

OkAvarageGoodVery GoodExcellent (15 votes, average: 4.20 out of 5)
Loading ... Loading ...
Viewed : 13,085 times

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 :)

Related Posts

  • Ajay

    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…

  • Ajay

    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…

  • neel

    yes that is correct

  • neel

    yes that is correct

  • Ajay

    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?

  • Ajay

    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?

  • neel

    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

  • neel

    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

  • Ajay

    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

  • Ajay

    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

  • Pingback: Specialized method not supported SBL-DAT-00322 | Siebel Unleashed

  • Pingback: How to enable button – various ways. | Siebel Unleashed

  • Santhaa

    Neel,

    I Just tried, a quick way to make a New Button visible.

  • Santhaa

    Neel,

    I Just tried, a quick way to make a New Button visible.

  • http://GMAIL.COM/ MANISH

    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

  • http://GMAIL.COM MANISH

    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

  • neel

    Try login through dbisqlc.exe so that you are sure that there is no problem with dbf.

    I will suggest you to put the problem in Siebel forum as others might also be able to help you out the link to the forum is

    http://forum.siebelunleashed.com

  • neel

    Try login through dbisqlc.exe so that you are sure that there is no problem with dbf.

    I will suggest you to put the problem in Siebel forum as others might also be able to help you out the link to the forum is

    http://forum.siebelunleashed.com

  • Rahul

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

  • Rahul

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

  • neel

    I have tried it in 7.7 and 7.8

    on which version are you working..

  • neel

    I have tried it in 7.7 and 7.8

    on which version are you working..

  • Gaurav

    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?

  • Gaurav

    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?

  • Abhinav

    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.

  • Abhinav

    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.

  • Pingback: Getting User Input and Creating Records – Case Study | Siebel Unleashed

  • VR

    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?

  • VR

    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?

  • Pedro Prats

    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…

  • Pedro Prats

    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…

  • Pedro Prats

    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.

  • Pedro Prats

    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.

  • VerteX

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

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

  • VerteX

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

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

  • Raghu

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

    what to done for portal applications?

  • Raghu

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

    what to done for portal applications?

  • http://exploringsiebel.blogspot.com/ Tejeshwer

    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!

  • http://exploringsiebel.blogspot.com Tejeshwer

    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!

  • Sunny Sunday

    hi Neel,

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

    Thanks!

  • Sunny Sunday

    hi Neel,

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

    Thanks!

  • Guru

    Hi Neel,

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

    Thanks in Advance.

    Regards,
    Guru
    +91-9903008585

  • Guru

    Hi Neel,

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

    Thanks in Advance.

    Regards,
    Guru
    +91-9903008585

  • Bhaiji

    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.

  • Bhaiji

    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.

  • Amol Tandon

    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

  • Dilip

    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

  • SUNITHA

    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

  • neelmani

    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.

  • Scriptless Siebel
  • Product Configurator