Hi community,

Calling a Business process is quite easy in FreedomUI, by adding a button and choosing

Action: Run process.

The problem with this approach is that once the button is clicked, there is no validation happening in the page.

Is there any code snippet or workaround that when clicking a button that runs a business process, prior to the calling of the process a validation(practically a Save) happens?

Sasori

Like 1

Like

6 comments

The only option currently is to wire up code for the button. It would first save the page, then if the save was successful you would execute the process. 

See how to save the page and detect if it was successful here: https://customerfx.com/article/saving-a-page-before-some-action-on-a-creatio-freedom-ui-page/

See how to start the process via code here: https://customerfx.com/article/starting-a-process-from-client-side-code-on-a-creatio-freedom-ui-page/

Ryan

Ryan Farley,

Thanks for the response Ryan. Do you actually have an example on how to integrate within the 'CustomMethod' both crt.SaveRecordRequest and crt.RunBusinessProcessRequest ?

Ryan Farley,

Ryan if im not mistaken, with the suggested approach , every time the user will click the SAVE button, the overriden crt.SaveRecordRequest will be called?

In the first linked example, you would only be running that `usr.CustomCodeRequest` handler when you click your custom button. If you put the code inside the crt.SaveRecordRequest handler, then it would be run every time the user saved the page in some way.

Sasori Oshigaki,

As Harvey mentioned, the code for your button will only execute when the button is clicked, not when the Save is clicked. Your button will also initiate a save and then, if successful and validated (and the save occurred) it will then execute the process. The code from the first article triggers the save to happen and then provides the result. In the article (the first one) the save returns a result, where the code has // save was successful, continue with something else here you'd replace that with the code to start the process (the second article). If needed, you can see how to wire up custom code to your button in this article: https://customerfx.com/article/adding-a-button-to-execute-custom-code-on-a-creatio-freedom-ui-page/

Ryan

Thank you  both Ryan and Harvey! Was able to achieve what i intended!

     {
    request: "so.SaveAndRunBP",
    handler: async (request, next) => {
            const saveRecordRequest = {
            type: "crt.SaveRecordRequest",
            preventCardClose: true,
            $context: request.$context
        };
        if ((await request.$context.executeRequest(saveRecordRequest)))
        {
          const handlerChain = sdk.HandlerChainService.instance;
          const result = await handlerChain.process({
              type: "crt.RunBusinessProcessRequest",
              processName: "SoGenerateContact",
              processParameters: {
                  ContactId: await request.$context.Id,
              },
              $context: request.$context
          });
        }
        return next?.handle(request);
    }
}
Show all comments

I have a detail "OrderProductDetailV2" (editable registry), in which I added my totals to "summaryItemsContainer". When changing a record in the detail, quantity, price, etc., I need to update my signatures, since the standard ones are updated (number of records, total amount). I've read many articles. I've figured out how the standard modules work. Everything is clear. I've tried different options through messages, with "onDataChanged" I get a cycle, in another option my signatures are updated, but the standard ones stop updating. Can anyone help?

Like 0

Like

0 comments
Show all comments

I want to add contact object and the dropdown values should be the contact object column value. suppose I have a column name full name. its value i don't want as my lookup value. i want the full name column as my lookup value. is it possbile automatically?

Like 1

Like

1 comments

Hello,

 

The search field in the lookup column displays the object parameter — displayedColumnValue, which is usually the name column.
You can change this column to any other object field, but it will apply to the entire system — meaning this column will act as a link to the record. It will be used in filters and during selection. I suggest setting up quick filters and adding the contact value link there.

Show all comments

Hi, 

I have some hard times trying to iterate an array of object and insert/display the values one by one on this object detail named Product in Receive

 

and here is a chunk of the code:

var splitResult = decodedText
          .split("*")
          .filter((item) => item.trim() !== "");
        var doNumber = splitResult[0];
        var prodDataObj = [];
        var slocCode = doNumber.split("/")[1];
 
        for (let i = 1; i < splitResult.length; i++) {
          var prodDataSplit = splitResult[i].split("/");
          var productName = "";
          var materialcode = prodDataSplit[1] || "";
 
          if (materialcode) {
            productName = await new Promise((resolve) => {
              Terrasoft.productByMaterialCode(materialcode, (productData) => {
                if (productData && productData.Name) {
                  resolve(productData?.Name || "");
                }
              });
            });
          }
          prodDataObj.push({
            Line: prodDataSplit[0] || 0, //line number
            MaterialCode: prodDataSplit[1] || "", //mat code
            ProductName: productName,
            Quantity: prodDataSplit[2] || 0, //quantity
            UoM: prodDataSplit[3] || "", //uom
          });
        }
