Join Fribiz, place bids and win prizes | Next Tip »Home

EventMethod – a new way to enable the button.

OkAvarageGoodVery GoodExcellent (10 votes, average: 4.20 out of 5)
Loading ... Loading ...

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


Article by neel

Authors bio is coming up shortly. neel tagged this post with: , Read 416 articles by neel
View Comments Post a Comment
  1. Ajay says:

    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. neel says:

    yes that is correct

  3. Ajay says:

    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. neel says:

    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

  5. Ajay says:

    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

  6. [...] a button on applet with method name as “MyMethod” *You can also use technique described in EventMethod Post of renaming method name to EventMethodMyMethod which will help you to eliminate scripting at Applet [...]

  7. [...] is the latest and simplest of all methods to enable the button. You can read in detail in the following post about Event [...]

  8. Santhaa says:

    Neel,

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

  9. MANISH says:

    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. neel says:

    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

  11. Rahul says:

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

  12. neel says:

    I have tried it in 7.7 and 7.8

    on which version are you working..

  13. Gaurav says:

    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. Abhinav says:

    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.

  15. [...] Create a button control on this Applet and set the Method Invoked to EventMethodCreateOpty.   Note: I used this method name so that I don’t have script in PreCanInvoke method enable the button. To get more details about this method read the following post. [...]

  16. VR says:

    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?

  17. Pedro Prats says:

    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…

  18. Pedro Prats says:

    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.

  19. VerteX says:

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

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

  20. Raghu says:

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

    what to done for portal applications?

  21. Tejeshwer says:

    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!

  22. Sunny Sunday says:

    hi Neel,

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

    Thanks!

  23. Guru says:

    Hi Neel,

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

    Thanks in Advance.

    Regards,
    Guru
    +91-9903008585

  24. Bhaiji says:

    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.

  25. Amol Tandon says:

    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

  26. Dilip says:

    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

  27. SUNITHA says:

    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

  28. neelmani says:

    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.

blog comments powered by Disqus

Polls

Do you know how to use replace function?

    What are you talking about? (42%, 38 Votes)
    Yes, I have used it few times. (23%, 21 Votes)
    No, I only have heard about it. (23%, 21 Votes)
    Yes, I use it all the time. (12%, 11 Votes)

Total Voters: 91

Loading ... Loading ...