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 Community!

 

I can't find documentation related to the creation of records via javascript. I know I can use ESQ to query records, but is there also an API for create, update and delete?

 

Many thanks,

Robert

Like 0

Like

4 comments
Best reply

Hello Robert,

For inserting data in Javascript (InsertQuery):

https://customerfx.com/article/inserting-a-record-from-client-side-code…

For updating data in Javascript (UpdateQuery):

https://customerfx.com/article/updating-a-record-from-client-side-code-…

For deleting data in Javascript (DeleteQuery):

https://customerfx.com/article/deleting-records-from-client-side-code-u…

Ryan

Hi Robert,

 

The second possible way, if ESQ for some reasons doesn't work in your case, is to send XHR requests from the client code. An example of such request send from the client side can be found here, in your case the endpoint URL should be OData endpoint and the method to add the record to some section is similar to standard OData call from Postman.

 

Best regards,

Oscar

Hello Robert,

For inserting data in Javascript (InsertQuery):

https://customerfx.com/article/inserting-a-record-from-client-side-code…

For updating data in Javascript (UpdateQuery):

https://customerfx.com/article/updating-a-record-from-client-side-code-…

For deleting data in Javascript (DeleteQuery):

https://customerfx.com/article/deleting-records-from-client-side-code-u…

Ryan

Ryan Farley,

thanks for the links, very helpful!

 

However, I wonder if I (mis)understood the base concept here.

Dylan pointed out, that ESQ could be used for this...so is your solution what Dylan was referring to? I ask, because I thought "ESQ", which stands for EntitySchemaQuery, was only used for reading data?

In your linked code, the class used is called "Terrasoft.InsertQuery". So is this whole part of the SDK called ESQ?

 

Another question is if the permissions will be respected or not. In c#, there is the possibility to use either the Insert-class or the InsertToDB() method of the entity. AFAIK, the Insert-class will not take permissions into account or start business processes and will be executed directly against the DB. Is this what the "Terrasoft.InsertQuery"-class will execute on the server, or is it the InsertToDB() method from the entity?

 

Many thanks,

Robert

Hello Robert,

EntitySchemaQuery is only for queries/reading (technically, ESQ server side does return entity objects which can be used for updating as well). 

InsertQuery/UpdateQuery/DeleteQuery isn't technically part of EntitySchemaQuery, but are similar in purpose as they wrap calls to DataService and provide a simpler objects to use from client-side code. 

Since all of these are basically wrapper objects for using DataService, it does respect permissions. In fact, if you look at the network traffic when using Creatio, you'll find that when adding, editing, or deleting records in the Creatio client (for example, when you add an activity, edit an account, or delete something) it is issuing these same InsertQuery/UpdateQuery/DeleteQuery requests. When a bound edit page is saved, an InsertQuery or UpdateQuery is issued for the bound data on that page.

Ryan

Show all comments

Hi Team,



I have been trying to add a record in one of the lookup. Upon saving I get a below error.

 

From UI, Debugged to find the below, i.e. an object is missing in the config.

But it is available in DB.



It is inferred that object is deleted in Configuration but available in DB.



Note: This error persists across the application, when I tried to save record in any section this error pop-up.

 

ViewModule.aspx

"SBLChequeBook":{

      "imageId":"026742d9-390c-4778-bc46-9fa85c42677a",

      "moduleId":"f07b0621-39c1-4269-a3e5-dd013dca1e82",

      "moduleCaption":"Cheque Book",

      "entitySchemaName":"SBLChequeBook",

      "entitySchemaUId":"f3edef5e-3b47-4fd7-89bd-34c3681a4e57",

      "sectionModule":"SectionModuleV2",

      "cardModule":"CardModuleV2",

      "hide":"true"

   },





kindly guide me to overcome this!







Best Regards,

BHoobalan P.

Like 0

Like

2 comments

Hi Bhoobalan,

 

Please delete mentioning of the deleted object from the SysModule table:

 

DELETE SysModule WHERE SysModuleEntityId = 'f07b0621-39c1-4269-a3e5-dd013dca1e82'

OR Id = 'f07b0621-39c1-4269-a3e5-dd013dca1e82'

 

and relogin to the application after that. This should completely remove all the mentions about the deleted object from the system.

 

Best regards,

Oscar

Oscar Dylan,



Thanks much!

Show all comments

Hello,

I want to add custom button to add new record of case. I added custom button to contact edit page, made onClick event handler and using this function to open add record page of case:

 

_contactObject.openCardInChain({
	"schemaName": "CasePage",
	"operation": "add",
	"defaultValues": [{
		"name": "Contact",
		"value": _contactObject.get("Id"),
		"displayValue": _contactObject.get("Name")
	}]});

It works only when I am on Contact edit page, reload page and clicked my button. or if I entered directly on Contact edit page using url.

 

But if I entered from Contact list page, this function is not working. It shows infinite loader and never stops. If I reload page while loader, it loads add record page of case, exactly what I want.

 

Unfortunately, it doesn't shows any error in console. I tried to debug this function and trace how it works, but at the and, it fires event and I can't understand why its handler not handling it.

 

We are using Bpm Online 7.14.1.935

Like 0

Like

3 comments

Dear Luka,

 

Looks like the issue is related to combined mode Please, try this approach of adding logic to the section and to the page - https://academy.creatio.com/documents/technic-sdk/7-16/how-add-button-edit-page-combined-mode.

 

Best regards,

Angela

Angela Reyes,

we had that problem, but now we added button on ContactPage, so its button and onClick handler works fine. also that function openCardInChain is executed, but there is no result. 

Resolved:

I added property in config param which is passing to openCardInChain function. param is moduleId.

Show all comments