Question

UploadFileRequest in Menu Item

Hi 

I am trying to use the crt.UploadFileRequest in the action menu on the click of 'Upload a file' as shown in the figure. But the functionality doesn't work as the upload function in the attachment detail. Is there any other we can use upload a file from clicking button in the action-menu. 

Like 0

Like

4 comments

Hello,

 

Please describe in detail how this detail was implemented so we could better understand the issue.

Mira Dmitruk,

 

We are basically trying to add the Upload File  funtionality to the Menu item (Upload File as shown above in the image). 

 

We created a attachment detail through the desinger page and gave the functionality shown in the image  (which is the upload functionality for upload button for the attachement detail ) below to the rowToolbarItems (menu item). But it dosen't work 

Hello,
It looks like the best possible option is to use the Button with the "Upload file" action. Also, each detail has an option "Data import" with the following code, perhaps it can be helpful in your task.

                    "clicked": {
                        "request": "crt.ImportDataRequest",
                        "params": {
                            "entitySchemaName": "ServiceEngineer"
                        }
                    },

This is what I am using to upload files in Freedom UI:

const handlerChain = sdk.HandlerChainService.instance;
await handlerChain.process({
	type: "crt.UploadFileRequest",
	$context: request.$context,
	fileEntitySchemaName: "AccountFile",
	recordColumnName: "Account",
	recordId: accountId
});

Note that if you're not using the viewElementName property the list won't refresh on it's own (however, you can refresh separately, if needed)

Ryan

Show all comments