We use Creatio 7.18.

I am trying to setup a FastReport as part of which I am trying to populate a table with Reportees of the current user.

I used below to get current user id, but it returns “Supervisor” user (reference - https://community.creatio.com/questions/terrasoftsysvaluecurrentuservalue-equivalent-c).

Can anyone help with the correct way to get Current user Id in Source Code for Data Provider class to setup FastReport?

 

var appConnection = HttpContext.Current.Application["AppConnection"] as AppConnection;

var currentUser = appConnection.SystemUserConnection.CurrentUser;

var userId = currentUser.Id;

Like 0

Like

2 comments

App connection always returns "Supervisor" since this user is a system operations user. If you need to get the current user who manually triggered report generation and the custom code you need to use the same approach but with using UserConnection instead of appConnection (as Ryan described in his first example):

var currentUser = UserConnection.CurrentUser;
var userId = currentUser.Id;
var userName = currentUser.Name;

Or maybe I didn't understand the required result:)

Oleg Drobina,

My bad! I misunderstood his statement. Since I was trying it out in a source code schema and not a script task, I only tried using the 2nd method. The 1st method correctly returns the required information. Thanks for pointing that out, Oleg!

Show all comments

Hi all,



I've added a button to the left container of the orders page labelled 'Update quote costs'. The button is visible on the condition that the boolean 'Recalculation required' (a field on the order) is true. I've added the diff and the method to the section schema and the section page.

(edit - added gif of button)

 

When I open the page from the section for a record where 'Recalculation required' is true, the button does not appear. If I refresh the page, the button then does.

 

I believe this is because the header loads before the data so when it first loads, it can't read the 'Recalculation required' field.



Is there a solution to this? If not, I can move the button to the header container as the conditions do work this way. It just doesn't look as good.



Nb. using Freedom shell on classic pages

Like 0

Like

1 comments

Hello,

The problem is not in the container, when you open a page from a section, the system still thinks that you see a section page. Therefore, the condition for your button isn't applied.

In order to fix it, you need to create your button in a combined mode, for example.

Take a look at the button and its condition is defined in a SectionV2 page as well as PageV2.

Show all comments

 

Hi all, 



Just wondering whether is there any way that we can run some javascript code / callback function upon completion of business process execution in client module?

 

If so, could you provide the sample code for reference?

 

Thank you very much.

Like 0

Like

2 comments

Hello,

 

If this is needed for versions lower than 8.0.6 (version when the LiveEditing feature was added out-of-the-box that will reload entity automatically in case changes to it were applied by a process) - you can always send a socket message to the client-side logic (like in the example but the message sending mechanism should be in the last script-task of the business process, on the client-side create a method that is triggered upon receiving the message)  or use an already-developed marketplace addon for it.

To elaborate more on what Oleg mentioned. There's no way to have a callback for when the process completes (the callback commented in your code is a callback for the completion of *starting* the process). A process can have things that wait for a period of time, so not really possible to wait for completion.

The approach to take is for the process to notify the client-code that it has completed by sending it a message. This article shows how to send the message: 

https://customerfx.com/article/how-to-refresh-a-page-from-a-process-in-…

If needed, this article shows how to receive the message in a Freedom UI page: 

https://customerfx.com/article/receiving-server-side-messages-in-a-crea…

However, if the page is Freedom UI, a better approach is to enable live data updates for the object so the refresh happens automatically when the data changes in the process. More about that here: 

https://customerfx.com/article/automatically-refreshing-a-creatio-freed…

From the code you posted, it looks like this is a classic page, so you'd have to go the first route for sending a message from the process to the client page.

Ryan

Show all comments

Hello,

 

I have read through on locking fields using client module in Creatio. I have found that we can simply setting the "isModelItemEnabled" to true/false. And for more complex situation, we can create a function named "isModelItemEnabled" and write our code logic and return boolean value conditionally.

 

At the same time, I noticed that "isModelItemEnabled" is triggered before "onEntityInitialized" is triggered. This results to some of the values required to be used in "isModelItemEnabled" undefined.

 

Is there anyway to workaround this?

Like 0

Like

2 comments
Best reply

Rather than create a function, use an attribute. Then in the onEntityInitialized you can read any values and then set the attribute to true/false. See an example here: https://customerfx.com/article/completely-locking-a-page-via-code-inclu…

Also, just to point out, you mention locking a single field. If all you need is to lock a single field, there's no need to use IsModelItemsEnabled. Instead you can bind the visible for the field to an attribute and set as true/false as needed. See https://customerfx.com/article/how-to-enable-or-disable-a-field-on-a-pa…

Ryan

Rather than create a function, use an attribute. Then in the onEntityInitialized you can read any values and then set the attribute to true/false. See an example here: https://customerfx.com/article/completely-locking-a-page-via-code-inclu…

Also, just to point out, you mention locking a single field. If all you need is to lock a single field, there's no need to use IsModelItemsEnabled. Instead you can bind the visible for the field to an attribute and set as true/false as needed. See https://customerfx.com/article/how-to-enable-or-disable-a-field-on-a-pa…

Ryan

Okay, I will try it out. Thank you very much Ryan, best as always😄

Show all comments

I have added a button on every record in detail for a particular column. I am trying to have one more button on the same detail, But the button is not visible on the UI.

The code that i used for this is:

{

"operation": "merge",

"name": "DataGrid",

"parentName": "DataGridContainer",

"propertyName": "items",

"values": {

"className": "Terrasoft.ControlGrid",

"controlColumnName": "UsrPlanningManagerRelevance",

"applyControlConfig": {"bindTo": "applyControlConfig"}

}

},

METHOD

applyControlConfig: function(control, activeRow) {

control.config = {

"className": "Terrasoft.Button",

"style": Terrasoft.controls.ButtonEnums.style.BLUE,

"caption": "מסמכי רקע",//this.get("Resources.Strings.FileButtonCaption"),

"imageConfig": {"bindTo": "Resources.Images.ExportToExcelBtnImage"},

"handler": this.BackgroundDocumentsClick.bind(this, activeRow.id)

};

Can anyone help me on this?

Like 0

Like

1 comments

Hi,



I think, you can do this by appending buttons in the targeted column.

 

var baseEle = "#Identifier div[id*=\"item-" + rowId + "\"]  div:nth-last-child(2)";
$(baseEle).append(Ext.String.format("<span></span>"));
 
var ele = baseSelector + ">span";
$(ele).click(function() {});

 

Loop collection in prepareResponseCollection method or onGridDataLoaded

Show all comments

Hi 

I want to add SelectPdf library to Creatio and use it in BP 

however when  I upload using the import in the Configuration section into package

it ask for the Select.Html.dep in the dotnet shared folder 

I added manually but I get error that kernel32.dll is missing, as I know this kernal is window specific dll and not for linux

Is am doing this right or something missing?

Like 0

Like

2 comments

Hello,

 

Can you please point me on where to download the exact dll from here https://selectpdf.com/pdf-library-for-net/ to test its upload to the app?

 

Thank you!

SelectPdf requires a Windows server, it does not work on Linux according to it's docs. From here: https://selectpdf.com/docs/Installation.htm

Currently it requires a Windows system to run. It does not work on Linux or Mac or Xamarin.

Ryan

Show all comments

Hello,

 

Can I get Marketing Creatio training videos in Russian? 

 

Thanks in advance. 

Like 0

Like

1 comments

Hi!

 

We currently do not have Russian video materials ready. Thank you for bringing up the idea!

 

We will take it into consideration.

Show all comments

Hi all,

 

I'm trying to migrate a package from our dev site to production.



We have multiple metric widgets on one of the pages and these are not migrating with the package (only their placeholders in the diff).



Can anybody advise what needs to be bound to the package to ensure these elements migrate across?



Nb. Version is up-to-date but we are not using the Freedom UI.

Like 0

Like

1 comments
Best reply

The metric definition is stored in SysWidgetDashboard. 

 

You’ll need to locate the row and bind the data to your package. The page code will contain the Id for  the record. 

The metric definition is stored in SysWidgetDashboard. 

 

You’ll need to locate the row and bind the data to your package. The page code will contain the Id for  the record. 

Show all comments

after adding ssl the websocket in pending status

 

Like 0

Like

1 comments

Greetings,



We kindly ask you to contact us via email at support@creatio.com for an in-depth analysis of your error.

Show all comments

I am trying to create a new section in a different workplace with an existing object. The Package is from my "Invoices" object, which has all the material I need; however, anytime I try to access this via the New: Section wizard, "SELECT EXISTING OBJECT", I get the error, "Section for this object already exists."



I am having an increasingly hard time maneuvering through the customization of Creatio no-code, without being directed to use schemas, SQL, or outdated object-relational mapping.

Like 1

Like

1 comments

Hello,

 

Indeed, in Creatio, creating multiple sections for one object is impossible. You either need to remove existing sections or create a new object for the new section.

Show all comments