Configuration

followup.html

Open the followup.html file (in %%appRoot%%/views/followup.html) and configure it as you want, it now contains an example:

<div data-app="{
    app:'followup', 
    config: {
        /* Limit the number of selected coworkers and types */
        choiceLimits: {
            totalMax: 999,
            targetMax: 999,
            coworkerMax: 999
        },
        /* If empty values should be showed or not */
        showEmptyValues: true,

        /* At what percentages the progress bars change colors */
        coloring: {
            green: 1.0,
            yellow: 0.6
        },

        /*
            Add logic for which users that will be able to admin the app.
            Example only users in the group administrator and superusers
        */
        securityLevel: lbs.common.executeVba('AO_Followup.FollowupMemberOfGroup',';Administrators;Superusers;') && 'admin' || 'user',

        /* nroftiles = adjust how many tiles that will be shown before a scrollbar appears */
        nroftiles: 4,

        /* Field mappings for target table */
        targetTableMapping: {
            tableName: 'target',
            typeFieldName: 'targettype',
            valueFieldName: 'targetvalue',
            dateFieldName: 'targetdate',
            coworkerFieldName: 'coworker' // Is a semicolon separated string, if you'd like to have multiple coworkers
        },
        /* Mapping what tables and fields that the 'Score' data should be fetched from */
        scoreTableSources: [
            {
                /* Field mappings for score table */
                name: 'history',
                tableName: 'history',
                valueFieldName: '',
                typeFieldName: 'type',
                dateFieldName: 'date',
                coworkerFieldName: 'coworker'
            },
            {
                /* Field mappings for score table */
                name: 'deal_value',
                tableName: 'deal',
                valueFieldName: 'value',
                typeFieldName: 'dealstatus',
                dateFieldName: 'closeddate',
                groupFieldName: 'company.buyingstatus', // Take deals with a given buyingstatus to related company 
                coworkerFieldName: 'coworker'
            }
        ],

        /* Map what targets to measure and how to measure them */
        targetMappings: [
            /*
                Example of a mapping:
                {
                    icon: 'fa-money', // What icon to show next to the target (If empty no icon is shown)

                    //    - Available values: ['sum', 'count']
                    //    - If the score should sum a certain field or just count the records
                    //    - OBS! If 'sum' is used you must have a value in the valueFieldName in the ScoreTableSource
                    scoreType: 'sum', 
                    scoreSource: 'deal', // What scoreTableSource to get the data from (The name is the key)
                    targetTypeKey: 'agreement', //What optionkey to use in the target table
                    scoreTypeKeys: ['agreement', 'tender'] // What keys to optionkeys to use in the score table
                    groupValues: ['active', 'prospect'] // What values to group on (Only used if groupFieldName is given in ScoreSource
                    unit: 'kr', // What unit that should be shown for the value
                    unitBefore: false // If the unit should appear before the value or not
                },
            */
            {
                icon: 'fa-phone',
                unit: {owner: 'addon_followup', code: 'unit_pieces'},
                scoreType: 'count',
                scoreSource: 'history',
                targetTypeKey: 'salescall',
                scoreTypeKeys: ['salescall']
            },
            {
                icon: 'fa-money',
                unit: {owner: 'addon_followup', code: 'unit_sek'},
                unitBefore: false,
                scoreType: 'sum',
                scoreSource: 'deal_value',
                targetTypeKey: 'agreement',
                groupValues: ['active', 'prospect'],
                scoreTypeKeys: ['agreement']
            }
        ]
    }
}"/>