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
SMS
Mobile app
7.15
Studio_Creatio_enterprise_edition

Hi Creatio Community!

We are looking for an add on for capturing MSM texts with our customers. We don't need to send out Mass Text messages. We would just like to be able to easily log the text messages as an activity in Creatio. I have looked through some add ons already and you have to pay per message. Is there an easier way to do this? Or what add ons have you used?

Like 0

Like

1 comments

Hello,

Here is the SMS extension that usually used for sending single SMS messages:

https://marketplace.creatio.com/app/infobip-connector

It also has the option to record the sending instances on the activity detail.

 

Regards,

Dean

Show all comments
Mobile app
custom-css
CSS

Hi Community,

 

By default the search field showing like below, I need to hide it on first load and once I click on icon the search field should appear

 

 

Any help will be highly appreciable.

 

Regards

Like 0

Like

1 comments

Hi Muhammad,



You would need to create a custom Grid controller for your section. First up, you can generate controller code just like it is described here, specifying pageType: Terrasoft.PageTypes.Grid and selecting your section name. Then you should add a dependency to your grid in the manifest. You can use InvoiceMobile package as an example: https://prnt.sc/rpypgw - grid, and manifest - https://prnt.sc/rpyq0a.



Then, in the Terrasoft.view.BaseGridPage.View there is an object that is responsible for filter panel. This object has a function to show and hide: https://prnt.sc/rpyqsr. So in your grid view you would be able to get the filterpanel and then use function to hide it:



let filterPanel = this.getFilterPanel();

filterPanel.hide();



Regards,

Dmytro

Show all comments
mobile application
Mobile app
7.15_()
Sales_Creatio_()

Toggle operation mode for Mobile Creatio is not working now, when I click the button toggle for offline mode there are some process running on it,

and stack as long as the application is open. Anyone idea to solve this problem?

Like 0

Like

1 comments

Hi! In OOB creatio mobile app offline mode can be enabled only via PC version. If this button is custom try to debug it using mobile emulator that can be requested from support team. 

Best regards,

Angela

Show all comments

I want to disable this feature, so when i'm come back open the section it's directly showing the data not the history.

any solution for this?

Like 0

Like

1 comments

Dear Ahmad,

You need to replace the schema MobileApplicationManifestDefaultWorkplace and add this part of the code.

 

"Models": {

      "Case": {

          "CacheConfig":

              { "Disable": true

         }

Here is the example how it would look like for the Cases section. You need to do the same for your custom section. 

http://prntscr.com/pdpvpz



Also, make sure the section is not listed in the system setting  'Mobile application section list whose data is displayed through search results only'. You can set the value 0, save it and re-login. 

After that, clear the mobile application cache and re-synchronize. 

Best regards,

Dean

 

 

Show all comments
Mobile app
7.14_()
sales_team

How to display data on the BPM Mobile without filter in early?

So, when i opening the app it's directly showing data.

 

 

Like 0

Like

5 comments

Dear Ahmad,

Starting from the version 7.14.0 you can see only recently opened records in the sections. That is why you cannot see them at once when opening the section for the first time. After surfing through the section and opening the records, they will start populating the section once you enter it later. If you want to disable this functionality, you need to add this part of the code to the MobileApplicationManifestDefaultWorkplace schema

"Models": {

      "Case": {

          "CacheConfig":

              { "Disable": true

         }

http://prntscr.com/pcswp0

Best regards,

Dean

 

Dean Parrett,

I'm already add this code on the schema, but nothing different and still not showing data.

Dear Ahamd,

I'm so sorry I did not clarify

In this part of the code http://prntscr.com/pctsw6 I've disabled the caching functionality for Cases section. Please make sure to do it for your Passenger section. Also, make sure the system setting 'Mobile application section list whose data is displayed through search results only' does not include the section as well. To make sure it works properly you can set the default value for it as '0' https://prnt.sc/oao1tn

Best regards,

Dean

Dean Parrett

Thank you dean!! work like a charm!

Dear Dean,

It is possible to disable feature "Recently Viewed" on BPM Mobile ? 

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
CSS
mobile
mobile application
Mobile app

Hi,

 

I need to change background image of mobile home page.

Currently I able to show background image under sections (modified the object "UsrMobileCaseGridPageView") but its not reflected on home page.

 

Image is copied to this loaction (file:///C:/BPM/BPM_Mobile_simulator/7.14.6/appV2/Common/lib/SenchaTouch/resources/css/bg.png)

Please suggest the way it can be achieved. For testing I using mobile simulator.

 

Regards

Like 0

Like

3 comments

The question was discussed in the article by the link below.

https://community.bpmonline.com/articles/adding-custom-css-mobile-application

Hi Eugene,

Thank you, I tried Global CSS and its reflected except home screen which appearing just after successful login. Is it possible to apply custom css on home screen?

Muhammad Shajiuddin,

Unfortunately, it's not possible.

Show all comments