Hello, 



I am trying to filter lookup values in the mobile application based on two columns "UsrStartDate" and "UsrEndDate". These two columns are present in the lookup object. But somehow the rule is not working. Any Comments?

Terrasoft.sdk.Model.addBusinessRule("UsrDisplayImages",
	{
		ruleType:Terrasoft.RuleTypes.Filtration,
		events:	
			[
				Terrasoft.BusinessRuleEvents.Load,
				Terrasoft.BusinessRuleEvents.Insert,
				Terrasoft.BusinessRuleEvents.ValueChanged
			],
		triggeredByColumns:["UsrCurrent_Program"],
		filters:Ext.create("Terrasoft.Filter",
			{
				modelName:"UsrDisplay_img_CurrentProgram",
				property:"UsrEndDate",
				comparisonOperation:Terrasoft.ComparisonTypes.GreaterOrEqual,
				value: new Date() // current date	
			})
	});

this is the rule placed in another module : "UsrMobileFilterModelConfig"

Also attaching the code of manifest file 

{
  "SyncOptions": {
    "SysSettingsImportConfig": [],
    "ModelDataImportConfig": [
      {
        "Name": "UsrDisplayImages",
        "SyncColumns": [
          "UsrName",
          "UsrSales_Rep_Name",
          "UsrCurrent_Program",
          "UsrIncentive",
          "UsrComments",
          "UsrBrand",
          "UsrSpiff_Month",
          "UsrColumn3",
          "UsrCustomer_Name_text",
          "UsrPreview",
          "UsrNewSpiffMonth",
          "UsrAmount",
          "UsrCases_Shipped",
          "UsrCases1_Displayed",
          "UsrSales_Rep",
          "UsrColumn11",
          "UsrCustomer_Name"
        ]
      },
      {
        "Name": "Employee",
        "SyncColumns": [
          "Manager"
        ]
      },
      {
        "Name": "UsrDisplay_img_CurrentProgram",
        "SyncColumns": [],
        "Ignore": false,
        "QueryFilter": {
          "items": {
            "dab489b7-06c4-4f1a-b588-0fe00e965bf7": {
              "filterType": 1,
              "comparisonType": 8,
              "isEnabled": true,
              "trimDateTimeParameterToDate": true,
              "leftExpression": {
                "expressionType": 0,
                "columnPath": "UsrEndDate"
              },
              "isAggregative": false,
              "dataValueType": 8,
              "rightExpression": {
                "expressionType": 1,
                "functionType": 1,
                "macrosType": 4
              }
            },
            "5c38cd37-a1bd-49bb-9cd8-2f11e8b7fbee": {
              "filterType": 1,
              "comparisonType": 6,
              "isEnabled": true,
              "trimDateTimeParameterToDate": true,
              "leftExpression": {
                "expressionType": 0,
                "columnPath": "UsrStartDate"
              },
              "isAggregative": false,
              "dataValueType": 8,
              "rightExpression": {
                "expressionType": 1,
                "functionType": 1,
                "macrosType": 4
              }
            }
          },
          "logicalOperation": 0,
          "isEnabled": false,
          "filterType": 6,
          "rootSchemaName": "UsrDisplay_img_CurrentProgram"
        },
        "SyncFilter": null
      },
      {
        "Name": "UsrDisplay_img_yes_no_lookup",
        "SyncColumns": []
      },
      {
        "Name": "UsrDisplay_Img_Spiff_Month",
        "SyncColumns": []
      },
      {
        "Name": "Contact",
        "SyncColumns": []
      },
      {
        "Name": "SocialMessage",
        "SyncColumns": [
          "EntityId"
        ]
      },
      {
        "Name": "SysFile",
        "SyncColumns": [
          "RecordId",
          "Name",
          "Type",
          "Data",
          "Size",
          "RecordSchemaName"
        ],
        "QueryFilter": {
          "items": {
            "DesignerDefaultRecordSchemaNameFilter": {
              "filterType": 4,
              "comparisonType": 3,
              "isEnabled": true,
              "trimDateTimeParameterToDate": false,
              "leftExpression": {
                "expressionType": 0,
                "columnPath": "RecordSchemaName"
              },
              "rightExpressions": [
                {
                  "expressionType": 2,
                  "parameter": {
                    "dataValueType": 1,
                    "value": "UsrDisplayImages"
                  }
                }
              ]
            }
          },
          "logicalOperation": 0,
          "isEnabled": true,
          "filterType": 6
        }
      },
      {
        "Name": "FileGroup",
        "SyncColumns": []
      },
      {
        "Name": "UsrDisplay_Image_Status",
        "SyncColumns": []
      },
      {
        "Name": "UsrBrand",
        "SyncColumns": []
      },
      {
        "Name": "Account",
        "SyncColumns": []
      }
    ]
  },
  "Modules": {
    "UsrDisplayImages": {
      "Group": "main",
      "Model": "UsrDisplayImages",
      "Position": 0,
      "isStartPage": false,
      "Title": "UsrDisplayImagesSectionTitle",
      "Hidden": false,
      "screens": {
        "start": {
          "schemaName": "UsrMobileUsrDisplayImagesGridPageSettingsDefaultWorkplace"
        },
        "edit": {
          "schemaName": "UsrMobileUsrDisplayImagesRecordPageSettingsDefaultWorkplace"
        }
      }
    }
  },
  "Models": {
    "UsrDisplayImages": {
      "RequiredModels": [
        "UsrDisplayImages",
        "Employee",
        "UsrDisplay_img_CurrentProgram",
        "UsrDisplay_img_yes_no_lookup",
        "UsrDisplay_Img_Spiff_Month",
        "Contact",
        "SocialMessage",
        "SysFile",
        "FileGroup",
        "UsrDisplay_Image_Status",
        "UsrBrand",
        "Account"
      ],
      "ModelExtensions": [],
      "PagesExtensions": [
        "UsrMobileUsrDisplayImagesActionsSettingsDefaultWorkplace",
        "UsrMobileUsrDisplayImagesGridPageSettingsDefaultWorkplace",
        "UsrMobileUsrDisplayImagesRecordPageSettingsDefaultWorkplace",
        "UsrMobileFilterModelConfig"
      ]
    },
    "SocialMessage": {
      "RequiredModels": [],
      "ModelExtensions": [],
      "PagesExtensions": []
    },
    "SysFile": {
      "RequiredModels": [],
      "ModelExtensions": [],
      "PagesExtensions": []
    }
  },
  "ModuleGroups": {
    "main": {}
  },
  "UseUTC": true,
  "Remove": {
    "SyncOptions": {
      "ModelDataImportConfig": [
        {
          "Name": "UsrDisplay_img_CurrentProgram",
          "QueryFilter": null
        }
      ]
    }
  }
}

 

