Question

Get Changed Fields in SaveRecordRequest Handler

Hi

I am in SaveRecordRequest handler and I need to  get the changed field in page before saving the record, How can I know this?

 

Regards

Rakshith Dheer

Like 0

Like

2 comments

Hello!

As I get from your request - your main goal is to update the data in detail. To do so, you should call the LoadDataRequest for dataSourceName of this detail (or for a separate field of the object):

request: "crt.SaveRecordRequest",
handler: async (request, next) => {
	await next?.handle(request);
	const gridDetailDataSourceName = request.$context.getBoundDataSourceNameByAttributePath("GridDetail_pds6xcv");
	await request.$context.executeRequest({
		type:"crt.LoadDataRequest",
		$context: request.$context,
		"dataSourceName": gridDetailDataSourceName,
		"config": {
			"loadType": "reload",
			"useLastLoadParameters": true
		}
	});
}

 

Hi

Anhelina,

 

The Main Goal is to get the changed fields. For example, we open a record, make some changes to two fields and click on save button. In the SaveRecordRequest we should be able to get the changed fields name and it's value

 

Regards

Rakshith Dheer

 

Show all comments