Skip to main content
Question

Trying to open the Files dialog box from a button on a Catalog item in Modern UI SSP

  • Nov 5, 2026 6:58 PM UTC
  • 3 replies
  • 18 views
  • Translate All

Joe Schmucker
Captain II
Forum|alt.badge.img+3

I have a customer that allows a portal user to upload files to inventory items listed in the SSP classic UI.  Yes, that seems a bit unusual, but it is what the customer wishes to do.

In classic UI, it was easy.  I just added FilesIndicator="True" to the grid aspx.  It took care of everything for me.

I’m trying to accomplish the same behavior in the SSP MUI in 26R1.  The catalog is no longer a grid.  So I am trying to open the Files dialog using an action.

I added a custom button with an action to the Catalog item in the SSP MUI

This button triggers my action, but I don’t think this is the necessarily the answer. 

 

In the Acumatica documentation, they say to do this (https://beacon.acumatica.com/r/UI-Component-Guide/Dialog-Box/Dialog-Box-Files#hiding-the-files-button)

In TypeScript code, define the following method, which opens the Files dialog box.

filesShow() { (this.activeScreenVM?.screenService .getDataComponent(NoteMenuDataComponent.dataComponentName) as NoteMenuDataComponent).filesShow(); }

Then, put this in my HTML file extension

<qp-button id="btnFiles" caption="Open Files" click.delegate="filesShow()"> </qp-button>

 

I tried to do this but I’m no doubt missing knowledge here.

Here is a print screen so you can see the compiler errors:

Here is my code for thoroughness.  I have extra unused imports in case I needed them.

import {
PXFieldState,
PXView,
PXActionState,
} from "client-controls";
import { SP504001 } from "src/screens/SP/SP504001/SP504001";
import { CatalogScreen } from "src/screens/SP/sp-base";
import { InventoryItemView } from "src/screens/SP/catalog/view-models";
import { InventoryItem } from "../../../../../screens/IN/IN504000/IN504000";
//import { InventoryItemView } from "src/screens/SP/catalog/view-models";

export interface SP504001_ICSJoePortal_generated extends SP504001 { }
export class SP504001_ICSJoePortal_generated { }

export interface InventoryItemView_ICSJoePortal_generated extends InventoryItemView { }
export class InventoryItemView_ICSJoePortal_generated extends PXView {
UploadFile: PXActionState;

filesShow() {
(this.activeScreenVM?.screenService
.getDataComponent(NoteMenuDataComponent.dataComponentName) as NoteMenuDataComponent).filesShow();
}


//this just displays the file link. Just verifying I have the ability to get the file link
//UsrFileLink: PXFieldState;
}

 You can ignore the UsrFileLink field.  That is not the issue.

<template>
<field remove="#fsCatalog field[name='unboundImage']"></field>

<field append="#fsCatalog" name="FilteredItems.UsrFileLink" control-type="qp-link-editor"></field>

<qp-button id="btnUploadFileAction" icon="upload" caption="Upload File" class="sp-add-to-cart" state.bind="FilteredItems.UploadFile" after="#fsCatalog"></qp-button>
</template>

Here is the action.  It fires and gets the inventory ID from the adapter, but that is as far as I got.

		public PXAction<SPInventoryItem> UploadFile;
[PXButton(CommitChanges = true, Tooltip = "Upload File")]
[PXUIField(DisplayName = "Upload File", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
protected virtual IEnumerable uploadFile(PXAdapter adapter)
{
SPInventoryItem row = adapter.Get<SPInventoryItem>().FirstOrDefault();

if (row != null)
{
InventoryItem inventory = SelectFrom<InventoryItem>.Where<InventoryItem.inventoryID.IsEqual<@P.AsInt>>
.View.Select(Base, row.InventoryID);
if (inventory != null)
{
//open panel here?

}
}
return adapter.Get();
}

 

Maybe if I can find out how to filesToShow in TS to work, it will make all my dreams come true.

My other thought was that in my custom action, I can use a panel popup somehow.  Probably not.  I don’t want to have to completely create my own custom panel to do this.

 

Acumatica support told me I am one of about 4 people doing customizations to the MUI portal, so I am not hopeful…   😉

 

3 replies

Forum|alt.badge.img+8
  • Captain II
  • Nov 5, 2026 7:28 PM UTC

PJ303000.ts has code to run this. And so PJ303000.html will have the other parts.

You’re missing NoteMenuDataComponent in your import {} section at the top of your .ts file. Try adding that before looking at the PJ files (because they do it slightly differently than what the UI Components documentation says).

 

Translate

Steve Milner
Varsity III
Forum|alt.badge.img+6
  • Varsity III
  • Nov 6, 2026 3:56 AM UTC

@Joe Schmucker Django's right on both counts. NoteMenuDataComponent comes from "client-controls", the same way PJ303000 brings it in. That clears the NoteMenuDataComponent errors.

The activeScreenVM error is a different problem. That property belongs to the side panel control (QpSidePanelCustomElement), so it won't resolve on a PXView. On a screen you go through screenService, and that lives on PXScreen, not PXView. Move filesShow() out of InventoryItemView_ICSJoePortal_generated and into SP504001_ICSJoePortal_generated. Stock SM200505_Excel calls this.screenService from an extension class shaped just like yours. This is PJ303000's version:

async showFiles() {
    await (<NoteMenuDataComponent> this.screenService.getDataComponent("NotesMenuData"))?.filesShow();
}

Before you hang it on the card, check what the dialog points at. filesShow() opens it against the screen's primary view. On SP504001 that's FilteredItems, which is an SPInventoryItem projection. In 26R1, SPInventoryItem has no NoteID field, and files attach through a PXNote NoteID. The item's own files sit under InventoryItem.NoteID, which is where the catalog's image join reads them. INSiteStatusSelected maps it with [PXNote(BqlField = typeof(InventoryItem.noteID))].

Translate

Joe Schmucker
Captain II
Forum|alt.badge.img+3
  • Author
  • Captain II
  • Nov 6, 2026 2:10 PM UTC

​@Steve Milner Thanks for sharing all that knowledge.  ​@Django Thank you as well!

The button on my screen opens an action.  I am able to get the inventory ID inside that action through the adapter.  So at least I can pull the noteID for the inventory item to add a file.  Maybe I need to create my own custom panel to get the file from the customer and use my action to manually add the file to fileupload etc.  As you pointed out, the base screen is going to try to add a file to that screen which doesn’t really exist.

I don’t know how complicated it would be to create a panel to all the user to upload a file into memory so I can save it manually.  Does that even sound possible to you???

Translate