How to trigger event on field change?

I have an requirement to change city lookup whenever zip code is changed so is there any event that will do my work?

Thanks

Like 0

Like

2 comments

If you have a ZIP code field or similar in City to filter it by, you can set up a business rule similar to this, with your field in place of Description:

If you require more complex logic, go to the edit page in the backend and add a dependency to the attributes section:

attributes: {
    "City": {
	dependencies: [
	    {
		columns: ["Zip"],
		methodName: "doSomething"
	    }
	]
    }
}

And include your logic in the doSomething method, which will be called every time Zip is changed.

Dear Agha,

Please check the example provided by Darian. For the simple business task it is recommended to use business rules. 

In case you need more complex logic, including if clause, or evaluation on Id, or any other logic, which cannot be implemented by business rules, please use attributes.

In order to add an attribute you need to go to Advanced settings --> create a new replacing module for your page --> add an attribute and save the schema --> clear browser cache. 

Please see articles on schema attributes:

https://academy.bpmonline.com/documents/technic-sdk/7-13/attributes-attributes-property

Regards,

Anastasia

Show all comments