mobile
Mobile app
7.16
Mobile_Creatio

Hello, 

I want to override initializeView or pageLoadComplete in mobile app. I have to do some changes before page load completes.

 

on web app I override onEntityInitialized function and I can do things there.

 

How can I override functions in mobile app?

Like 0

Like

3 comments

Hello Luka,

 

If you need to perform any actions on the mobile before the page is loaded, you can use business rules functionality for that. Please check this Academy Article.

 

Best regards,

Bogdan S.

Bogdan Spasibov,

Yes, I have business rule and I am setting new value of empty field using it. Because of this field is empty, it is hidden on record page and after business rule sets value, it is stays hidden.

But, when I select another contact and then select updated contact again, it shows updated field.

 

Picture 1 . Updated, but didn't change focus

 

Picture 2, Changed focus and returned to previously selected contact

 

Now this Field 'UsrGeneralAgreementId' is visible with its data.

I couldn't override initializeView function, but resolved it using business rule and resolved field visibility problem using changeProperty function.

 

record.changeProperty("UsrGeneralAgreementUrl", {
    hidden: false
});

 

Show all comments
url
browser
Mobile app

Hello, 

I have button in mobile application, it's onClick function builds url of our api.

I want to navigate user on that url from onClick handler function, to open browser.

 

How I can navigate user to my url?

Like 0

Like

14 comments

Hello Luka,

 

Please add this function to the module that defines your custom button:

 

execute: function openLink () {

    var appWindow = window.open("https://www.wikipedia.org/","_blank");

    setTimeout( function () {if (!appWindow) {

        appWindow.location ="https://academy.creatio.com/";

            }

            },1000);

}

 

As a result once the button is clicked the function will be executed and in this example the https://www.wikipedia.org/ link will be opened.

 

Best regards,

Oscar

Oscar Dylan,

Is your code fragment for Mobile Application? 

Luka Grdzelishvili,

 

Yes, it was added to the custom module that was then added to the 

