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

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

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

Hello , i have this requirement where in creatio mobile app i need to have a map view .

I can't a map app outside of creatio . is there any solutions ? any proposition ? any way to help me integrate a map inside my mobile app instance ?

Like 0

Like

4 comments

Hello,

 

You can inspect the Account address detail as an example of integration with OpenStreetMaps in the system and Field Force application as an example of maps functionality on mobile apps.

Bogdan,

can you explain more please ?

Bogdan,

these posts are using maps from outside creatio , in my case i want the map view integrated within creatio map 

Show all comments

Hi community!

I'm adding a br on the mobile app to filter a custom lookup field based on another field's value.

To do this I have created a separate module and included it in the MobileApplicationManifestDefaultWorkplace.

 

It's not working on the app.

Could you help me out understanding what's missing?

Here's the BR 

Terrasoft.sdk.Model.addBusinessRule("Account", {
	ruleType: Terrasoft.RuleTypes.MutualFiltration,
	triggeredByColumns: ["Industry", "UsrApplication"], 
	connections: [{
		parent: "Industry", //Lookup field on Account
		child: "UsrApplication", // Custom Lookup field on Account (the Obj UsrApplication has a Lookup column "Industry")
		connectedBy: "UsrIndustry" // Lookup field on the "UsrApplication" obj
	}]
});

 

Like 0

Like

0 comments
Show all comments

Hi Team, 

 

There is any way to filter a detail using filtermethod or some logic in the mobile app?

 

Like 0

Like

2 comments

Hello,

 

Your business task could be achieved only by development.

Examples of how to set up mobile apps can be found in our Academy:

https://academy.creatio.com/docs/developer/mobile_development/customiza…

We have already created the appropriate project for our R&D team. We will increase its priority for realization in further releases.

there is any OBB example to follow?

Show all comments

HI all,

I need your help.

I'm Trying to customize the mobile app. But each time I follow the documentation 

and need to modify the manifest module with:

e.g: 

"CustomSchemas": ["mycustommudule"],

 

I get console error (on the debugging browser) saying:

Path for schema 'mycustommudule' not found.

* i get this error for every custom module I create and try to add it to "CustomSchemas".

 

Or  adding "PagesExtensions": [mycustommudule,...]  <-- doesn't work

 

Basically i'm trying to add a button to my custom section on the mobile app & handle it's "on click" event. but i just can't make it work..

* I followed the documentation on :

https:/academy.creatio.com/docs/developer/mobile_development/customization/manifest/add_a_button  

 

with no luck...

 

Thank.

  

Like 0

Like

1 comments

HI Eran!

 

Have you tried generating source code for all schemas and compiling the app?

 

Best regards,

Max.

Show all comments

I have created a second workplace for the mobile app, but when I add the activities section the view appears different than the original primary workplace set in the system.

 

When I am in the default workplace that was set in the system, on a mobile device, I am able to toggle in Activities from schedule to list view. In the newly created workplace the calendar options do not appear at the top of the list view screen and there is no option to toggle to the calendar.

Is this normal? There's no documentation indicating this should happen in a new workplace.

Like 0

Like

1 comments

Hi Susan,

 

Thank you for your question!

 

Yes, this is the normal system behavior for now. The thing is you cannot select the calendar view option since you've created a custom workplace. Unfortunately, there is no such option in custom workplaces yet. We've already registered it in our R&D team backlog for consideration and implementation in future application releases. I will assign your case to this project in order to increase its priority. As for now, you should take the setup of the Activities section of the default workplace as an example and recreate it in your custom one to resolve this issue.

 

Best regards,

Anastasiia

Show all comments

Can someone help please?

When adding products to an opportunity using the mobile app I expect the amount to update QTY*Price as it does on the web. 

But this doesn't happen?

Like 0

Like

1 comments

Hello Nicola,

 

There are not such functionality on mobile app but is possible to achieve using mobile sdk . This requires development skills.

 

Under the following link You may find more information about mobile sdk:

https://academy.creatio.com/docs/sites/en/files/pdf/node/1524/Business_rules_in_mobile_application_.pdf

 

First of all You have to overwrite mobile application manifest to extend scope of synchronized product fields and add new page extension

 

MobileApplicationManifestDefaultWorkplace

	"SyncOptions": {
		...
		"ModelDataImportConfig": [
			{
				"Name": "Product",
				"SyncColumns": ["Price"]
			},
			...
			]
		}			
 
 
	"Models": {
		.....	
			"OpportunityProductInterest": {
			"RequiredModels": [
				"OpportunityProductInterest",
				"Product"
			],
			"ModelExtensions": [],
			"PagesExtensions": [
				"UsrOpportunityProductInterestMobileBusinessRules"
			]
		}
		....
		}

Next You have to add business rule with calculation Qty*Price triggered when Qty or Product is populated inside new created module

UsrOpportunityProductInterestMobileBusinessRules

 

Unfortunately i don't have any similar example to share but You can analyse this module MobileOpportunityProductInterestModelConfig from Opportunity package

 

Best regards,

Marcin

Show all comments