Like 0

Like

0 comments
Show all comments

After enabling the Freedom UI option in the Activities section in the mobile application settings, the view changes from the calendar view to the records list view.

How do I enable the Freedom UI-compatible calendar view in the mobile app?

Like 0

Like

2 comments

I have the same question :)

Hello!



The schedule for Freedom UI will be available, but not in the immediate future. We cannot provide an exact timeframe, but for now, you can combine sections on Freedom UI and the old UI. You can use the old UI for the "Activities" section along with the schedule.



Best regards,

Anton

Show all comments

I need to read system settings in mobile application from client side. Can anyone help me on this?

Like 0

Like

4 comments

Hello Pavan,

 

Could you please elaborate on your business task? 

You can use Terrasoft.SysSettings.YourCodeSysSetting if the system settings is cached and enabled for portal users.

Bogdan,

I have a Boolean in system setting. I need to show a popup if the Boolean is false. For that, I have to read system setting value.

Hello Pavan,

 

Please check the Federico's reply above. Is it suitable in your case? 

Show all comments

Hi Community,

I'm currently working on Creatio mobile application (Classic UI), and I've encountered an issue with the Terrasoft.Camera.captureFromCamera() function. I've set up a custom button that, when clicked, is supposed to open the camera. However, I've noticed that the success callback is being triggered upon clicking the custom button, rather than after capturing an image as expected.

Here's a snippet of the code I'm using:



Terrasoft.Camera.captureFromCamera({

    quality: 80,

    success: this.onCameraCapture,

    failure: this.onCameraFailure,

    scope: this

});

The onCameraCapture function should ideally be called after the user captures an image in the camera,but it seems to be triggered upon clicking the custom button instead.

 

Can you help me on this?

 

Like 0

Like

2 comments

Hello Pavan,

 

I checked calling the onCameraCapture method in the MobileFileAndLinksEmbeddedDetailGenerator module (attaching a photo to the attachment detail in any section) and the onCameraCapture method is called only after the photo is taken and selected to be uploaded. Please check the code used there, it should help call the same login upon a custom button click.

Oleg Drobina,

I am also facing an issue with reading the file. The file was empty.

Show all comments

We have two fields that are mandatory  in mobile , but i can save the record even if they are not filled in which is weird and not usual !

This is the code :

Please any idea what may be the problem ?

 

Like 0

Like

5 comments

Two possible options:

 

1) You don't call the callback function at the end of this custom rule execution (Ext.callback(callbackConfig.success, callbackConfig.scope, [isValid]);). Here is a simple code of the rule I created locally:

Terrasoft.sdk.Model.addBusinessRule('Account', {
    ruleType: Terrasoft.RuleTypes.Custom,
    triggeredByColumns: ['AlternativeName'],
    events: [Terrasoft.BusinessRuleEvents.ValueChanged, Terrasoft.BusinessRuleEvents.Save],
    executeFn: function(record, rule, column, customData, callbackConfig) {
        var isValid = true;
        if (record.get('AlternativeName').length == 0) {
            isValid = false;
            record.changeProperty('AlternativeName', {
                    isValid: {
                        value: isValid,
                        message: 'Column is empty'
                    }
            });
        } else {
            record.changeProperty('AlternativeName', {
                    isValid: {
                        value: isValid
                    }
            });
        }
        Ext.callback(callbackConfig.success, callbackConfig.scope, [isValid]);
    }
});

2) You have isValid as true but still display the message and in fact the column is valid and you can save it and at the same time see the message under the columns

I setup a simple rule in my mobile app and it perfectly worked and prevented record saving in case the record is invalid

Oleg Drobina,

Here is all the code :

developer,

 

please share the code not in the screenshot next time. And also:

 

1) Did you debug its execution in the Android Studio?

2) Remove the "message" property when the isValid is true, it's not needed there

developer,

 

and additionally you always pass isValid value (that is always true) to the callback call:

This will also always allow to save the record.

developer,

 

yes, that's it. Tested locally and the record is saved when the callback is called with true even if some column isValid property is false. You need to change the logic in your code and modify and use the isValid property value in it using the example I shared above.

Show all comments

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