Regarding Auto triggering Business Processes

Hi,

 

I have implemented the features like Auto Filling and Auto Clearing fields through business processes. But, this happened after saving the record and running the business process. But, we want to implement the above features without saving the record and running the business processes. Can anyone please provide your valuable assistance?

Like 0

Like

4 comments

It's possible to implement Auto Filling and Auto Clearing fields functionality using "dependencies" property of the field attribute. There is an example below. In the example when the "Type" field value is changed, the "Owner" field is cleared. When the "Salutation" field value is changed, the "Gender" field is auto-filled (https://i.imgur.com/KwtOWH1.png).

 

define("ContactPageV2", [], function() {
    return {
        entitySchemaName: "Contact",
        attributes: {
            SalutationType: {
                dataValueType: this.Terrasoft.DataValueType.LOOKUP,
                dependencies: [{
                    columns: ["SalutationType"],
                    methodName: "onSalutationTypeChange"
                }
               ]
            },
            
            Type: {
                dataValueType: this.Terrasoft.DataValueType.LOOKUP,
                dependencies: [{
                    columns: ["Type"],
                    methodName: "onTypeChange"
                }
               ]
            },
        },
        modules: /**SCHEMA_MODULES*/{}/**SCHEMA_MODULES*/,
        details: /**SCHEMA_DETAILS*/{}/**SCHEMA_DETAILS*/,
        businessRules: /**SCHEMA_BUSINESS_RULES*/{}/**SCHEMA_BUSINESS_RULES*/,
        methods: {
            onSalutationTypeChange: function(){
                const salutation = this.get("SalutationType").displayValue;
                if( salutation === "Mr." ){
                    this.set("Gender", {value: "EEAC42EE-65B6-DF11-831A-001D60E938C6", displayValue: "Male"});
                }
                if( salutation === "Mrs." ){
                    this.set("Gender", {value: "FC2483F8-65B6-DF11-831A-001D60E938C6", displayValue: "Female"});
                }
            },
            
            onTypeChange: function(){
                this.set("Owner", null);
            }
        },
        dataModels: /**SCHEMA_DATA_MODELS*/{}/**SCHEMA_DATA_MODELS*/,
        diff: /**SCHEMA_DIFF*/[
            
        ]/**SCHEMA_DIFF*/
    };
});
 

 

 

Alina Kazmirchuk,

Thank you for your response. But, I want it to happen in many fields. Here, below I am attaching the screenshot of desired results.

1. Auto Clearing - Whenever we check the boolean field of New Contact, the below fields will be automatically cleared. 

2. Auto Filling - Whenever we select the existing contact in Applicant Name then the below fields will be automatically filled with related information.

Is it possible to do using business processes?

Alina Kazmirchuk,

Thank you so much. 
I have done auto clearing by following your provided assistance. But, I was unable to do the Auto filling. Can you please provide more guidance on Auto Filling?

Alina Kazmirchuk,

In the above screenshot, the Applicant name is a lookup field that is referencing the Existing contact section. If we choose an existing contact, then some of the fields will be auto-filled with the corresponding values. The solution which was provided to me for auto-filling is not suitable for my problem. In your case, the salutation field is having a few values. So we can easily write if conditions. But in my case Applicant name is having so many values i.e., contacts. So, it is very difficult to write that many number of conditions. Can you please any other alternative for Auto filling the field when we select any value in the Applicant name field?

Show all comments