Hi Community,

 

We are have given read only option to all the fields in a detail and on certain status change, have written a business rule to edit few fields and the rest of the fields remaining locked. Post another status change, previously editable field is locked and the other fields are editable. 

 

Question : During a creation of the detail in the first status, certain fields are locked and the fields which can be editable are editable but when the status is changed based on the rule it has to lock the fields which was edited previously and remaining fields to be editable but all the fields are locked. until in the new status we try to add a new detail then the business rule works and the field which needs to be edited is editable but not to the already created detail.

Like 0

Like

3 comments

Dear Amritha,

 

For such a task, you may create a business rule for each field and each stage - then when the stage is changed new set of rules will start working. Otherwise, you can add business rules to the source code for each field: https://academy.creatio.com/docs/developer/front-end_development/creati…

 

Best regards,

Angela

Dear Angela,

 

While creating the fields have given only read access to all the fields. Later in the business rule for a stage, where the fields needs to be edited have given editable option via business rule. But there is no option that for other fields to give  uneditable option in business rule, we havent given that instead provided read only option.

 

But still, in the initial stage based on the rule few fields are editable and when the stage changes. When we create a new detail then that stage business rules gets applied but to already created detail the business rule for that stage is not getting applied, that is our concern

 

Amritha Mayan Gorky,

So you mean when detail is moved to another stage old records are still read-only and new records are edible while in fact, all records should be editable? 

Show all comments

Hello Colleagues,

 

I need to add a different "filter Business rule" for the same field regarding the value of another field, this is not possible using the Filter Business rule wizard, how can I did it?

 

In my case, regarding the contact Account Type I want to filter the possible Contact Types we want to enable, for example

  • if the account type is Our Company, contacts type just can be Employee,
  • if account type is Customer, contact type just could be "Customer" or "Contact Person"

 

Thanks in advance

Like 0

Like

2 comments

 Dear Julio,



Unfortunately, it is not possible to implement this logic through Business rules as we cannot create business rule for contacts in accounts.



The solution here will be to build the described filter using EntitySchemaQuery.

Here is the article - https://academy.creatio.com/docs/developer/back-end_development/working…



Best Regards,

Ivanna

Thanks Ivanna

Show all comments

Hi- 

How would I go about creating a business rule that does not allow users to save a certain email domain as an email address for a contact? 

For example- I don't want any emails that are for domain "ABC.com" 

Can I make a business rule that will not let them save that?

Like 0

Like

1 comments

Dear Heather,

 

To set up validation for email you can use Email address mask system setting - feel free to adjust the RegExp upon your needs.

 

Best regards,

Angela

Show all comments

Is it possible to combine "and" and "or" operators in a single rule condition when using the business rules design wizard ?

Like 2

Like

2 comments

Hello Ricardo, 



As for now there is no possibility to apply multiple operators for the one filter condition when editing the business rule. 



We have this idea registered for our R&D team and I will notify them about this question so to increase the importance of implementing this functionality.



Kind regards,

Roman 

Roman Brown,

Dear Roman, this feature was posted in R&D several years ago, there no new regarding when will be considered?

Show all comments

Hi Community,

I have this scenario below, I want to create a business rule that will hide/unhide field if record is in add mode or edit mode. How can I possibly do this?

Like 0

Like

2 comments

Hi Community, Any idea on this?



Thank you so much

Dear Fulgen,

It is possible to check a mode of a page using the “phantom” property of the “record” object https://prnt.sc/qkxh4q

If the value of the property is equal to “true” it is mean that the page is in the add mode and vice versa. Please see an example of the code below:

Terrasoft.sdk.Model.addBusinessRule("Case", {

            ruleType: Terrasoft.RuleTypes.Custom,

            position : 2,

            triggeredByColumns: ["UsrIncidentType"],

            events: [Terrasoft.BusinessRuleEvents.ValueChanged],

            executeFn : function(record, rule, column, customData, callbackConfig){

                        if(record.phantom)

                        {

                                    // true, when adding a new record (add mode)

                                    alert("New record");

                        }

                        else

                        {

                                    // edit mode   

                                    alert("Old record");

                        }

                        Ext.callback(callbackConfig.success, callbackConfig.scope, [true]);

            }

});

