Monday, 2 February 2015

Siebel Open UI: What you can Get from Applet PM

Have you ever wondered what are all the objects, functions, arrays, constants and values we can Get and make use in an Applet PM or PR file. Well, I tried to find out all the functions and variables we can use for rendering and business logic in Open UI. 

I am talking about Get function in PM which can be accessed from PR also (using this.GetPM() function). There are many variables which can be retrieved from an Applet PM. By digging down to the JavaScript files, I finally found the list of variables that can be obtained from Applet. Below is the list of all the variables. This is not the complete list. Based on type of applets (List, Tree, Calendar etc), the list grows. But these are common list of variables.


"GetName","GetId","GetVarName","GetFullId","GetTitle","GetControls","GetActiveControl","GetSelection","GetRecordSet","GetDefaultFocusOnNew","GetAppletSummary","GetAppletLabel","IsInQueryMode","GetQueryModePrompt","GetDefaultFocusOnQuery","GetMapFields","GetPrsrvControl","GetUIEventMap","IsPure","GetScrollDir","GetScrollAmount","GetMode","GetBusComp","GetRowListRowCount","GetWSEndRowNum","GetNumRows","IsNumRowsKnown","GetObjectType","GetRepstrName","GetUIName","GetRawRecordSet","GetParentApplet","IsActive","IsEditable","HasPickError"

Now I tried to get all the variables in a debug window and see what these variables hold. Here is the screenshot.




Well, most of the names are self explanatory. I have explained few functions below. 

GetName : gets the applet name. 
GetId : gets the applet order in the view (1 from top)
GetFullId : gets the applet's html id
GetTitle: gets the applet title defined in Tools
GetControls: gets the controls objects in the applet (I will discuss about the control objects in another post)

GetActiveControl : gets the active control object

GetSelection: gets the index of selected record starting from 0 for first record
GetRecordSet: Array of records in the applet

GetRawRecordSet : Array of records in the applet including the hidden columns

GetMode: gets applet mode like Base, Edit, Edit List
GetBusComp: gets the buscomp object. This is very useful for doing business layer logic

GetRowListRowCount: gets the max number of records that can be shown in applet. This is applet's HTML no of rows property. If we click on show more, this value changes in list applet
GetNumRows: Get the number of rows showing in the applet. This is not the record count of all the records in the applet.
IsActive : if the applet is selected applet in the view, it returns true
IsInQueryMode: true if applet is in query mode

You can test this in browser console. Refer below.





I am still trying to find out about other variables and functions. I will keep posting about this. 

I have created a code snippet to get all the properties for an Applet. Check this out Post on Get Properties

6 comments:

  1. Hi,

    Is there any method to find all the List columns(available and un available columns) and their values?

    Thanks,
    Dinesh kothuru

    ReplyDelete
  2. Hi,

    Is it possible to query on a BC using Javascript?

    And Btw, can you provide the basic syntax for GetBusComp in the PM file? I am struggling to do that.

    Thanks
    Bharath

    ReplyDelete
  3. Hi,

    Is it possible to query on a BC using Javascript?

    And Btw, can you provide the basic syntax for GetBusComp in the PM file? I am struggling to do that.

    Thanks
    Bharath

    ReplyDelete
    Replies
    1. Hi,

      this.Get("GetBusComp")

      this is the syntax from PM.

      I did not remember trying to query on the BC using Javascript. I know that it can be done.

      Delete
  4. Thank you for providing good information from Kexlin
    You are in the right place for a perfect solution for any app development company in hyderabad. We are well known for delivering the best quality Mobile Application Development Solutions to our clients.

    ReplyDelete