Hi All
Do you have any idea of below functionality could you please suggest me on this. I hope your support & Presence
Thanks in Advance.
Here is my Revision button code
public PXAction<SSPAgreement> Revision;
PXButton(CommitChanges = true), PXUIField(DisplayName = "Revision", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select)]
public void revision()
{
// Acuminator disable once PX1050 HardcodedStringInLocalizationMethod Justification]
WebDialogResult result = Agreements.Ask(ActionsMessages.Warning, PXMessages.LocalizeFormatNoPrefix("Are you sure you want to create a new revision?"), MessageButtons.OKCancel, MessageIcon.Information, true);
if (result == WebDialogResult.OK)
{
if (Agreements.Current != null)
{
SSPAgreement agreementsOldRecord = Agreements.Current;
SSPAgreement agreementsNewRecord = new SSPAgreement();
agreementsNewRecord.TemplateCode = agreementsOldRecord.TemplateCode;
agreementsNewRecord.Revision = (int)(agreementsOldRecord.Revision + 1);
agreementsNewRecord.AgreeNbr = (string)(agreementsOldRecord.AgreeNbr);
agreementsNewRecord.Active = agreementsOldRecord.Active;
Agreements.Cache.Update(agreementsNewRecord);
this.Actions.PressSave();
throw new PXRedirectRequiredException(PXGraph.CreateInstance<SSPAgreementMaint>(agreementsNewRecord.TemplateCode), "Agreements") { Mode = PXBaseRedirectException.WindowMode.Same };
}
}
}
protected void SSPAgreement_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
var row = (SSPAgreement)e.Row;
if (row.Active.GetValueOrDefault())
this.Revision.SetEnabled(true);
else
this.Revision.SetEnabled(false);
}