Please find more information about a custom business rules in the article by the link below:

https://academy.creatio.com/documents/technic-sdkmob/7-15/custom-business-rules-mobile-application

Best regards,

Norton

Show all comments

Hi Community,

In mobile application Conditional columns is not working in rule type requirement. Below is my code.

Terrasoft.sdk.Model.addBusinessRule("Case", {

    ruleType: Terrasoft.RuleTypes.Requirement,

    requireType : Terrasoft.RequirementTypes.Simple,

    events: [Terrasoft.BusinessRuleEvents.Save],

    triggeredByColumns: ["UsrIsClosed"],

    conditionalColumns: [

        {name: "UsrIsClosed", value: true}

    ],

    dependentColumnNames: ["UsrComments"]

});

I want column UsrComments to be required if column UsrIsClosed is true. The code above is not working, please suggest

 

Like 0

Like

7 comments

Eugene Podkovka,

Hi Eugene, Thanks for your reply

Module appears on the client end, manifest is also correct.

Using below code without conditionalColumns rule is working fine:

Terrasoft.sdk.Model.addBusinessRule("Case", {

    ruleType: Terrasoft.RuleTypes.Requirement,

    requireType : Terrasoft.RequirementTypes.Simple,

    events: [Terrasoft.BusinessRuleEvents.Save],

    triggeredByColumns: ["UsrComments"],

    columnNames: ["UsrComments"]

});

But the above code will not serve our purpose, we only require "UsrComments" to be mandatory if "UsrIsClosed" field is true.

That's why I created below code:

Terrasoft.sdk.Model.addBusinessRule("Case", {

    ruleType: Terrasoft.RuleTypes.Requirement,

    requireType : Terrasoft.RequirementTypes.Simple,

    events: [Terrasoft.BusinessRuleEvents.Save],

    triggeredByColumns: ["UsrIsClosed"],

    conditionalColumns: [

        {name: "UsrIsClosed", value: true}

    ],

    dependentColumnNames: ["UsrComments"]

});

Please suggest, how I can use "conditionalColumns" attribute for rule type requirement.

Fulgen Ninofranco,

The code seems like correct. Try to restart the application pool and synchronize the mobile application again. 

http://prntscr.com/oyo0vz

Eugene Podkovka,

Thanks Eugene.

We already did the restart and synchronize but still not working. I also noticed one thing in the documentation. "conditionalColumns" is not discussed here as part of the attributes of rule type requirements but from other rule type it is included. Please suggest how we can achieve our condition if "conditionalColumns" will not work.  

https://academy.bpmonline.com/documents/technic-sdkmob/7-12/business-rules-mobile-application

Eugene Podkovka,

Hi Eugene, any update on this. Thank you

Fulgen Ninofranco,

Try to debug the mobile application, find how business rules work and find how to adjust them according to your needs.

https://academy.bpmonline.com/documents/technic-sdkmob/7-12/mobile-application-debugging

Start from the executeApplicableRules method in the BusinessRulesManager module.

Hi, did you find a resolution to your issue? I am facing the same thing.

Show all comments

Hi Community,

Any idea how we can disable the existing mobile business rule. Lets say for example below rule.

Terrasoft.sdk.Model.addBusinessRule("Case", {

    name: "CaseContactAccountRequirementRule",

    ruleType: Terrasoft.RuleTypes.Requirement,

    requireType: Terrasoft.RequirementTypes.OneOf,

    triggeredByColumns: ["Contact", "Account"]

});

 

I tried to create my custom model config and set this existing rule to "enabled:false", compile the changes and re-synchronize the mobile but still this rule is active in mobile.

 

Like 0

Like

1 comments

If you want to disable the existing mobile business rule, you can do it by calling the removeBusinessRule function. The function accepts two parameters - the name of the model and the name of the rule. For example:

 Terrasoft.sdk.Model.removeBusinessRule("Case", "CaseContactAccountRequirementRule");

Show all comments