Solved

How do I access the FILES dialog box via customization project (or even in the UI itself)?

  • 27 December 2022
  • 2 replies
  • 217 views

Userlevel 3
Badge

 

I am trying to access the ADD LINK action in the appointments screen which, when invoked, calls up the Search In Files screen.  When I add the Appointments screen to a customization project I am unable to find any reference to this dialog box or linkage anywhere.  Does anyone know how I can access this dialog box?

 

 

 

 

 

icon

Best answer by Leonardo Justiniano 5 January 2023, 18:56

View original

2 replies

Userlevel 6
Badge +4

Hi @dgross54 

 

This dialog box is part of the main frame screen and is hidden for customizations. What do you want to customize in that dialog?

You could have access to the files of the appointment by doing:

Guid[] files = PXNoteAttribute.GetFileNotes(sender, row);
foreach (Guid fileID in files)
{
// Your logic
}

Also you can customize the upload dialog box logic by creating by adding 

 

Do not forget to set the session key on the dialog:

Then in the code you can have a button with specific custom logic:

 

#region UploadButton
public PXAction<GCSetup> UploadButton;
[PXUIField(DisplayName = "YourButtonLabelHere", Enabled = false)]
[PXButton]
protected virtual IEnumerable uploadButton(PXAdapter adapter)
{
if (AppointmentRecords.AskExt() == WebDialogResult.OK)
{
const string psk = "YourSessionKeyHere";
PX.SM.FileInfo info = PX.Common.PXContext.SessionTyped<PXSessionStatePXData>().FileInfo[psk] as PX.SM.FileInfo;
if(info != null)
{
FSAppointment config = AppointmentRecords.Current;

// Your Logic Here

PXNoteAttribute.AttachFile(AppointmentRecords.Cache, config, info);
PXNoteAttribute.SetFileNotes(AppointmentRecords.Cache,config, info.UID.Value);
Actions.PressSave();
}
}
return adapter.Get();
}
#endregion

Hope this helps

Happy New Year!

Userlevel 6
Badge +4

Hi @dgross54 

 

I did further research and questions around and I got this step by step from the community:

It might be helpful in what you want to address in your code. I always try no to go that far deep but the Acumatica Framework always has a path.

 

Hope this also can help.

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved