יום שלישי, 31 ביולי 2012

Explicit Write in Standard Interactivity


Offlately i am working on SI application and being bombarded by lot of user acceptance issues. I am not sure whether God is really happy or its just a clearance sale that most of the time we are able to find the fix. Recently we were being asked to implement explicit write sort of scenario in standard interactivity portal. In the detail applet for service request user didn't want to click Save button to save the record instead it was required as soon as details in the Description are filled record should auto save.

Again browser script comes to party. As browser script on standard events of Applet/BC doesn't work under SI architecture, only control level events are supported. Ever friendly Alex has beautifully explained the browser script architecture in his recent post. So idea here is to explicitly call the click event for "Save" button on the applet for OnChange event of Description column. Fortunately for us most of the fields on the applet were auto populated and read only so this solution is not that performance taxing.

However the key to this solution remains the HTML attribute property of the "Save" button control. As siebel generates its own SWE html ids(like s_1_1_6_0) so it becomes very important we give custom id to this button in order call it in other events. This can be achieved by adding below attributes to the control in tools.

HTML Atttribute: id=WriteRecord 

Once the id is associated with button control, we can easily call below code from OnChange event:

function Edit__0__Control__Description__onchange (applet, id)
{
if(document.getElementById(id).value != "")
{
document.getElementById("WriteRecord").click();
}
}

This approach though has some inherent disadvantages as this can be only used when controls/columns in the Form/list applet are less. Any other approach/idea/comment to achieve explicit write functionality in SI application is always welcome.

Happy Crunching!!





אין תגובות:

הוסף רשומת תגובה