Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Tuned Listener
Posts: 50
Registered: ‎02-09-2010

Mobile 2.0 for 7.5.4 Homescreen

Hi.

 

I stuck trying to remove the Add Account/Contact action on the home screen. I can't find the correct combination to refer to it in my customisation. I'm thinking it has to be somewhere close to the following but I'm aware I may be barking up the wrong tree. Any would be greatly appreciated.

 

list? groupedlist?

 

this.registerCustomization('list', 'home', {
   at: function(action){ return action.id === 'addAccountContact'; },               
   type: 'remove'       
   });  

 

(I can do it outside directly in the 2.0 home.js and then build but I get errors trying to do the same in my 7.5.4 instance)

 

Many Thanks,

 

Nik

Copper Super Contributor
Posts: 27
Registered: ‎06-23-2009

Re: Mobile 2.0 for 7.5.4 Homescreen

If you look in the ApplicationModule.js of argo-sample project you see an example of adding a new item into the home screen:

        loadCustomizations: function() {
            this.inherited(arguments);

            //We want to add the Groups list view to the default set of home screen views.
            //Save the original getDefaultviews() function.
            var originalDefViews = Mobile.SalesLogix.Application.prototype.getDefaultViews;
            lang.extend(Mobile.SalesLogix.Application, {
                getDefaultViews: function() {
                    //Get view array from original function, or default to empty array
                    var views = originalDefViews.apply(this, arguments) || [];
                    //Add custom view(s)
                    views.push('groups_list');
                    return views;
                }
            });

 

 My guess is that you should be able to do the same thing in reverse by doing a splice instead of a push.

Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Mobile 2.0 for 7.5.4 Homescreen

This example (from the sample) is about the list of "GoTo" items - not Quick Actions.

 

The question that was posed relates to Quick Actions. It's a lot simpler to just edit  the OOTB home.js for QA's. I do this all this all teh time.

--
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
Copper Super Contributor
Posts: 27
Registered: ‎06-23-2009

Re: Mobile 2.0 for 7.5.4 Homescreen

Your right of course.  I guess I just try to avoid changing the OOTB items so that upgrades don't burn so bad (Not that that helped me going from Mobile 1.2 to 2.0.

 

 

Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Mobile 2.0 for 7.5.4 Homescreen

What I've found is there are not enough customization hooks (yet ;-) in the base product to do all the things you want/need to do via a custom add-on module (or modules).

 

For example.. there's no easy way to change the order of "list actions" (or Immediate aActions as I like to call them). You have to "hack" the list.js for all the entities where you customize them.

--
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
Tuned Listener
Posts: 50
Registered: ‎02-09-2010

Re: Mobile 2.0 for 7.5.4 Homescreen

Thanks guys, I did change the home.js not long after I posted. I am still curious to know if it can be done with a customisation insert though. I did have a look at splicing it as well but couldn't get it to work but what RJ said makes sense.

Thanks again.
Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010

Re: Mobile 2.0 for 7.5.4 Homescreen

[ Edited ]

I ran across this trying to add an element and I ended up solving your problem too.

 

The Home view doesn't support Registered Customizations, so I tried it with Prototype Customizations. I tweaked the Home View sample and changed the arguments to point to the Home View. The trick was finding the function that actually did the rendering and realizing it too returned an array.

 

var homeQuickActionLayout = Mobile.SalesLogix.Views.Home.prototype.createLayout;

            dojo.extend(Mobile.SalesLogix.Views.Home, {

                createLayout: function () {

                    var homeQuickActionViews = homeQuickActionLayout.apply(this, arguments) || [];

 

                    homeQuickActionViews.splice(0, 1);

 

                    return homeQuickActionViews;

 

                }

            });

 

 

Highlighted
Gold Super Contributor
Posts: 3,087
Registered: ‎03-19-2009

Re: Mobile 2.0 for 7.5.4 Homescreen

Nice find!

 

I'd make one small change:

  from:  dojo.extend(Mobile.SalesLogix.Views.Home, {

  to:  lang.extend(Mobile.SalesLogix.Views.Home, {

--
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
Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010

Re: Mobile 2.0 for 7.5.4 Homescreen

When I did that, I get all kinds of exceptions. The wiki also uses dojo.extend.

 

Why is one preferred over another? 

 

 

Employee
Posts: 51
Registered: ‎12-16-2011

Re: Mobile 2.0 for 7.5.4 Homescreen

[ Edited ]

If you use "lang" you need to require it in your define at the top: 'dojo/_base/lang' (example: https://github.com/SageSalesLogix/argos-saleslogix-20_for_754/blob/2.1/src/ApplicationModule.js#L17). lang is preferred becaues it is uses AMD fully. Using dojo.* uses a global.