יום שני, 31 במרץ 2014

March Repost: More Dynamics in the Physical Layer of OBIEE

In our "blast from the past" series, I am reposting today an article which I wrote 5 years ago. With version 11g not to be released for one more year, the article focuses on strategies how to add more dynamics to the physical layer of a BI repository. Please enjoy

***

During a BI project there are numerous opportunities to go down the stony road and establish redundancies where you do not really want them.

When I am in a provocative mood (which I am not very often, I assure you), I use to ask "Do you want a 'B' project or a 'BI' project?". There are so many pitfalls waiting for us to stumble into and reveal our bad (or sometimes even non-existent) design.

There are many triggers for this post, as there are many fine people blogging about OBI EE (here and here to mention just two of them, keep up the good work!) and I would also like to thank the many people who contact me with questions regarding OBI EE design and architecture.

Today I would like to examine options we have to make the physical layer definitions more dynamic. Of course we all know about aliases in the physical layer, so I will omit these.

1. Multiple Connection Pools (and permissions)

As John Minkjan points out in his post on multiple connection pools, these object types have a security permission button which allows us to define which user (or group) uses which connection pool.

This can be very convenient, if you want to "switch" the users to different connection pools. The connection pools could even point to different data sources so you can implement a simple solution to use the same set of requests/dashboards/business model against different databases (such as DEV or PROD).

In the below screenshot (click to enlarge), please note that we can set permissions for a group/user in the General tab for either a presentation layer object or connection pools (the only object type in the physical layer that has permission management options).


2. Dynamic Names

The dynamic names feature is described in several places across the Oracle BI EE and Marketing Segmentation documentation.

Simply put, it enables us to assign the value of a session variable(!) instead a static name to the following object types:
  • Physical Catalog (useful for accessing different db schemas)
  • Physical Table (for switching between tables)
  • Alias
A real life example is the sampling factor in the OBI EE Marketing Segment Designer. Instead of issuing a lengthy count statement against the original table (with let's say 10 millions of records), you can do a count against a sampling table (with a sample of 5%, that is 500.000 records) and then multiply with the necessary factor (20 in our example) to get an extrapolated result.

Sampling factor setting in Segment Designer
Remember you can set session variables not only using Initialization Blocks but also from the presentation services using either a dashboard prompt or the SET VARIABLE operator in an advanced SQL prefix.

3. Variables

As many of you savvy readers are aware, we can use session and repository variables all over the place in the Administration Tool to make our lives easier (or more complicated?). For example you can specify a connection pools' data source as VALUEOF(OLTP_DSN) and use a repository variable named OLTP_DSN to carry the value (which is the way it is done in Oracle BI Applications).

4. More?

Do you have more ways of bringing your physical layer to dynamic life? Let me know by adding a comment to this post.

Have a nice day

@lex

יום חמישי, 27 במרץ 2014

Time to Learn the Languages of the Web (and Good Design)

My fellow instructors at Oracle University and I teach a lot of Siebel Open UI these days. And when I say a lot, I mean like two full classes (a full class is 16 students) per week, per instructor during peak demand.

Of course, Siebel developers of all couleur, be it associate, rookie, graduate or seasoned veteran, are eager to learn how to understand and customize the latest and greatest among Siebel UI technologies.

In the Open UI Foundations class (and a new advanced JavaScript API class, coming soon to a learning center near you), we talk a lot about the languages which form the modern web:
  • HTML(5)
  • JavaScript (and a fair amount of jQuery)
  • CSS
But Oracle does not own these languages, so we have to resort to other resources to learn more about these web standards.

In the following, compiled with a little help from generous students, you will find a list of web resources which serve both the newbie and the experienced Siebel coder to get to grips with HTML, JavaScript and CSS. The list is in coincidental order.

Web Platform

As stated on the start page, "Web Platform is a project of the W3C and the Web Platform stewards — Adobe, Apple, Facebook, Google, HP, Intel, Microsoft, Mozilla, Nokia, and Opera. It’s a collaboration between those who make the specs, those who build the browsers, and developers from all over the world."


Also stated on the page is the fact that Web Platform is a work in progress. It uses the wiki concept, so everone can join and contribute.

At the time of this writing, the "Docs" on Web Platform provide references, APIs and beginner's guides for CSS, JavaScript, HTML as well as other related languages or standards.

I noticed that content from many other resource sites such as dev.opera.com has already been moved to Web Platform.

Mozilla Developer Network

Representative for similar sites from browser vendors such as Google or Microsoft, the Mozilla Developer Network provides beginner-level or advanced tutorials as well as well-structured references for web developers.


On the Google Developers site, I found this valuable tutorial on the Google Chrome Developer tools.

SitePoint

Good web design is something you can learn. The good people at SitePoint provide content by developers for developers with a knack for intuitive, modern web design.

HTML5 Rocks

If you want to go deeper into HTML5, the content available on HTML5 Rocks is as good as it gets. However, it is obviously aimed at advanced web developers rather than the ambitious rookie.

Web Pages That Suck

A little bit tongue in cheek and for more than 18 years (!), WPTS presents badly designed web pages (Caution: some of the content presented on WPTS cannot be unseen). But why not learn from the fallacies and mistakes of others?

In addition, the site also has a lot of pointers to resources with a focus on the good side of web design.

A List Apart

Started as a mailing list for web developers, A List Apart is a "magazine for people who make web pages". Well, this includes Siebel developers ;-).

