Hi Community,

Any Idea how can I achieve below scenario in Mobile Application.

If case status is "closed", when saving record i need to show pop up message if there is no attachment. 

 

Like 0

Like

7 comments

Dear Fulgen,

You can achieve such task using push notifications for mobile application. Such push notifications are created via business process and corresponding  “Send push notifications” element.

By status change signal on the Case object you read the quantity on attachments on the record, which triggered process and based on the result you show push notification.

Check the following article on step-by-step implementation:

https://academy.bpmonline.com/documents/technic-bpms/7-14/how-set-push-notifications-mobile-application-users

Regards,

Anastasia

Anastasia Botezat,

Hi Anastasia, Thanks for your reply

Currently in mobile, we enable the status field in case form. So user can select the status to closed. Now when saving case record on mobile and if status is 'Closed', I need to do some validation if there is attachment in 'CaseFile'. This logic is achievable in web using esq to check if there are records in 'CaseFile' and use 'asyncValidate' method for validation. Now in mobile how can i implement the same logic? 

 

Fulgen Ninofranco,

Please check the following example. There is a query to Contact section, where we select Name, Id, Account. This is the corresponding to ESQ mobile version.

var store = Ext.create('Terrasoft.store.BaseStore', {
    model: 'Contact'
});
var queryConfig = Ext.create('Terrasoft.QueryConfig', {
    columns: ['Name', 'Id', 'Account'],
    modelName: 'Contact'
});
store.loadPage(1, {
    queryConfig: queryConfig,
    filters: Ext.create('Terrasoft.Filter', {
        property: 'Name',
        value: 'test'
    }),
    callback: function(records, operation, success) {
        var loadedRecord = records[0];
        if (loadedRecord) {
            var contact = loadedRecord.get('Account');                                                                                                    
            if (contact) {                                                                                                                   
                ...
            }
        }
    },
    scope: this
});

Regards,

Anastasia

Anastasia Botezat,

Hi Anastasia, Thanks for your reply

From which OOB Schema this source code is added?

Fulgen Ninofranco,

Also, here is an example of how to write direct query to database:

// sql requry to DB
var sqlText = "select pf.Id as ProductFolderId from ProductFolder pf " +
    "where pf.FolderTypeId = '9dc5f6e6-2a61-4de8-a059-de30f4e74f24' and " +
    "exists(select pif.Id from ProductInFolder pif where pif.FolderId = pf.Id and exists(" +
    "select p.Id from Product p where p.Id = pif.ProductId and " +
    " p.Active = 1 and p.TypeId = 'f1795fc3-36cc-4771-9222-178b339eb9f2'))";
 
// variable to which results will be stored
var records = [];
 
// executing query to DB
Terrasoft.Sql.DBExecutor.executeSql({
    sqls: [sqlText],
    success: function(data) {
        if (data.length > 0) {
            var columnMap = {
                'ProductFolderId': 'Id'
            };
            var queryConfig = Ext.create('Terrasoft.QueryConfig', {
                modelName: 'ProductFolder',
                columns: ['Id']
            });
 
            var ids = data[0].rows;
            for (var i = 0, ln = ids.length; i < ln; i++) {
                var sqlData = ids.item(i);
                var record = Terrasoft.SqlDataToRecordConverter.convert(sqlData, queryConfig, columnMap);
                records.push(record);
            }
        }
    }
});

You can check MobileCaseGridPageController, MobileActivityActionsUtilities schemas.

Regards,

Anastasia

Anastasia Botezat,

Hi Anastasia, Thanks for your reply

For 'asyncvalidate' method in web. What is its counterpart in mobile? I want to execute this esq on click of save button. So I need the same functionality as asyncvalidate in web.

Fulgen Ninofranco,

Unfortunately, there is no exactly same functionality for mobile application. However, you can use business rules instead. I have prepared an example of RegExp validation, hope it suits your task:

Terrasoft.sdk.Model.addBusinessRule('Contact', {
    ruleType: Terrasoft.RuleTypes.RegExp,
    regExp : /^([0-9\(\)\/\+ \-]*)$/
    triggeredByColumns: ['HomeNumber', 'BusinessNumber']
});

Regards,

Anastasia

Show all comments

There are 2 ways on how to add a custom CSS to a mobile application. The first one works globally. The second one can work enter globally or locally in a specific section. 

Global CSS

1. Create a new module in a "Configuration" section. I named it "UsrMobileStyle". Add needed CSS into a "Less" tab for the module.

http://prntscr.com/ofbv8p

2. Open "Mobile application wizard". Change something and save changes. The system will create a new replacing client module for "Manifest". Find the module called "MobileApplicationManifestDefaultWorkplace" in the configuration section.

3. Add the "CustomSchemas" array with the module that was created in the first step to the manifest in the following way:

{

    "SyncOptions": {

        "SysSettingsImportConfig": [],

        "ModelDataImportConfig": []

    },

    "Modules": {},

    "Models": {},

    "CustomSchemas": [

        "UsrMobileStyle"

    ]

}

http://prntscr.com/ofbwh4

4. Save changes, restart the application pool, enjoy.

If it's a cloud application, please email to support@bpmonline.com and ask to restart the application pool. 

If it's a local application, please use the "Mobile application emulator" in order to check the changes

Local CSS. 

The same idea. Please find more information in the article by the link below.

https://community.bpmonline.com/questions/reg-validations-mobile-app

 

Like 0

Like

Share

4 comments

I tried Global CSS and its reflected except home screen which appearing just after successful login. Is it possible to apply custom css on home screen?

Muhammad Shajiuddin,

It's called "login page". Unfortunately, it's not possible to modify a mobile login page. 

Eugene Podkovka,

Please confirm the login page is exist as separate html file which is embedded with mobile app or something else? can we modify it locally?

The login page is an html file that is embedded in mobile app and can't be customized.

Show all comments

Hi,

 

I need to change background image of mobile home page.

Currently I able to show background image under sections (modified the object "UsrMobileCaseGridPageView") but its not reflected on home page.

 

Image is copied to this loaction (file:///C:/BPM/BPM_Mobile_simulator/7.14.6/appV2/Common/lib/SenchaTouch/resources/css/bg.png)

Please suggest the way it can be achieved. For testing I using mobile simulator.

 

Regards

Like 0

Like

3 comments

The question was discussed in the article by the link below.

https://community.bpmonline.com/articles/adding-custom-css-mobile-application

Hi Eugene,

Thank you, I tried Global CSS and its reflected except home screen which appearing just after successful login. Is it possible to apply custom css on home screen?

Muhammad Shajiuddin,

Unfortunately, it's not possible.

Show all comments

hi,

Please find the below link that explains how to enable/disable fields based on condition in mobile app.

http://agiliztech.com/2019/06/24/agiliztechs-customization-bpmonline-enable-disable-field-mobile-app/

 

Like 0

Like

Share

0 comments
Show all comments