CustomSchemas of the mobile application manifest (the button was created using this article https://community.creatio.com/articles/adding-custom-user-action-mobile…) and this function was an example provided in this StackOverflow article https://stackoverflow.com/questions/11710902/can-i-make-a-link-that-wil….

 

Best regards,

Oscar

Oscar Dylan,

Nope, my question is not about opening mobile application from web page.

my question is about, opening web page from mobile application.

Luka Grdzelishvili,

 

Please apply this code, it opens the 

https://www.wikipedia.org/ website upon clicking a custom button inside the mobile app.

 

Best regards,

Oscar

Mark as 'Best reply'

Oscar Dylan,

This solution is not working, as I already said it is for Web Browser. When I start test tool for application, it runs using chrome and window.open works, but in android application, it has error. 

I have this fragment in my execute function

var winPrint = window.open("", "_blank");
winPrint.document.write(response.value.data.agreementText);
winPrint.document.close();

 

I saw error log, and there is problem at winPrint.document.write, Cannot read property 'write' of undefined.

 

I tried var winPrint = window.open("https://google.com", "_blank"); and it works. Now I have what is that view? and how can I set HTML content.

 

My api returns HTML string. I wrote question about url because I thought it was impossible to open web view from JS execute function.

It works, thanks

I have another problem now.

I need to print opened document, but there is error winPrint.print is not a function.

Can I somehow print opened page ?

Hi Luka,

 

Could you please specify where you are trying to write your code? Is this related to the mobile app needs described above or you want to implement another feature? What is your business task? Could you please also clarify what schema you use and provide a full code so we will be able to test it at our end? 

 

Regards,

Anastasiia

Anastasiia Markina,

Hello,

My business task is:

  1. add button to get General Agreement (we have Html format at our API, if needed we can return URL)
  2. after successful response, take returned html (or url) and show document to user
  3. show print preview to print document.

In web, we have small JS code to handle it.

// url parameter is empty because we are writing html in document.
// also we can generate blob url and set it without writing directly in document
var winPrint = window.open("", "", "left=0,top=0,width=800,height=600,toolbar=0,scrollbars=0,status=0");
winPrint.document.write(response.value.data.agreementText);
winPrint.document.close();
 
setTimeout(function() {
    winPrint.print();
}, 1000);

On mobile app, I tried to generate blob url and code fragment is 

var blobUrl = URL.createObjectURL(
    new Blob([response.value.data.agreementText], { type: "text/html" })
);
var winPrint = window.open(blobUrl);
 
setTimeout(function() {
    winPrint.print();
}, 1000);

this code, opens webview and shows my html, but print function is not defined, beacuse winPrint doesn't owns it.

 

After it, I tried another way, added new field and set blobUrl as its value. new field type is link, so user must click on it. but second problem appeared, Terrasoft.Utils library has metod getUrl as I remember, which is calling on click, this method validates url, but in this case it makes url invalid. blob url is "blob:file:///..." and this method prepends http:// and because of it blob url is invalid. 



But now I have new workaround, upload pdf on storage, return storage url from API, set it to new field and click on it.



But if print function is implemented and needs specific usage I want to know it. It is not good to upload temp files on storage :( 

Hi Luka,

 

Could you please provide a step-by-step description of your business task? Alas, it is still a bit unclear. 

 

Could you please describe where the button should be located? What section from the left-panel list (menu) should I open? Could you please do it in a way like "go to Cases section > open a case > choose such-and-such field/button > it opens the web-page we need"? The link is the HTML from your API, am I correct? 

 

As for the third point ("show a print preview to print document"), could you please specify how you want to print it? The user opens the General Agreement by clicking the newly-created custom button, then see the Agreement itself in the HTML format and how it will be printed? Will a user be asked to print it (like an alert notification)? Are you going to print it through a usual wireless printer machine like an average hard-printed paper? 

 

Looking forward to hearing from you!

 

Regards,

Anastasiia

Anastasiia Markina,

Hello,

First of all, I already done this task, using business rule, setting API url in custom field and then user must click on it. It opens chrome and our API will show html content and calls print preview in chrome.

 

Yes, We want to print document using wireless printer, using chrome print preview.

 

Here is task:

- Go to contacts -> Select contact -> Open actions -> Click Print General Agreement button.

 

Button action:

  1. Send API request
  2. Read html content of general agreement from response
  3. Show this html content as web page
  4. Initiate print preview

To achieve this, I tried:

  1. Open new window using window.open and set document content from api response. this case was failed, because opened window object hasn't Print function to print document, because opened window object isn't fully same as base window object.
  2. Tried to create Blob url using native js functionality, I got link, set it to my custom field value, but on click, bpm utils has function to validate url getUrl and this function cant validate blob url, because it is blob:file:///..... and this function adds http:// from behind.
  3. I made some changes at my api, added new endpoint to return rendered html view. In bpm 'Print general agreement' button makes api request and sets url in custom field value. So user can click on api url, all bpm validations working because url starts with https:// and opens chrome where document is rendered from api.

Luka Grdzelishvili,

 

Let's consider your business task implementation from the very beginning.

 

1. Here is the instruction by the link below on how you can add a button to the mobile app: 

 

https://community.creatio.com/articles/adding-custom-user-action-mobile…

 

2. This code opens a new web-page: 

 

Ext.define("Terrasoft.MyAction", {
    extend: "Terrasoft.ActionBase",
 
    config: {
        useMask: false,
        title: "MyActionTitle",
        iconCls: Terrasoft.ActionIcons.Copy
    },
 
    execute: function(record) {
        this.callParent(arguments);
        var appWindow = window.open("https://www.wikipedia.org/", "_blank");
		setTimeout(function() {
  		if (!appWindow) {
    		appWindow.location = "https://academy.creatio.com/";
  		}
		}, 1000);
    	}
});

Please do not forget to add a local string as the instructions state, restart the application pool, and re-login to the mobile app. 

 

All these steps described above create a working button and open a web-page (it works correctly at both our end and yours). 

 

Thus, as the main part is implemented and works well, please double-check your API and printer settings. Alas, this point is not our expertise and could not be considered within Creatio development tools. 

 

Regards,

Anastasiia

Anastasiia Markina,

Thanks for very detailed answer. 

 

But, my business task isn't only this what you describe. After opening window with my location, I want to initiate print() function of window object, but it hasn't implemented because opened window object is not same as in chrome or other browser.

 

As I mentioned, I Already done this task, with small workaround. After clicking button, which brings url from API, I set that url to my custom field (viewType: url) . So user click that field and it opens chrome or other browser, and there I can use print() function.

Show all comments
mobile application
Mobile app
Print
html
7.16
Mobile_Creatio

Hello, 

We want to print html document in mobile app. we have HTML document (whole, with , , tags) in response after calling API.

Now we need to show print preview or something like it, to print on connected printer. No matter how, the main thing is to print it.

 

In web app, we made it using small js code. 

1. open new window

2. set html text

3. call print function

but this all are using browser's functionality.

 

How we can make it in mobile app?

Like 1

Like

4 comments

Dear Luka, 



Unfortunately, there are no known examples of adding printing functionality into Creatio mobile application. 

Please follow this link to learn more on development in Creatio Mobile Application in order to find the possible ways of implementing the mentioned functionality:

https://academy.creatio.com/documents/technic-sdkmob/7-16/creatio-devel…



Kind regards,

Roman Brown



 

I think, I explained incorrectly.

I need to invoke print preview, maybe it will platform native or something like it.

Can I create webview and set html to it? in both platforms?

It work, thanks

I have another problem now.

I need to print opened document, but there is error winPrint.print is not a function.

Can I somehow print opened page ?

Show all comments
Filtering
mobile application
Mobile_Creatio

Hi,

 

There are list of columns available in order to search for a contact in Mobile App. I have a use case to remove/hide those and set "Last Name" as the primary and default column to search based on.

E.g. as soon as you chose to set a filter, your text to be search as a last name.

 

How is this possible in Creatio?

 

Thanks

 

Like 0

Like

1 comments

Dear Kavian, 



It's possible to configure columns by which search will be performed in mobile application. 

Information on where and how it can be configured can be found in this academy article: https://community.creatio.com/articles/search-multiple-columns-mobile-a…



Please refer to it and configure the list of columns in your own way. 



Kind regards,

Roman

Show all comments
mobile application
7.15
Mobile_Creatio

Hi community,

 

We implement a user action on "Ocorrências" section that give us our current location and set "imdEndereco" with our coordinates, as you can see on the "Screenshot_1.png".

Also, we created "Serviços" section with detail "Ocorrências" ("Screenshot_3.png") and we successfully establish connection between them. When we tried to create a new record on that detail, our action return our coordinates but cannot successfully set "imdEndereco". ("Screenshot_2.png")

 

Any sugestions on how can we resolve this problem?

 

Thanks in advance.

 

Best regards,

Pedro Pinheiro

Like 1

Like

1 comments

Dear Pedro, 

 

As discussed in the support case, the issue occurred because the imdEndereco was not in the QueryConfig columns and there was an issue with variables not explicitly converted into string type. 

Show all comments
mobile application
7.15
Mobile_Creatio

Hi Community,

In mobile how can I change the display name of column in Section Page just like in web application we can change the column display name in "Section->Select fields to Display".

The image below show the example that I tried put the title name of the column.

 

An example already exists but is directed to change the display name of a column in mobile grid/List Page (https://community.creatio.com/questions/column-display-name-mobile-gridlist-page)

 

 

Thanks an advance.

 

Best Regards,

Pedro Pinheiro

Like 1

Like

1 comments

Dear Pedro,

 

Currently it is not possible to do it in the mobile application. There were multiple similar requests from different customers and our development team accepted this idea. It will be available in the nearest future application versions.

 

Regards,

Dean

Show all comments
mobile
mobile sdk
7.15_()
Mobile_Creatio_()

Hi,

I am relatively new to doing development. I have only used it for the addition/removal of columns in objects, and for cleaning up extra versions of Business Processes.

I am trying to learn more and am starting with trying to set up Business Rules for the Mobile application. I am using this article: https://academy.creatio.com/documents/technic-sdkmob/7-15/business-rules-mobile-application.

 

I can see where to update the extension section to add a business rule to a page, but I don't see where I create the rule itself. It says to use "add business rule", but where do I call that? Is it within the dev interface as a new object?

 

Thanks,

Heather

Like 0

Like

8 comments

Dear Heather, 

To add business rule you would need to create your custom module where you add the code similar to the one in the article, after that create a replacing schema for MobileApplicationManifestDefaultWorkplace and add the Module to the ModelExtensions. I've found a bit more detailed instruction here:

http://agiliztech.com/2019/06/11/conditionally-hideshow-fields-bpmonline-mobile-app/

Best regards, 

Dennis 

Thanks very much, that is helpful.

So I choose Module as the object type for the new rules? 

Dear Heather, 

Yes, you would need to create a module. 

Dennis Hudson,

Can you put code for more than one rule into one module, or do I create one for every rule? Thanks

Heather,

You need to create separate modules for each business rule and put those models to models extensions in MobileApplicationManifestDefaultWorkplace.

Thank you for your help so far. I did a test but my rule is not taking effect in the app. Can you see if you see any glaring errors?

Hello Heather,

Please mention the Object name to which you are applying the business rule.

As per your screenshots 

You need to mention the Object Name in line which i have highlighted.

In the below screen shot, you have defined the module name in page extensions of Opportunity . So the Object Name should be Opportunity. 

 

 

regards,

Sriraksha KS

Senior Software Engineer

AgilizTech software services pvt ltd

Show all comments
Mobile app
Filtering
mobile

Hi all,

Is there any way to read all the existing records of sections in the mobile app without setting up individual filters? If yes, how?

 

Thanks 

Like 0

Like

1 comments

The mobile application doesn't have a section that contains all data. However, it's usually not needed. Probably, it will be possible to give you more information if you describe the business task.

Show all comments
online mode
7.14_()
mobile

Other than the need for synchronization, are there differences in app functionality between online and offline mode? Our instance was in Offline mode by default. 

However, we're considering switching to Online mode because the case-sensitive search in Offline mode is a significant problem for our users. 

Before we switch, however, we'd like to know if Online mode will cause any other differences. (Aside from the need to synch.)

Thanks,

Jeff

Like 0

Like

1 comments

Hello Jeffrey,

Please refer to this Academy article regarding bpm'online mobile application architecture. The main difference between these two modes is that if you select the online operation mode, there is no need to synchronize the application manually. In this mode, the app synchronizes with the bpm'online server automatically, in real time. For example, if you add a task using the mobile application, the task will immediately display in the primary application and vice versa.

In the offline mode, the mobile app user should synchronize periodically with the primary bpm’online application. Changes made to the mobile application are saved on the bpm'online server only after synchronizing with the primary application.

There is also a table in the article provided which displays difference between these two modes.

In different mobile app operation modes, synchronization with bpm’online has different functions. In the online mode, the synchronization is required only to apply configuration changes. In the offline mode, the synchronization is required both to apply configuration changes and to synchronize the data between the mobile app and the bpm’online server.

So as a result Online mode should not cause any errors and it is not significantly different from Offline mode.

Regards,

Oscar

Show all comments

CAn portal user login to mobile application?

Like 0

Like

7 comments

Hello, 

Portal users can login to the mobile app. They would have access to the records and section for which they would have corresponding rights. Also you can create a separate workspace for portal users in mobile application wizard or distribute rights to sections and records for portal users.

The academy page on mobile application wizard below: 

https://academy.bpmonline.com/documents/mobile/7-13/mobile-application-…

Best regards,

Dennis

thanks for the reply . Iam getting an error message while logging as a portal user . Tried two instance (studio and CRM )the error message is same .

 

From: Sethuraghav N ; Sent on: 3/11/2019 11:40:49 AMTo: Bpmonline support ; Cc: Subject: Bpm'online mobile bug report (https://044762-crm-bundle.bpmonline.com/)Model Name: iPhone10,1 Platform: iOS Platform Version: 12.1.4 Resolution: 0x0 IsHybridMode: false UIVersion: UIV2 ApplicationVersion: 7.13.10 ApplicationMajorVersion: 7.13 BackgroundSyncMode: Always ServerUrl: https://044762-crm-bundle.bpmonline.com/ ContactId: 4a778dcf-15af-4bfd-b18c-8ed92354655c CultureName: en-US ApplicationRevision: null WorkplaceCode: DefaultWorkplace ProductInfo: {"ProductName":"bpm'online","ProductEdition":"service enterprise","CustomerId":"321","Version":{"Major":7,"Minor":13,"Build":4,"Revision":638,"MajorRevision":0,"MinorRevision":638}} CurrentDateTime: 2019-03-11T09:39:51.576Z Type: Terrasoft.SyncException Message: An error occurred while synchronizing Stack trace: @sencha-touch-all-debug.js:10397:31 failure@terrasoft-all-combined.js:25030:23 @sencha-touch-all-debug.js:10397:31 failure@terrasoft-all-combined.js:3739:21 @sencha-touch-all-debug.js:10397:31 requestItemFailure@terrasoft-all-combined.js:31616:25 Terrasoft.RequestManager#onRequestFailure@terrasoft-all-combined.js:31428:34 @sencha-touch-all-debug.js:10397:31 terrasoft-all-combined.js:31620:21 @sencha-touch-all-debug.js:10397:31 Terrasoft.core.CancellableOperationManager#finish@terrasoft-all-combined.js:32010:19 Terrasoft.core.mixins.Cancellable#finishCancellableOperation@terrasoft-all-combined.js:1419:49 terrasoft-all-combined.js:31606:38 [nativecode] @sencha-touch-all-debug.js:10397:31 Fn@terrasoft-all-combined.js:31660:27 failure@terrasoft-all-combined.js:31676:23 @sencha-touch-all-debug.js:10397:31 failure@terrasoft-all-combined.js:52784:27 @sencha-touch-all-debug.js:10397:31 terrasoft-all-combined.js:35722:19 FromNative@cordova.js:295:57 nc2@cordova.js:1022:39 Type: Terrasoft.ServerException Message: Server request returned error AdditionalInfo: { "responseText": "Access to non-SSP API is denied for portal users{\"responseStatus\":{\"ErrorCode\":\"SecurityException\",\"Message\":\"Current user does not have sufficient permissions to read values of system setting with code \\\"UseMobileUIV2\\\".\",\"Errors\":[]},\"rowsAffected\":-1,\"nextPrcElReady\":false,\"success\":false}", "statusCode": 403, "statusText": "Forbidden" } Stack trace: Terrasoft.util.Service#getExceptionFromResponse@terrasoft-all-combined.js:5726:45 Terrasoft.nativeApi.ExceptionParser.getException@terrasoft-all-combined…:52836:65 Terrasoft.util.DataServiceUtils#getExceptionFromError@terrasoft-all-combined.js:5771:63 terrasoft-all-combined.js:35711:71 FromNative@cordova.js:295:57 nc2@cordova.js:1022:39 Sent from my iPhone

sethuraghav,

The error says user doesn't have access rights to system settings with code 

UseMobileUIV2. Distribute the rights to the needed users for this setting and it should work. 

Best regards, 

Dennis

Dennis Hudson,

The same error comes after the access is given 

regards,

sethuraghav N

sethuraghav,

Please try to recompile and  resync your application and if it wouldn't work please write to support@bpmonline.com 

Best regards,

Dennis

Hi, I have the same problem, how to fixed it?

Nataliia,

 

Please check if the proper access is given to the portal user so that they're able to read the value of the system setting "UseMobileUIV2". 

Also, please make sure, that the user has the required license and re-sync your application. 

If the issue persists please send the mobile bug report to support@creatio.com



Best regards,

Yurii

Show all comments