prodDataObj.forEach((data) => {
          const newRecord = Ext.create("Terrasoft.BaseModel", {
            modelName: "UsrEntity_93626c0",
          });
 
          newRecord.set("UsrSKUName", data.ProductName, true);
          newRecord.set("UsrQty", data.Quantity, true);
 
          Terrasoft.getUom(data.UoM, (record) => {
            newRecord.set("UsrUoM", record, true);
          });
 
          newRecord.save({
            isCancelable: false, 
            success: function (savedRecord) {
 
              const pageController = Terrasoft.PageNavigator.getLastPageController();
              pageController.refreshDirtyData();
            },
            failure: function (error) {
              console.error("Failed to create record:", error);
            },
          });
        });

i tried to iterate using forEach but when i use newRecord.save, some weird error appears, this is one of them: 

Error in Success callbackId: TSQueryExecutorPlugin1965367711 : TypeError: Cannot read properties of undefined (reading 'rule')

 

I would greatly appreciate any assistance or guidance in resolving this issue.
Thank you.

 

Like 0

Like

0 comments
Show all comments

I'm trying to set a text field (to use as a title of sorts) that includes a Date type field.

 

When setting this field, the Date comes through with both the Date and Time.

Is there a no-code way to prevent the Time from also coming through in the text field when it is being set?

 

Thanks!

Like 0

Like

2 comments
Best reply

Are you setting this in a process? If so, you can set it using .ToShortDateString() as follows: 

[#The date col or value here #].ToShortDateString()

Ryan

Are you setting this in a process? If so, you can set it using .ToShortDateString() as follows: 

[#The date col or value here #].ToShortDateString()

Ryan

Hi Ryan

 

This is exactly what I was hoping for.

 

Thanks for the help!

 

Raymond

Show all comments

Hello,

 

how is it possible to get Columns selection page for the object in Freedom UI? We need to get list of selected columns and save it for further usage



 

Kind regards,

Vladimir

Like 2

Like

2 comments

Hello,

 

Could you please describe your request in more detail so we could better understand your business need?

Mira Dmitruk,

We want to make configurable export tool. That's why we want to select columns for export

 

Kind regards,

Vladimir

Show all comments

Hello support,

 

The dashboard on my mobile is showed with classic UI on some 8.2 creatio instance and in other instance is showed with freedom UI

 

Could you help me to understand what is the problem?

 

Freedom mobile UI

Classic mobile UI

Like 2

Like

0 comments
Show all comments

Hello Everyone, 

Is there Steps how to Configure emails like xyz@outlook.com. This email is personal email and does not belong to any organization but want to connect it in Creatio. I did revied the guides but there is nothing related this "@outlook.com". 
i have already Create the app pasword but still not Configuring. Please find attach some of the Screenshots.

Like 0

Like

1 comments

Hi,
 

The issue is that Outlook no longer supports Basic authorization.
 

For more details, please refer to:
Deprecation of Basic Authentication in Exchange Online.
 

Therefore, without using the Azure portal, it is not possible to add an Outlook mailbox using a password or app password.
 

It is necessary to register an OAuth 2.0 application as outlined in this article:
Set Up OAuth Authentication for MS Office 365.
 

Thank you for reaching out!
 

Best regards,
Pavlo

Show all comments

Like 0

Like

0 comments
Show all comments

Hi Community,
I can't log in through Supervisor after deploying the stand.What to do in this case

Like 0

Like

4 comments
Best reply

First, you're sure you're using the correct password for Supervisor? If you need to reset the password for Supervisor, you can use the following SQL which will reset it back to "Supervisor" (upper case S)

update "SysAdminUnit" set "UserPassword" = 'JSDCg18tavKu1PPRqdP6t.AgqDORMm2cT7oDjw66hML64avIF/Qa2'
where "Name" = 'Supervisor'

Second, it could be that it is failing due to other reasons, for example, using HTTPS but the local Creatio is only configured for HTTP. If that is the case, see the Academy docs here: https://academy.creatio.com/docs/8.x/setup-and-administration/on-site-deployment/application-server-on-windows/switch-creatio-website-from-http-to-https

Lastly, if neither of those are the issue, also look in dev tools console and network tabs to see if it gives any clues about the issue.

Ryan

First, you're sure you're using the correct password for Supervisor? If you need to reset the password for Supervisor, you can use the following SQL which will reset it back to "Supervisor" (upper case S)

update "SysAdminUnit" set "UserPassword" = 'JSDCg18tavKu1PPRqdP6t.AgqDORMm2cT7oDjw66hML64avIF/Qa2'
where "Name" = 'Supervisor'

Second, it could be that it is failing due to other reasons, for example, using HTTPS but the local Creatio is only configured for HTTP. If that is the case, see the Academy docs here: https://academy.creatio.com/docs/8.x/setup-and-administration/on-site-deployment/application-server-on-windows/switch-creatio-website-from-http-to-https

Lastly, if neither of those are the issue, also look in dev tools console and network tabs to see if it gives any clues about the issue.

Ryan

Also, if your instance is Cloud, you must ask to support to reset it

 

Regards

Julio

Ryan Farley, Thank you

 

Show all comments