Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Bronze Super Contributor
Posts: 192
Registered: ‎07-17-2011

Mobile function (row)

Using Firefox/Firebug to debug the script.  I figured out how to set a breakpoint..

 

Having difficultly in determing what "row" is.  

 

I see looking in argos-sample that there is row.action, row.view, and row.name.

 

What else does "row" contain and what is the easiest way to see this?

 

I want to add another section like "More Details" to Account Detail. Hoping there is a row property that gives Detail, More Detail, Related Items etc.

 

Thanks!

 

Norman

Bronze Contributor
Posts: 95
Registered: ‎07-11-2011

Re: Mobile function (row)

In argos-sample inside ApplicationModule.js there is a number of overrides providing customizations using the registerCustomization function.

 

If you follow that down the code path, you will end up inside argos-sdk/src/Detail.js, inside the applyCustomizationsToLayout function. There you will see that 'row' is the current layout item that is being added to the page.

 

So go to your specific view (say argos-saleslogix/src/views/account/Detail.js) and look at the createLayout function (typically the last function).

 

It returns a layout array that is setup like:

[{

  options: { /* title bar */}

  as: [ { /* row object */ }, {/* row object */}]

},{

 /* next section */

}]

 

The row object typically has a name which correlates to the SData entity property and a label which is what the user see's. The rest is completely optional and is dependent on your view and what that row should do - it might have a validator, or action, or a disabled dependency, etc.

 

Back to the Detail.js, applyCustomizationsToLayout - it loops over each object in the layout array andeach object in the 'as' array for each section. It first calls the 'at' function from ApplicationModule.js registerCustomization function object (where you see the row being used) and checks if it returns true, if it does it continues to apply all the rest of the customization on to that current row.

 

It gets passed the row object right from the Detail view, so the properties will vary greatly. So the easiest way to see all the properties would be to open up the .js file for your view directly and go through the createLayout function - you could also put a console.log(row) inside your 'at' customization function to view it in the console.

 

If you want to add an entirely new section you could do something like this:

        // Account Detail add My Section

        this.registerCustomization('detail', 'account_detail', {

            at: function(row) { return (row.options && row.options.cls === 'action-list') },

            type: 'insert',

            where: 'after',

            value: {

                options: {

                    title: 'My Section'

                },

                as: [{

                    name: 'AccountName',

                    label: this.accountText

                },{

                    name: 'WebAddress',

                    label: this.webText,

                    renderer: Mobile.SalesLogix.Format.link

                }]

            }

        });

 

Now what the above does is the 'at' function returns true if the current layout object has a property called options, and if it does have options, then its options.cls equals action-list. If you go look at the /account/Detail.js you will see the only object that meets that criteria is the very first one.

 

It then inserts after that a new object, with its own options and as properties, setup just like the others.

 

The only danger is that typically the Sections don't have a unique value, as the registerCustomizations was intended mainly for objects in the 'as' array. You will see that all Sections have a 'title': this.xText -- this is for localization overrides, so you shouldn't rely on the title string unless you're positive it will only be viewed in one language.

 

 

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

Re: Mobile function (row)

What needs to be done is for Sage to add unique "Id's" to everything in the base OOTB product and then we would not have conflicts, etc.

--
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: Mobile function (row)

As Tony points out, there are a lot of ways to avoid modification of the OOTB code and do "overrides" via custom module(s).

 

However, at this point  in time, there are several places where that is not easily done.. one is if you want to add "Quick Actions" to the "home page".  I found this out the hard way as we were developing a  comprehensive "Project System" (set/link up projects, enter timesheet data, expenses, etc.). We had to mod the home.js directly to do it.

 

--
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
New Member
Posts: 1
Registered: ‎04-04-2012

Re: Mobile function (row)

Hi RJ,

 

Can you give me any pointers about adding a 'Quick Action' to the home screen? I'm trying to add an "Add Ticket" action, I can get the button to appear, but can't get it to open the insert ticket view.

 

Any help would be appreciated.

 

Jason