File attachment not seen after upload

Hi Community,

 

I've created a detail in FreedomUI that adds attachments to the SysFile table. But upon upload, I can see the newly added file in the detail only after reloading the whole page. 

 

 

I tried to reload the detail on upload using the following code but it didn't work:

 



{

                request:"crt.UploadFileRequest",

                handler:async (request, next) =>{

                    console.log("new record");

                    await next?.handle(request);



                    const handlerChain = sdk.HandlerChainService.instance;

                    for(var i = 0;i<2;i++)

                    {

                        await handlerChain.process({

                                                    type: "crt.LoadDataRequest",

                                                    $context: request.$context,

                                                    config: {

                                                        loadType: "reload"

                                                    },

                                                    dataSourceName: "DataGrid_0b46u59DS"

                                                });

                    }



                }

},

 

I would like to see the file in the detail as soon as its uploaded. 

 

Thanks in advance for any help!

 

Regards,

Abilash.S

 

 

 

 

Like 1

Like

2 comments

Hello,

Please try reloading using this code

setInterval(async ()=&gt;{
                                const handlerChain = sdk.HandlerChainService.instance;
                                await handlerChain.process({
                                    type: 'crt.LoadDataRequest',
                                       $context: request.$context,
                                    config: {
                                        loadType: 'reload'
                                    },
                                    dataSourceName: '{Your Data Source}'
                                });                        
                            }, 1000);

 

Hello,

You can still use that approach, or you can add a standard attachment component.

Show all comments