Showing results for 
Search instead for 
Do you mean 
Community Home Request Access Read Blogs Share Your Ideas Search Community View My Settings
Reply
Highlighted
Copper Super Contributor
Posts: 172
Registered: ‎07-06-2010
Accepted Solution

Adding a Custom Edit View in SlxMobile3

I'm trying to follow along with the argos-sample source provided in the Mobile Toolkit, but its targeted at version 2, and I am working in Mobile 3.

 

I am trying to create a custom Edit view for an Opportunity entity. I want it to be custom, because I intend to allow the user to change only 1 field in a related table, and I do not want to expose this field using the normal Edit functionality. So it's basically a link under the Related Actions table in the GUI.

 

Even though it appears I am following the same template in argos-sample for the GoogleMapView view, I cannot get my view to render in Mobile 3. The app just shows a blank page and Chrome Dev tools shows the last resource retrieved is the logo.png resource. There's nothing else on the page at all.

 

The part that's causing it to choke is the second registerView function here, the one for SPStatusEdit:

 

loadViews: function () {
            this.inherited(arguments);
            this.registerView(new AddAccountContact());
            this.registerView(new SPStatusEdit());
        }

The first registerView call works fine, meaning if I remove the one under it the page fully loads correctly.

 

I have the following detailed at the top of my custom ApplicationModule file:

 

define('Mobile/MyCompanyName/ApplicationModule',
    [
    'Sage/Platform/Mobile/ApplicationModule',
    'Mobile/SalesLogix/Views/AddAccountContact',
    'Mobile/MyCompanyName/Views/SPStatusEdit' //include the path here and instance variable below
    ], function (
        AddAccountContact,
        SPStatusEdit
    )

 

 The file I am pointing to is at the src/Views path in Products/MyCompanyName, and since ApplicationModule works correctly I'm assuming my index file is also correct when setting the aliases up:

 

require({
        baseUrl: "./",
        packages: [
            { name: 'dojo', location: '../../argos-sdk/libraries/dojo/dojo' },
            { name: 'dijit', location: '../../argos-sdk/libraries/dojo/dijit' },
            { name: 'dojox', location: '../../argos-sdk/libraries/dojo/dojox' },
            { name: 'snap', location: '../../argos-sdk/libraries/snap', main: 'snap' },
            { name: 'moment', location: '../../argos-sdk/libraries/moment', main: 'moment' },
            { name: 'moment_langs', location: '../../argos-sdk/libraries/moment/min', main: 'langs' },
            { name: 'Sage/Platform/Mobile', location: '../../argos-sdk/src' },
            { name: 'Mobile/SalesLogix', location: 'src' },
            { name: 'configuration', location: 'configuration' },
            { name: 'localization', location: 'localization' },
            { name: 'Mobile/MyCompanyName, location: '../argos-MyCompanyName/src' },
            { name: 'configuration/MyCompanyName, location: '../argos-MyCompanyName/configuration' }
        ],
        paths: {
            'Mobile/SalesLogix': './src',
            'Sage/Platform/Mobile': '../../argos-sdk/src',
            'Mobile/MyCompanyName: '../argos-MyCompanyName/src',
            'configuration/MyCompanyName:'../argos-MyCompanyName/configuration'
        }
    });

 And finally, the View I want to add is a straight copy/paste from the Edit.jsfile located in Opportunity, with the exception of changing the ID and the type:

 

define('Mobile/MyCompanyName/Views/SPStatusEdit', [
    'dojo/_base/declare',
    'dojo/_base/lang',
    'dojo/string',
    'Mobile/SalesLogix/Validator',
    'Mobile/SalesLogix/Template',
    'Sage/Platform/Mobile/Utility',
    'Sage/Platform/Mobile/Edit'
], function(
    declare,
    lang,
    string,
    validator,
    template,
    utility,
    Edit
) {

    return declare('Mobile.MyCompanyName.Views.SPStatusEdit', [Edit], {
        //REST OF OOTB CODE FOR VIEW HERE

 What is the method now for adding custom views in Mobile 3? This method works fine for me in my Mobile 2 implementation, but since Dev Tools isn't telling me anything's "broken" I am struggling to figure out why the app views don't show at all once I add the registerView call for my custom view.

 

Thanks.

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

Re: Adding a Custom Edit View in SlxMobile3

Solved; the directory structure was out of whack and I had to rebuild it per the argos-sample project from Github.