cancel
Showing results for 
Search instead for 
Did you mean: 
Subscribe

Hello,

in the controller extension the following code is not working:

        openDialog: function (text, formVisible, fnAction) {
            return new Promise(
                function (resolve, reject) {
                    this.base.getExtensionAPI()
                        .loadFragment({
                            name: "com.zsd.paymterms.zsdpaymterms.ext.fragment.DialogUploadFile",
                            controller: this
                        })
                        .then(function (approveDialog) {
                            console.log(approveDialog);
 
 approveDialog is undefined even if the http call for the fragment is ok.
Any Hint ?
 
Thank you
 
Filippo
0 Likes
View Entire Topic
Marian_Zeis
Active Contributor

better use async await, try this to see the return of loadFragment:

openDialog: async function (text, formVisible, fnAction) {
  const extensionApi = this.base.getExtensionAPI();
  const fragment = await extensionApi.loadFragment({
    name: "com.zsd.paymterms.zsdpaymterms.ext.fragment.DialogUploadFile",
    controller: this
  });
  console.log(fragment)
}

 

Mepspa
Explorer
0 Likes

Hi Marian,

it worked, thanks so much.

Now I have another problem.

I need to call an unbound action from the list page, to upload a File.

I defined it in the behavior definition:

static action uploadFile parameter ZB_SD_UPLOAD_FILE

Filo_0-1757405677142.png

then I exposed It in the behavior projection:

use action uploadFile

the javascript code in the controller:

 

Filo_3-1757406019053.png

I got the error: Unknown action import

In debug I found the problem is here:

Filo_4-1757406138091.png

the ActionImport array is empty ( because no action imports tag is present in the metadata file ).

Any suggestions ?

 

 

 

 

Marian_Zeis
Active Contributor
0 Likes

@Mepspajust open another question for that as this is another problem, thanks!

Also did my suggested code worked exactly? Can you post that?