This list could be much longer, as it should definitely include CSS Zen Garden and many other inspirational web sites that go unnamed here.

What is your favorite resource for learning the languages of the web and which web sites inspire you? Please share with us in the comments section.

My Web History (and Books)

My personal journey in professional computing started with a workshop on internet technology hosted by an internet provider in 1996. This was actually the day when I saw a modem bank for the first and last time so far.

During the workshop we hand-coded HTML and I was hooked. CSS and JavaScript were considered "secret sauce" and I soon started working as a free web developer. I wouldn't dare to even look at the code I produced back then but I must confess that I always strove for simple, usable web design.

One of the books I found very inspirational in my early years as a web developer was HTML Artistry. Apparently, it is still available (as a paper back, what does this tell us?). For a book that has been written in the year when Google was founded, I find that it's still relevant with regards to the design examples. Good design never grows old...

If you're looking for a more recent book on web design, Designing with Web Standards might be a good read.

have a nice day

@lex

יום שלישי, 25 במרץ 2014

Buy One, Get One Free on all of Packt’s 2000 eBooks

My publisher, Packt Publishing is celebrating their 2000th publication with a special offer:
For any eBook you purchase until 26th of March 2014, you get one eBook for free.


More details and the full catalog can be found on Packt's website.

have a nice day

@lex

יום שני, 24 במרץ 2014

Siebel Open UI - How to fix Form applet display issue in Chrome

Open UI form applets have some issue, when it rendering in Google Chrome.The controls are overlapped as shown below.
Solutions
Fix without JS
-------------
Open a CSS file your application referring paste the below css

td {
    border: 1px solid transparent;
}

clear the cache and try :-)


-------------------------------------------------------------------------------------
Fix with JS (as per oracle doc)
As per oracle technical document we can fix this issue with a piece of code

