Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Setting up a "related list view" via a custom ApplicationModule in 2.0

In Extjs (Slx 1.0->1.2) Mobile Web app, one would do:

 

 //Add related view for Xyzzy
 this.registerCustomization('detail', 'account_detail', {
     at: function(row) { return row.view === 'activity_related' },
     type: 'insert',
     where: 'before',
     value: {
         label: 'Xyzzy',
         icon: 'content/images/icons/Company_24.png',
         view: 'Xyzzy_related',
         //This shows how to access the current SData Feed Entry
         where: function(entry) {
             return String.format('Account.Id eq "{0}"', entry['$key'])
         }
     }
 });

 

 

In 2.0 (dojo based) this does not work. I can get the related (list) form to display but there are no records. Looking at FireeBug and the packet, it shows we are just not filling in the Id (key) value for the (current) account..  so I tried several variations on the "where clause"  and succeeded in finding many ways to "crash" it ;-)

this.registerCustomization('detail/RelatedItemsSection','account_detail', {
     at: function(row) { return row.name === 'ActivityRelated' },
     type: 'insert',
     where: 'after',
     value: {
          label: 'Xyzzy',
          property: 'XyzzyRelated',
          icon: 'content/images/icons/Company_24.png',      
          view: 'Xyzzy_related',
          where: function(entry) {
                            return string.substitute('Account.Id eq "${0}"',['$key'])
                       }   
               }
       });

and could not get any to work (so far). Any ideas?

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Setting up a "related list view" via a custom ApplicationModule in 2.0

Answer:

   string.substitute('Account.Id eq "${0}"', [entry['$key']]);

 

"...Basically the dojo formatter replaces ${n} with the item at index n from the array. ..."

--
RJ Ledger - rjledger@rjlSystems.net +1 603.369.3047 x101

".. Innovators in Mobility - Experts in Workflow Automation..."
http://www.rjlSystems.net - blog: www.rjlSystems.net/blog.html