I want to get the current day value to compare it to a field ! how can i get it using business rules in mobile ?

Like 0

Like

1 comments

Hello,

 

You need to use a custom business rule (like described  in the Academy article here), get column value using record.get() method and then compare it to the instance of the Date like it's done in JS (using getDate(), getMonth() etc. methods).

Show all comments

Hi everyone,

I am looking to override the functionality of the Add Record button on the Grid Page (Section Page) of the Mobile Application. Can you help me figure out the name of the method that gets called when the Add button is tapped?

Thanks & regards,

Ramya

Like 0

Like

4 comments

Hi Ramya,

 

In order to override the functionality of the Add Record button on the Grid Page of the Mobile Application follow these steps:



1) In Configuration create a Module, for example call it UsrChangeButtonLogic:

Ext.define("InvoiceGridPage.Controller", {
    override: "Terrasoft.controller.BaseGridPage",
    statics: {
        Model: Invoice
    },
    executeAddAction: function () {
        console.log('Hello1');
        this.callParent(arguments);
           console.log('Hello2');
    }
});

2) Create a replacing view module for the MobileApplicationManifestDefaultWorkplace module. Or use a mobile wizard  - it will create the manifest automatically. Add the newly created module UsrChangeButtonLogic to the manifest:

  "Models": {
        ...
        },
        "Invoice": {
            ...
            ],
            "ModelExtensions": [],
            "PagesExtensions": [
                "MobileInvoiceRecordPageSettingsDefaultWorkplace",
                "UsrChangeButtonLogic"
            ]
        }
    },

3) Compile your Workplace and synchronize the mobile application again.

 

As a result, "Add record" button click of Invoices Grid Page will be overwritten.  

 

Artem Smyrnov,

Thank you! That worked. Can you also help me figure out how to show a confirmation dialog on the mobile application? Something similar to the web app implementation of Terrasoft.showConfirmation? Thanks in advance!



Regards,

Ramya

Ramya R,



Use Terrasoft.MessageBox.showMessage ('your confirmation dialog message') to display a confirmation dialog.



Many thanks.

Artem

 

Artem Smyrnov,

The Terrasoft.MessageBox.showMessage method only helps in displaying a message to the user. I am looking for a functionality where the user is able to select "Yes" or "No" options below the message. Can you please help me with this?

Thanks,

Ramya

Show all comments

Hi everyone,



I am trying to add a custom button to the contacts section in the mobile application. I followed the steps provided in: https://community.creatio.com/articles/adding-custom-user-action-mobile… to create a custom button on the user actions list, but I was unsuccessful.



Alternatively, is there a way to add buttons to the section (list) page, or to add a button in the Freedom UI section of the mobile application?



Regards,

Ramya

Like 0

Like

2 comments

Hi Ramya,

 

Currently there is no way to add custom buttons in Freedom UI (the article you refer to will only work in classic UI). I've created a suggestion for our R&D team to make it possible to add buttons in Freedom UI using no-code capabilities and pointed them to your community question.

 

Thank you for helping us in making the app better!

Hi Oleg Drobina,

Thank you for the prompt response. In the Classic UI, is it possible to add a button somewhere other than the record's edit page, maybe in the section page or a common menu like the settings? Or is it possible to override the existing 'Add Contact' button?



Regards,

Ramya



Show all comments

Hi dear community,

We have created a new Freedom UI section in the mobile. We want that a specific 'Field Group' is hidden permanently.

We dont want to delete this field group from the wizard because this would change the positioning of the elements in the layout.

Is there any specific code we have to insert in the Manifest or RecordPageSettings schemas.

Sasori 

Like 0

Like

3 comments

Hi Community,

Any update regarding this topic.

Sasori

Hello Community,

Any update?

Sasori

Hi,

The "Feild Group" doesn't have the property "visible" so it cannot be hidden. In your case, it would be better to delete it and then change the position of the needed elements manually in the RecordPageSettings schema.

Show all comments

Hello Creatio-Community,

do you know where to find the results from the system setting "Enable gathering mobile application usage statistics" (CollectMobileAppUsageStatistics)? I have not been able to find a lookup or something similar.

Like 0

Like

1 comments

Hello,

 

It should be saved locally on the mobile device you are using.

 

Best regards,

Yuliya.

Show all comments

Hello,



I am trying to sort list in Mobile.



I was able to sort Detail List, the list located in Section > Related/History Tab, but the sorting algo won't take effect in the Section List and Embedded Detail.



Here's my other post: https://community.creatio.com/questions/mobile-list-sorting

 

What am I missing here? Is sorting only available for Related/History Tab detail list?

Like 0

Like

2 comments

Update:



I was able to make it worked but only for Classic Mobile UI.



I need something like Terrasoft.sdk.RecordPage.configureEmbeddedDetail that will work for Freedom UI in mobile.

Hello Solem Khan,

1. Prepare JSON sorting config:

"sortingConfig": {
    "default": [
         {"columnName": "Name", "direction": "desc"}
     ],
}

2. Prepare diff for viewModelConfig. Actually, add sortingConfig to viewModelConfig → attributes → Items → modelConfig.

[
 {
  "operation":"insert",
  "name":"Attribute_Items_SortingConfig",
  "parentName":"Attribute_Items_ModelConfig",
  "propertyName":"sortingConfig",
  "values":{
   "default":[
    {
     "columnName":"Name",
     "direction":"desc"
    }
    ]
  }
 }
]

3. Add this diff to scheme. For instance, open scheme MobileFUIUsrSectionGridPageSettingsDefaultWorkplace and add diff to section with name = "settings" in block values (in “stringified” format):

"viewModelConfigDiff": "[{\"operation\":\"insert\",\"name\":\"Attribute_Items_SortingConfig\",\"parentName\":\"Attribute_Items_ModelConfig\",\"propertyName\":\"sortingConfig\",\"values\":{\"default\":[{\"columnName\":\"Name\",\"direction\":\"desc\"}]}}]"

If it’s needed to sort by several columns, set configs in “default“ property like this:

"viewModelConfigDiff": "[{\"operation\":\"merge\",\"name\":\"Attribute_ContactCareerDetailV2EmbeddedDetail_SortingConfig\",\"values\":{\"default\":[{\"columnName\":\"StartDate\",\"direction\":\"desc\"},{\"columnName\":\"Primary\",\"direction\":\"desc\"}]}}]"

Best regards, Anhelina!

Show all comments
Question

Sorting in setup for mobile do not reflect in actual.



Here's what I did:

//New Module UsrMobileActivityModuleConfig :
Terrasoft.sdk.GridPage.setOrderByColumns("Activity", {
	column: "StartDate",
	orderType: Terrasoft.OrderTypes.DESC
});
 
//MobileApplicationManifestDefaultWorkplace > Models :
"Activity": {
			"RequiredModels": [
				"Activity",
				"ActivityPriority",
				"ActivityType",
				"ActivityCategory",
				"ActivityStatus",
				"CallDirection",
				"ActivityFile",
				"FileGroup",
				"ActivityParticipant",
				"Contact",
				"ActivityParticipantRole"
			],
			"ModelExtensions": [],
			"PagesExtensions": [
				"MobileActivityRecordPageSettingsDefaultWorkplace",
				"UsrMobileActivityModuleConfig"
			]
		},
 
//MobileApplicationManifestDefaultWorkplace > ModelDataImportConfig:
{
				"Name": "Activity",
				"SyncColumns": [
					"Account",
					"Opportunity",
					"StartDate"
				]
},

 

Like 0

Like

5 comments

Hi Solem,

 

I've created the very same rule and test it at the moment and sorting is ascending (tested descending first and then tried ascending and it worked in both cases):

 

--Rule

--Result

If you perform this setup locally try recycle the application pool in IIS and relogin to the mobile application.

Oleg Drobina,



I am installing the maintenance tool to try clearing redis and restarting app_pool.



Can you show me the config for the sort in your module? Not sure if I missed something.

Solem Khan Abdusalam,

 

It's absolutely same as in your example. The code is in my previous messge, here is the text (module name - UsrMobileActivityModuleConfig):

Terrasoft.sdk.GridPage.setOrderByColumns("Activity", {
	column: "StartDate",
	orderType: Terrasoft.OrderTypes.ASC
});

Added into PagesExtension for Activity model:

"Models": {
		"Activity": {
			"RequiredModels": [
				"Activity",
				"ActivityPriority",
				"ActivityType",
				"ActivityCategory",
				"ActivityStatus",
				"CallDirection",
				"SocialMessage",
				"SysFile",
				"FileGroup"
			],
			"ModelExtensions": [],
			"PagesExtensions": [
				"UsrMobileActivityActionsSettingsUsrForTest",
				"UsrMobileActivityGridPageSettingsUsrForTest",
				"UsrMobileActivityRecordPageSettingsUsrForTest",
				"UsrMobileActivityModuleConfig"
			]
		},

After relogin it worked correctly.

Oleg Drobina,



Made a trial account. Tried doing it there and it is not working.

Installed Maintenance tool to clear redis cache and restart app_pool, still not working. This is weird.

Oleg Drobina,



I was able to sort it, Yehey!



Problem is it only worked for Classic View, we are using Mobile Freedom UI where the following is not working:

 

Terrasoft.sdk.GridPage.setOrderByColumns
Terrasoft.sdk.RecordPage.configureEmbeddedDetail

Do you have any idea how to sort in Freedom UI for Mobile?

Show all comments

I want to remove the ability to add new records in lookup in mobile .

How can i hide the "+" button ?

Like 0

Like

1 comments

Hello,

Could you please clarify where exactly you want to hide "+" sign, because I can't find such in any of basic lookups. Add a screenshot if possible.

Thank you in advance!

Show all comments

I am trying to get the current user role in mobile but it is not working !

 

Terrasoft.sdk.Model.addBusinessRule("Activity", {

  name: "GetRoleFromtheUser",

  ruleType: Terrasoft.RuleTypes.Custom,

  triggeredByColumns: ["UsrVisitType","UsrTypeDeVisiteManager"],

  events: [Terrasoft.BusinessRuleEvents.ValueChanged, Terrasoft.BusinessRuleEvents.Save],

  executeFn: function(record, rule, column, customData, callbackConfig) {



    var myrecord = record; 

    var currentUser =Terrasoft.CurrentUserInfo.userId;

    var store = Ext.create('Terrasoft.store.BaseStore', {

      model: 'SMVwUserRoles'

    });

    var queryConfig = Ext.create('Terrasoft.QueryConfig', {

      columns: ['SMId', 'SMUserName', 'SMRoleName'],

      modelName: 'SMVwUserRoles'

    });

    store.loadPage(1, {

      queryConfig: queryConfig,

 

      filters: Ext.create('Terrasoft.Filter', {

        property: 'SMId',

        value: currentUser

      }),

      callback: function(records, operation, success) {

        var loadedRecord = records[0];

        if (loadedRecord) {

          var role = loadedRecord.get('SMRoleName');                                                                                                    

          if (role=='Sales Management') {                                                                                                                   

            record.changeProperty("UsrVisitType", {

                 hidden: true,

              readOnly: true

               });

          }else{

            record.changeProperty("UsrTypeDeVisiteManager", {

                 hidden: true

               });

          }

          }

        },

      });



Ext.callback(callbackConfig.success, callbackConfig.scope, [hidden,readOnly]); 

  }

});

Any idea please ?

Like 1

Like

1 comments

Hello!

You’re thinking in a right way and I would recommend you to change the logic of getting the role a bit. I tested this code on basic table SysAdminUnitInRole where we have a column SysAdminUnitRoleId

var currentUser =Terrasoft.CurrentUserInfo.userId;
var store = Ext.create('Terrasoft.store.BaseStore', {
  model: 'SysAdminUnitInRole'
});
var queryConfig = Ext.create('Terrasoft.QueryConfig', {
  columns: ['SysAdminUnitRoleId'],
  modelName: 'SysAdminUnitInRole'
});

Variable records structure looks like this:

 

And each class contains SysAdminUnitRoleId:

 

I used ID from loadedRecord.get('SysAdminUnitRoleId') and it works for me to see the role. You can do it in two ways:

  1. Create a loop for each “records” element and check if SysAdminUnitRoleId is equal to the user's current role id
  2. If you want to use “role=='Sales Management'” you can create a new object to display extensions of ID and role names.

P.S. Check if you added models to MobileApplicationManifestDefaultWorkplace:

"Models": { 
			"Activity": {
			"RequiredModels": ["SysAdminUnitInRole"],
			"ModelExtensions": ["UsrActivityModel"],
			"PagesExtensions": []
		}
	},

 

Show all comments

Hi Community,

 

What is the correct syntax to add multiple or array of filter to store.loadPage in mobile. We've tried below but it is not working.

Like 0

Like

1 comments

Hello Fulgen,

 

Something like that:

...
var filtersConfig = {
				type: Terrasoft.FilterTypes.Group,
				logicalOperation: Terrasoft.FilterLogicalOperations.And,
				subfilters: [
					{
						property: "Order",
						value: currentOrderId
					},
					{
						property: "Product",
						value: productId
					}
				]
			};
...
store.loadPage(1, {
			isCancelable: true,
			filters: Ext.create("Terrasoft.Filter", filtersConfig),
			queryConfig: queryConfig,
			callback: function(loadedRecords, operation, success) {
...

 

Show all comments