if (typeof(SiebelAppFacade.ChromeSpaceFix) == "undefined") { Namespace('SiebelAppFacade.ChromeSpaceFix'); (function() { SiebelApp.EventManager.addListner("postload", ChromeTdSpaceFix, this); function ChromeTdSpaceFix() { try { $("#_svf0 table.GridBack").find("tr").children("td").each(function(index) { var regex = /(height)(\s*):(\s*)([^;]*)/, el = $(this), st = el.attr("style"), match = regex.exec(st); if (match && Number(match[4]) && el.is(":empty") && el.siblings().length != el.siblings(":empty").length) { st = st.replace("height", "x­height"); el.attr("style", st + "height:" + Number(match[4]) + "px;"); } }); } catch (error) { // Nothing to do. } } }()); }

Now you can add this file as Platform common (8.1.1.9 & 8.1.1.10) or Application -> common as (8.1.1.11)
you can see the above fix from here

Oracle BI Mobile for Android

At the risk of outing myself as an Android fanboy, I was glad that the wait for a BI Mobile App for my smart phone is over. After serving customers with a favor for pomaceous devices for quite a while, Oracle has recently published Oracle BI Mobile for Android on Google Play.


Of course, I couldn't resist and try it out myself. In the following I'd like to describe my findings.

Installation and Public Demo

As with all smartphone apps, installing the software is nice and easy.

Once launched, you find a predefined "Public Demo" connection which allows you to inspect various example dashboards and mobile applications. Indeed, the new BI Mobile Apps can be accessed simply by opening them from the catalog.

Here is a screenshot from one of the sample dashboards (Galaxy Nexus):


Browse and Search

Tapping the left menu icon allows you to browse recently opened items, list the favorites or use the BI catalog. In addition, there is a central search box which also supports the Google-backed speech input which mysteriously even handles my Austrian accent ;-)

Connections

After selecting Connections in the app menu (top right corner), new server connections can be added by tapping the "plus" icon on the bottom of the list.

Let's try to connect to the hosted version of the glorious BI Sample App V309:


Yay! Connection established. While it might be better to use a somewhat bigger screen type such as a tablet, my smartphone gave me access to all the nice demo analyses and BI Publisher reports (which are btw downloaded as PDF immediately).

Here is another final screenshot for your reference:


Documentation

A new guide for BI Mobile for Android has been added to the BI Mobile Products documentation library.

Summary

I must confess, I tend to favor browser-based mobile solutions like BI Mobile Apps Designer over native apps for many reasons, one of which is the immediate availability on all devices. But enterprise apps like Oracle BI Mobile - now available for both Android and Apple devices - definitely seem to have a prosperous future ahead as they provide secure access to generic analytic content such as analyses, dashboard or BI Publisher reports without having to create a specific type of object.

have a nice day

@lex

יום חמישי, 20 במרץ 2014

New Features in Oracle Fusion/Cloud Applications Release 8

As announced a few days ago, Oracle has published a new release of its Fusion Applications (ERP, HCM, CRM) product line, namely Release 8.

For on-premise deployments, this means that the installers as well as the new documentation set are now available on Oracle servers.

For cloud customers which have signed up for the Oracle-hosted versions of Fusion Applications (aka Cloud Applications) such as Sales Cloud, Oracle is probably rolling out upgrades already.

The new release brings hundreds of features, with the following (personal) list of highlights:

New Skyros Theme

With release 8, Oracle ships a new skin named "Skyros" (probably inspired by the blue sky and white houses on the Greek island of Skyros).

New Skyros skin in Fusion Release 8
The new skin provides a more "flat" look and feel and will also be available for the accompanying middleware products such as Identity Management or Oracle BI.

Oracle has announced a skin editor for release 9 so customers can create custom skins more easily.

Redesigned Global Header

In addition to the new style, the global header has been redesigned. For example, the Navigator menu is now represented by a compass icon and most administrative links have made it to the menu which opens when you click the user name on the top left.

The new Navigator menu in Release 8.
User Interface Text Editor

For developers, there are many new features, including a UI Text Editor (its place in the Navigator is highlighted in the above screenshot) which allows to search and replace user interface text elements such as labels quickly.

Application Composer

As of release 8, the Application Composer for Sales Cloud/Fusion CRM has a lot of new features including a new Record Type field which allows to filter list of values by application role (any similarities with Siebel state model are purely coincidental).

Fellow blogger and author Richard Bingham has published a very nice series on release 8 features and he also has some references to videos in his post about Application Composer.

Other Enhancements

Among other areas that have been enhanced with release 8 are flexfields (used in ERP and HCM but not Sales Cloud/CRM), the BPM Composer, Auditing and the Simplified UI which is quickly becoming the UI of choice for many users. Developers will be pleased to hear that there is now better support for customizing the Simplified UI via Application Composer.

have a nice day

@lex

יום שלישי, 18 במרץ 2014

Project and Resource Management in Siebel

Every now and then Siebel mesmerizes with its power and flexibility. Recently while doing an implementation, we stumbled upon where to do project/resource management activities as there was no major tool in place except good-old-excel. Siebel as good it is, comes with wonderful solution in form of Project and Resource Management module. It is power packed with options for creating Projects, Individual Tasks, Project Team and workbook, Timesheet module to keep track of each task/resource and many many more features.

Mother of all siebel documents (Bookshelf) suggests this module was designed in consultation with leading professional services organizations specifically to meet the needs of consulting and service organizations. It is built in such a way that it can compete and beat any current Resource management tool available in market. If you are implementing Siebel and your client doesn't have good resource management tool don't miss out to demonstrate this module of Siebel.

The path to Project Summary view is something you can learn a trick or so.


PS: Do check your Siebel flavors before proposing the solution.

Happy Crunching!!

יום שני, 17 במרץ 2014

Siebel Mobile Applications and jQuery Mobile ThemeRoller

One of the new features introduced with Siebel CRM Innovation Pack 2013 is the ability to use jQuery Mobile ThemeRoller to create custom style sheets for Siebel Mobile Applications (and only for mobile applications, at the time of this writing).


Ever in an experimental mood, I decided to give it a try. Actually the whole bit is documented in the Configuring Siebel Open UI guide in Siebel bookshelf, but as usual you will also find the steps I executed in this post.

Swatches

Before we start, let's talk about "swatches" (and I don't mean the swiss watch brand). A swatch in terms of style sheets is a collection of CSS rules regulating the colors, fonts and icons used in certain areas of web applications.

The following image is taken from the Configuring Siebel Open UI guide and explains the concept nicely.

Image Source: Siebel Bookshelf, Configuring Siebel Open UI guide.
Siebel Mobile Applications use six swatches (A to F) and as per the documentation they control the look and feel of the application as follows:

Swatch
Description
A
Application-level navigation bar
B
List applets
C
Popup applets
D
Grid items
E
Third-level view area
F
Second-level form applets

Using ThemeRoller to create custom swatches

Now that we know about swatches, let's open ThemeRoller and create six swatches...

1. Go to http://themeroller.jquerymobile.com.

2. Use the dropdown list in the version number field to select version 1.3.2. As of IP 2013, Siebel Mobile Applications use jQuery Mobile 1.3.0 and 1.3.2 is the closest currently available.

3. Create six swatches (A to F), using the ThemeRoller UI. This is quite straightforward. I found it useful to take care of the global settings first, then start with a single swatch (delete all others). Using the Duplicate feature, I then created five other swatches based on the first and modified them.

The following screenshot shows some very ostentatious example swatches.


4. Once you're finished, simply hit the Download button and provide a name for the theme to download.

5. Extract the downloaded .zip archive.

6. Open the themes folder which is created as part of the extraction process.

7. Copy the .css files from the themes folder to the PUBLIC/%LANGUAGE%/files/custom folder of the Siebel Developer Web Client and/or Siebel Web Server Extension installation directory.

8. Open the images subfolder in the extracted archive.

9. Copy all files from the images subfolder to the PUBLIC/%LANGUAGE%/images/custom folder of the Siebel instance. (Create the custom folder if necessary).

10. Navigate to the PUBLIC/%LANGUAGE%/files/custom folder and open the file with the .min.css extension using a suitable editor.

11. Replace all occurrences of “images/” with “../../images/custom/”.

12. Save the file.

13. Open the custom mobiletheme.js file which should already exist in the siebel/customscripts folder.

14. Add the following code to the file:

SiebelApp.ThemeManager.addResource(
    "SBL-MOBILE",
    {
        css : {
            custom : "files/custom/mystyle.min.css"
        }
    }
 );

The above code uses the addResource method of the ThemeManager class to add the mystyle.min.css file to the existing SBL-MOBILE theme. Note that the file name could be different, depending on the name you chose in step 4.

15. If not already done, register the custom/mobiletheme.js file in the Manifest Filesview of the Administration - Application screen and add the file to a custom PLATFORM DEPENDENT entry in the Manifest Administration view, providing a valid object expression such as “Mobile”.

16. Launch the mobile application.

17. Verify that the custom style sheet is loaded.

As an alternative to using the addResource method, we can also register a new custom theme.

And here is the result in all it's glory (sorry for the colors but I tried to show the different swatches rather than aim for an award-winning style).


Summary

Using the jQuery Mobile ThemeRoller is a simple approach to quickly create custom mobile themes. 

However, the style sheet produced by ThemeRoller does not cover all aspects of Siebel Mobile Applications such as icons and buttons. The appearance of these artifacts needs manual fine-tuning.

have a nice day

@lex

יום חמישי, 13 במרץ 2014

Siebel OpenUI : Calender Issues

Siebel OpenUI : Calender Issues

Siebel OpenUI currently not supporting SI Classes and Applets referring to that type. That is why Salutation applets are shown with a "question mark". Open UI will not render these classes of applet.
Calender functionality is one of the main features of Siebel. Many Customers are using this feature to schedule their activities.In Siebel we have two kinds of Calenders. HI calender and SI type. Normally in home pages you can see SI calenders and that will not work in OpenUI. Even though OpenUI render this applets, that doesn't work properly.  Siebel Non OpenUI version needs SI applets in its home page. So we need to toggle these two applets in between OpenUI and Non OpenUI.

In order to do that, we can use Personalization.

In the home page view you can Include both Calenders. Now got to Administration- Personalization -> Applets.
Create two new records for two applets (HI & SI)

To display in HI: GetProfileAttr("IsOpenUI") < 1 OR GetProfileAttr("IsOpenUI") IS NULL
To display in OUI: GetProfileAttr("IsOpenUI") > 0


GetProfileAttr("IsOpenUI") will be 1 in OpenUI applications.

Turtle Shell, Bones and Scripts

On a quite regular basis I come across discussions or articles about the Chinese translation of "Oracle" (i.e. the company I work for).

The Chinese Oracle logo some years ago.
(Image source: sysdba blog)
A Chinese student once translated the characters 甲骨文 to me as "Turtle Shell", "Bone" and "Script". At first this is slightly odd to the Western mind but when you do a bit more research you find articles and translations which simply refer to this phrase as "Oracle" (in the sense of the ancient foreseers).

In addition, the sages of the internet explain that in ancient China, records of divination and deeds were carved in tortoise shells or other animal bones as a means of storing information, hence the other translation "Oracle Bones". There you have it: This is an ancient form of database.

So the Chinese Oracle logo does not only mean "Oracle" per se but also refers to Oracle's flagship product, the database.

have a nice day

@lex

יום שני, 10 במרץ 2014

Get Ready for Oracle Applications Cloud Release 8 (Updated)

As Oracle expands its Cloud business through both acquisitions and new releases of its own Fusion Applications (which are the backbone of Sales, HCM and ERP cloud), a new product line is emerging, nameley Oracle Cloud Applications. This is a combined offer of:
  • Sales (formerly Fusion CRM)
  • Human Capital Management
  • Financials
  • Value Chain Execution
  • Product Value Chain
  • Procurement
  • Project Portfolio Management
These applications are based on Oracle Fusion Applications and are hosted in the Oracle Cloud together with other Oracle products such as Marketing Cloud or Service Cloud.

Still from an Oracle video on Sales Cloud.
With Release 8 of Oracle Cloud Applications (and Fusion Applications), Oracle explores new ways in informing customers about enhancements and new features in the form of a release 8 readiness page on cloud.oracle.com.

In addition to checking out the content on that page, the seasoned Fusion Cloud observer may want to peruse the really awesome Oracle Product Features application. After logging in with your oracle.com account, accept the disclaimer and select Oracle Cloud Applications. Then you can review the new features and produce reports.

Update: Richard Bingham at the Fusion Applications Developer Relations blog published a series of articles on the new features that come with Release 8.

have a nice day

@lex

יום חמישי, 6 במרץ 2014

Siebel Mobile Applications: Create Activities for Outbound Phone Calls

The following is a guest post by Sandra Wamsley, Programmer Analyst at Laerdal Medical. In her article she describes how to use a custom Physical Renderer in Siebel Mobile Applications to capture the event when the user taps the phone icon to make a call as an activity record in the Siebel database. The code samples and manifest configuration described are for Siebel 8.1.1.10 / 8.2.2.3.

***

When we first began developing our Mobile application, an early request came in for the application to automatically create an Activity when an outbound phone call was made through it.


 This was accomplished by having a physical renderer call a business service from within Siebel, which would create the activity. We had to accomplish this on two different business components - Accounts and Contacts - using two different fields.

The physical renderer had to accomplish three things: It had to see that the phone icon had been pressed in the application, get the Id of the Contact or Account that the icon had been pressed on, and invoke the business service, passing it the Contact or Account Id.

We created two physical renderers for our environment, because there were two business components that the business service could be invoked from - Accounts and Contacts. On the Account BC, the PR looks for “MainPhoneNumber” and on the Contact BC it looks for “WorkPhoneNum.”

Below is the code for the physical renderer:

if (typeof(SiebelAppFacade.MobileAccountFormAppletPR) === "undefined") {

 SiebelJS.Namespace("SiebelAppFacade.MobileAccountFormAppletPR");
 SiebelApp.S_App.RegisterConstructorAgainstKey ("MobileAccountFormAppletPR",  "SiebelAppFacade.MobileAccountFormAppletPR");

 SiebelAppFacade.MobileAccountFormAppletPR = (function () {

  function MobileAccountFormAppletPR(pm){
         SiebelAppFacade.MobileAccountFormAppletPR.superclass.constructor.call(this,pm);
 this.GetPM().AddMethod("ShowSelection",recordChanged,{sequence:false,scope:this})
 }

SiebelJS.Extend(MobileAccountFormAppletPR, SiebelAppFacade.JQMFormRenderer);

function recordChanged() {
  var that=this;
  $("#"+this.GetPM().Get("GetControls")["MainPhoneNumber"].GetInputName()+"_tel").on('click',function(){

  SiebelJS.Log(that.GetPM().Get("GetBusComp").GetFieldValue("Id"));

  var svc = SiebelApp.S_App.GetService("Create Activity");
  var iPS = SiebelApp.S_App.NewPropertySet();
  iPS.SetProperty("Account Id",that.GetPM().Get("GetBusComp").GetFieldValue("Id"));
  iPS.SetProperty("Contact Id", "");
  outPS = svc.InvokeMethod("CreateActivity", iPS).childArray[0];
  debugger;
  })
 }
 return MobileAccountFormAppletPR;
 }());
}

This PR was used for Accounts. When the phone icon is clicked to make an outgoing call, the PR gets the Business Component in use to pull the record’s Id (Contact or Account), gets the Business Service (Create Activity), and gives it the Account Id. It also sends a blank string for Contact Id, which we used as an indicator of which PR had been called, but there are many other ways to accomplish this.

The Contact PR was identical, except that it used “WorkPhoneNum” instead of “MainPhoneNumber”, and it sent the Contact Id and a blank string for Account Id.

In addition to the Physical Renderer, we needed to update our Custom Manifest and Manifest Extensions files. In the Custom Manifest XML file, the following two sections were added to the <PLATFORM Name=”Mobile”> section. “MobileAccountFormAppletPR” and “MobileContactFormAppletPR” were the names of the Physical Renderers created earlier.

<KEY Name="MobileAccountFormAppletPR">
<FILE_NAME> 3rdParty/jqmobile/mobiscroll-2.0.full.min.js      </FILE_NAME>
<FILE_NAME> 3rdParty/jqmobile/jquery.mobile.simpledialog.min.js  </FILE_NAME>
<FILE_NAME> siebel/jqmformrenderer.js                            </FILE_NAME>
<FILE_NAME> siebel/custom/MobileAccountFormAppletPR.js           </FILE_NAME>
</KEY>

<KEY Name="MobileContactFormAppletPR">
<FILE_NAME> 3rdParty/jqmobile/mobiscroll-2.0.full.min.js         </FILE_NAME>
<FILE_NAME> 3rdParty/jqmobile/jquery.mobile.simpledialog.min.js  </FILE_NAME>
<FILE_NAME> siebel/jqmformrenderer.js                            </FILE_NAME>
<FILE_NAME> siebel/custom/MobileContactFormAppletPR.js           </FILE_NAME>
</KEY>

In the Manifest Extensions file, we needed to specify which applets should load these PRs. We ended up with five applets that had the option of triggering a phone call, and set the correct PRs from there.

SHCE Account Entry Applet - Mobile = MobileAccountFormAppletPR
SHCE Account Entry Applet ReadOnly - Mobile = MobileAccountFormAppletPR
SHCE Sales Contact Form Applet - Mobile = MobileContactFormAppletPR
SHCE Sales Contact Form Applet ReadOnly - Mobile = MobileContactFormAppletPR
SHCE Contact Form Applet Mobile = MobileContactFormAppletPR

From the JavaScript side of things, that was everything that had to be done. We built a business service to actually create the activity, and once we got them communicating with each other, it worked as intended. Now the user can click the icon to make a phone call, and an activity will be automatically created for them.

***

Many thanks to Sandra for sharing

have a nice day

@lex

יום שני, 3 במרץ 2014

Siebel Open UI: Collapsible Applets - Another Revisit

By Jan Peterson

During a presentation to the technical team of a customer who is in the progress of updating to Open UI, I showed how easy it is to make all applets collapsible by just adding some code to a postload event handler.
We have looked at the general concepts in an earlier post:
postload.js

I quickly received a follow up question if it is possible to collapse applets automatically in case the applet doesn't have any records. As often in the new world of Open UI, the solution is very easy.

Replacing

oAppletPModel.SetProperty("defaultAppletDisplayMode", collapsed");

with

oAppletPModel.SetProperty("defaultAppletDisplayMode",
oAppletPModel.Get("GetNumRows") > 0) ? "expanded" : "collapsed");

does the job :-).

A few notes:
  • In the example I updated postload.js. For a production environment it is recommended to have a custom file that subscribes to the postload event..
  •  The postload event is only triggered if a user navigates to a new view or reloads the current view. If a child applet has no records and the user selects a different parent record which has some records in the child applet, the applet doesn't get automatically expanded. This can be achieved as well but requires some additional logic.
  • Not all applets support the "Default Applet Display Mode" user property. An example are most applets on the vanilla home views.
In summary, IP2013 makes it easy to make all applets collapsible and allows to add some additional logic around it.