Skip to content

Instantly share code, notes, and snippets.

@tac-ljustiniano
Last active August 24, 2022 03:23
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save tac-ljustiniano/74bfe34432846dea1815d89d44a76380 to your computer and use it in GitHub Desktop.
Save tac-ljustiniano/74bfe34432846dea1815d89d44a76380 to your computer and use it in GitHub Desktop.
Uploading Panel
<px:PXUploadDialog
ID="ImportPanel"
runat="server"
Key="View"
Height="120px"
Style="position: static"
Width="560px"
Caption="Service Account Key file (*.json | *.p12)"
AutoSaveFile="true"
RenderCheckIn="false"
SessionKey="ServiceAccountKeyFile" />
public PXAction<T> UploadKey;
[PXUIField(DisplayName = Labels.UploadKey, Enabled = false)]
[PXButton]
protected virtual IEnumerable uploadKey(PXAdapter adapter)
{
if (View.AskExt() == WebDialogResult.OK)
{
const string psk = "ServiceAccountKeyFile";
PX.SM.FileInfo info = PX.Common.PXContext.SessionTyped<PXSessionStatePXData>().FileInfo[psk] as PX.SM.FileInfo;
if(info != null)
{
T config = View.Current;
// Setup parameters code here
View.Update(config);
PXNoteAttribute.AttachFile(View.Cache, config, info);
PXNoteAttribute.SetFileNotes(View.Cache,config, info.UID.Value);
Actions.PressSave();
}
}
return adapter.Get();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment