Wednesday, August 12, 2009

How to do a SetFieldValue on a ReadOnly field on an Applet?

yaa... I know this sounds something interesting so please now stop scratching your head, today I will tell a unique trick by which you can do a SetFieldValue on a field on an applet which is actually displayed as ReadOnly on the UI. Let me reiterate : We want to change the value of a field which is ReadOnly on the Applet, NOT on Business Component. Special Thanks to Amol, my colleague, for bringing this up.

First of all : "Why we need this trick?". Sometimes it happen that for testing purpose Developers/QA people need to set a value in Field but if that is ReadOnly on the applet, what we generally do is just fire a SQL query in the database to set its value and do whatever we want OR you can write a small piece of code in Business Service and simulate it to just solve the purpose temporarily. Here below is a trick by which you can do this without much of effort.

Here below is the screenshot which displayes we have field : "Description" readonly on the UI. And the requirement is set its value to "SiebelMantra".

Here is the solution :
Just copy paste the below text into Address bar :
javascript: alert(theApplication().ActiveBusObject().GetBusComp("Action").SetFieldValue("Description", "SiebelMantra"))

I don't think to explain what we have typed in Address bar, if you already aware how to write browser scripts in Siebel. You can use it further as per your need. Try it !!



  1. Yes Gaurav, its a very quick way to edit fields.. i had made such scripts and added them as favorites in IE... now whenever i need them i just click on the favorite.. hav a look at this..

  2. Thankyou Tejeshwer for posting the link. Its really nice and good to see some more examples there.

  3. really good article...

  4. Nice one GG... Keep it up.... :)

  5. Any thoughts on how to block this or at least catch this before allowing this to happen in browser-script?

    Found out by accident that you can update a read-only applet through browser script just like your provided code: theApplication().ActiveBusObject().GetBusComp("Action").SetFieldValue("Description", "SiebelMantra"))

    If I can't block the updating of the ActiveBusObject component in browser script, I'd like to find a way to at least check the component or field before I do the SetFieldValue.