Please help.

I created an object called UsrAppMobNotifications, which includes a Boolean variable UsrBoolRead. In the mobile application version 8.1, I need to set up a business rule so that when a user opens a record of this object, the UsrBoolRead variable becomes true.

 

The code of the mobile app's record page (UsrMobileUsrAppMobNotificationsRecordPageSettingsPortal) doesn't contain any blocks (like handlers).

Question 1: How can I add my own business rule?

Question 2: I tried to create a rule based on examples, but it doesn't work.



My rule^

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

name: "SetUsrBoolReadTrueRule",

ruleType: Terrasoft.RuleTypes.Custom,

events: [Terrasoft.BusinessRuleEvents.Load],

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

model.set("UsrBoolRead", true);

Ext.callback(callbackConfig.success, callbackConfig.scope);

}

});

Like 0

Like

1 comments

Hello.

Please be advised that adding business rules to a page using the Terrasoft.sdk.Model.addBusinessRule(name, config) method is only supported on the old user interface. Unfortunately, the feature to create business rules on the mobile application is not yet available, as it is currently under development. However, I can assist you in setting up card-level business rules, that might be helpful for you.

At the moment, the difference between the rules on the card and the model is insignificant. Namely, the difference is that the card has Visibility rules that can show or hide card elements. Therefore, let's consider this particular example, and try to hide a column under a condition.

1. Set up the rules in the web.

2. The names of the controls ("Code" and "Element code") must be given according to the names of the columns. That is, if the column is called UsrText, then the control should be called that way (because the names are generated by the web by default):

3. The rule that hides the UsrText field can be configured as follows:

When saving, do not forget to click Save in the card itself.

4. Add a new (or existing) section in the mobile application wizard and configure the card properly.

5. Go to the Configuration (WorkspaceExplorer) and look for the card setup scheme (scheme name format: Mobile[Object name]RecordPageSettings[Workspace name]):

In this case, the object name is Rules.

6. Open this schema. Open its metadata (Actions → Open metadata) and look at its metadata (Metadata (Read-Only) section) and copy its Uid, PackageUid and CreatedInPackageUId.



7. Export the rules configured in step 3.

8. This metadata needs to be slightly adapted to the mobile platform. Open the downloaded metadata file and make the following changes:

а) Change the Uid. You can either generate it or simply change a few digits/characters in the current value. The old UId must be changed throughout the scheme (at least 2).

b) Give a new name to the Addon in Name and A2. The format will be as follows: [Object name]RecordPageSettingsBusinessRule (for example, RulesRecordPageSettingsBusinessRule).

c) Replace all "EntitySchemaManager" with "ClientUnitSchemaManager", if any.

d) In B6, write the PackageUId from step 6.

e) In AD1 and TargetSchemaUId, write the UId from step 6.

f) In A5 we write the CreatedInPackageUId from step 6.

g) Replace all the names of the controls generated on the web with the corresponding column names. You can search for them using the following masks: LookupAttribute_, Input_, ComboBox_.

For example, instead of LookupAttribute_6wy705z, you should use UsrContactType.

h) Save the changes.

9. Import this modified schema. Select the desired package in the Configuration, click "Add" and select the "Import" item in the list (at the moment it is the last in the list).

As a result, in the package in which this section was added in the mobile application wizard, an Addon scheme with rules that are linked to the card configuration scheme in the mobile application should appear.

10. After that, synchronize the mobile app with Creatio and check the rule's operation.

Show all comments

Hi everyone,

In the mobile app functionality to capture an image to upload it to attachments, is there a way to obtain the image data as soon as it has been uploaded? Or is there a way to obtain the bytes from the url that is obtained on image capture?



Note: The url obtained is not a data url but a path to the captured image.

 

Thanks,

Ramya

Like 0

Like

1 comments

Hello,

 

Thank you for your question!

 

We kindly ask you to provide us with more detailed information about your needs.

Show all comments

I have a detail in my mobile section that should appear only if type de record is A ! 

How to Hide/Show detail in mobile based on a condition please ?

Like 1

Like

1 comments

This should work for the embedded detail. You need to create a custom business rule to check the condition and then use something like:

var view = this.getView();
        var panel = view.getPanel();
        var type = record.get("UsrDriverCheckType");
        var isNeededType = (type && type.getId() === "079acedd-585f-4a0e-aff0-eb419ec09925");
        var panelItems = panel.getItems();
        for (var i = 0, ln = panelItems.getCount(); i < ln; i++) {
            var item = panelItems.items[i];
            if (item.getName() === "UsrSchema11DetailEmbeddedDetail") {
                var isItemHidden = item.getHidden();
                if (type && isNeededType) {
                    if (!isItemHidden) {
                        item.setHidden(true);
                    }
                } else if (type) {
                    if (isItemHidden) {
                        item.setHidden(false);
                    }
                }
            }
        }

This should hide the detail with UsrSchema11DetailEmbeddedDetail name.

Show all comments

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

3 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



Oleg Drobina,

Hello, Oleg 
I find it a little difficult to figure out how to implement the freedom ui component configuration in my page, even if Creatio documentation lists it all: https://academy.creatio.com/docs/8.x/dev/development-on-creatio-platfor…;

The "UsrMobileUsrLeaveRequestRecordPageSettingsWorkplace2" client module is attached to this mobile page for a custom section that I designed called "UsrLeaveRequest."
How do I proceed about adding a custom button to this edit page now?

