Triggering a Client-Side Event When a Field is Changed on a Page in Creatio in Freedom UI

CAN ANY HELP ME ON Triggering a Client-Side Event When a Field is Changed on a Page in Creatio in Freedom UI?

Like 0

Like

4 comments

I have an article showing how to do this here: 

https://customerfx.com/article/responding-to-an-event-when-a-field-is-c…

Ryan

@Ryan I have to call a method inside field is changed .I have  used this approach but I am getting issue in this. Can you please help how we can call a function inside field value

 handler: async (request, next) => {
        if (request.attributeName === "BooleanAttribute_ddmdb1n") {
              await cfx.fieldChecked(); // 
        }
        return next?.handle(request);
    }
},
            {
                request: "cfx.fieldChecked",               
                handler: async (request, next) => {
                    const okBtn = {
                        key: "OK",
                        config: {
                            color: "primary",
                            caption: "YES"
                        }
                    };
                    const cancelBtn = {
                        key: "CANCEL",
                        config: {
                            color: "default",
                            caption: "Cancel"
                        }
                    };
                    const result = await request.$context.executeRequest({
                        type: "crt.ShowDialogRequest",
                        $context: request.$context,
                        dialogConfig: {
                            data: {
                                message: "Are you sure you would like to proceed? It will wipe out all the information!!!!",
                                actions: [cancelBtn, okBtn]
                            }
                        }
                    });
                    if (result === "OK") {
          request.$context.StringAttribute_uo3a61k = "";
                    }

You cannot put methods inside a Freedom UI page. Either move the code from cfx.fieldChecked into the change request handler, or you can move it to a module

Ryan

okay got it .Thank you for help

Show all comments