Last active
August 24, 2022 03:23
-
-
Save tac-ljustiniano/74bfe34432846dea1815d89d44a76380 to your computer and use it in GitHub Desktop.
Uploading Panel
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<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" /> |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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