[
   {
       "operation": "insert",
       "name": "settings",
       "values": {
           "entitySchemaName": "UsrLeaveRequest",
           "details": [],
           "columnSets": [],
           "localizableStrings": {
               "SocialMessageDetailCaptionUsrLeaveRequest_caption": "Feed",
               "AttachmentsDetailCaptionUsrLeaveRequest_caption": "Attachments",
               "primaryColumnSetUsrLeaveRequest_caption": "General information",
               "UsrEmployeV2_DetailStandardDetailUsrLeaveRequest_caption": "Employees detail"
           },
           "settingsType": "RecordPage",
           "operation": "insert",
 
       }
   },
   {
       "operation": "insert",
       "name": "SocialMessageDetailV2StandardDetail",
       "values": {
           "caption": "SocialMessageDetailCaptionUsrLeaveRequest_caption",
           "entitySchemaName": "SocialMessage",
           "showForVisibleModule": true,
           "filter": {
               "detailColumn": "EntityId",
               "masterColumn": "Id"
           },
           "operation": "insert"
       },
       "parentName": "settings",
       "propertyName": "details",
       "index": 0
   },
   {
       "operation": "insert",
       "name": "AttachmentsFlutterDetailStandardDetail",
       "values": {
           "caption": "AttachmentsDetailCaptionUsrLeaveRequest_caption",
           "entitySchemaName": "SysFile",
           "filter": {
               "detailColumn": "RecordId",
               "masterColumn": "Id"
           },
           "operation": "insert"
       },
       "parentName": "settings",
       "propertyName": "details",
       "index": 1
   },
   {
       "operation": "insert",
       "name": "UsrEmployeV2_DetailStandardDetail",
       "values": {
           "caption": "UsrEmployeV2_DetailStandardDetailUsrLeaveRequest_caption",
           "entitySchemaName": "Employee",
           "filter": {
               "detailColumn": "Manager",
               "masterColumn": "UsrApplicant"
           },
           "detailSchemaName": "UsrEmployeV2_Detail",
           "operation": "insert"
       },
       "parentName": "settings",
       "propertyName": "details",
       "index": 2
   },
   {
       "operation": "insert",
       "name": "primaryColumnSet",
       "values": {
           "items": [],
           "rows": 1,
           "entitySchemaName": "UsrLeaveRequest",
           "caption": "primaryColumnSetUsrLeaveRequest_caption",
           "position": 0,
           "operation": "insert"
       },
       "parentName": "settings",
       "propertyName": "columnSets",
       "index": 0
   },
   {
       "operation": "insert",
       "name": "42d4b33c-f361-44d4-92cd-07e8db664fca",
       "values": {
           "row": 0,
           "content": "Leave Request No.",
           "columnName": "UsrLeaveReaquestNo",
           "dataValueType": 1,
           "operation": "insert"
       },
       "parentName": "primaryColumnSet",
       "propertyName": "items",
       "index": 0
   },
   {
       "operation": "insert",
       "name": "0d5ca981-1558-4e4d-b1a2-2b2b9dbd422c",
       "values": {
           "row": 1,
           "content": "End Date",
           "columnName": "UsrEndDate",
           "dataValueType": 8,
           "operation": "insert"
       },
       "parentName": "primaryColumnSet",
       "propertyName": "items",
       "index": 1
   },
   {
       "operation": "insert",
       "name": "2013f978-c87f-4896-96be-5383cfd044e3",
       "values": {
           "row": 2,
           "content": "Start Date",
           "columnName": "UsrStartDate",
           "dataValueType": 8,
           "operation": "insert"
       },
       "parentName": "primaryColumnSet",
       "propertyName": "items",
       "index": 2
   },
   {
       "operation": "insert",
       "name": "266417d3-f847-4386-af45-2674e9e779bb",
       "values": {
           "row": 3,
           "content": "Applicant",
           "columnName": "UsrApplicant",
           "dataValueType": 10,
           "operation": "insert"
       },
       "parentName": "primaryColumnSet",
       "propertyName": "items",
       "index": 3
   },
   {
       "operation": "insert",
       "name": "1655829d-ce75-476c-9350-ce2696ecbf6d",
       "values": {
           "row": 5,
           "content": "Reason",
           "columnName": "UsrReason",
           "dataValueType": 1,
           "operation": "insert"
       },
       "parentName": "primaryColumnSet",
       "propertyName": "items",
       "index": 4
   },
   {
       "operation": "insert",
       "name": "9f677f71-3322-4e75-9938-69ca4e1c650f",
       "values": {
           "row": 6,
           "content": "Status",
           "columnName": "UsrStatus",
           "dataValueType": 10,
           "operation": "insert"
       },
       "parentName": "primaryColumnSet",
       "propertyName": "items",
       "index": 5
   },
   {
       "operation": "insert",
       "name": "3d874029-b467-4d7b-9eb0-d2ebfbe20403",
       "values": {
           "row": 7,
           "content": "Working Days Count",
           "columnName": "UsrWorkingDaysCount",
           "dataValueType": 4,
           "operation": "insert"
       },
       "parentName": "primaryColumnSet",
       "propertyName": "items",
       "index": 6
   },
   {
       "operation": "insert",
       "name": "bc0d7d7e-ffdf-44a5-98b3-0a10094341e2",
       "values": {
           "row": 4,
           "content": "Applicant.Manager",
           "columnName": "UsrApplicant.Manager",
           "dataValueType": 10,
           "operation": "insert"
       },
       "parentName": "primaryColumnSet",
       "propertyName": "items",
       "index": 7
   }
]
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

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