I have a custom button on the Sales Orders screen , when the button is clicked, a smart panel is displayed. I want the smart panel to auto-populate but the code I have only populates the first 2 fields. What could be the issue with my code and how can I fix it?
Code that displays the smart panel:
<code> public PXFilter<SOQuickPayment> POSQuickPayment;
private void ShowQuickPaymentPanel(SOOrder order, string PaymentType)
{
POSQuickPayment.Current.CuryOrigDocAmt = order.CuryOrderTotal;
POSQuickPayment.Current.CuryID = order.CuryID;
POSQuickPayment.Current.DocDesc = "Text";
if (PaymentType == "Card")
{
POSQuickPayment.Current.PaymentMethodID = POSPreferences.SelectSingle().PaymentMethodsCard;
POSQuickPayment.Current.CashAccountID = POSPreferences.SelectSingle().CardAccount;
}
else if (PaymentType == "Cash")
{
POSQuickPayment.Current.PaymentMethodID = POSPreferences.SelectSingle().PaymentMethodsCash;
POSQuickPayment.Current.CashAccountID = POSPreferences.SelectSingle().CashAccount;
}
POSQuickPayment.Current.ExtRefNbr = PaymentType + " Payment";
// Display the QuickPayment smart panel
POSQuickPayment.AskExt();
}
</code>
<code> public PXFilter<SOQuickPayment> POSQuickPayment;
private void ShowQuickPaymentPanel(SOOrder order, string PaymentType)
{
POSQuickPayment.Current.CuryOrigDocAmt = order.CuryOrderTotal;
POSQuickPayment.Current.CuryID = order.CuryID;
POSQuickPayment.Current.DocDesc = "Text";
if (PaymentType == "Card")
{
POSQuickPayment.Current.PaymentMethodID = POSPreferences.SelectSingle().PaymentMethodsCard;
POSQuickPayment.Current.CashAccountID = POSPreferences.SelectSingle().CardAccount;
}
else if (PaymentType == "Cash")
{
POSQuickPayment.Current.PaymentMethodID = POSPreferences.SelectSingle().PaymentMethodsCash;
POSQuickPayment.Current.CashAccountID = POSPreferences.SelectSingle().CashAccount;
}
POSQuickPayment.Current.ExtRefNbr = PaymentType + " Payment";
// Display the QuickPayment smart panel
POSQuickPayment.AskExt();
}
</code>
public PXFilter<SOQuickPayment> POSQuickPayment;
private void ShowQuickPaymentPanel(SOOrder order, string PaymentType)
{
POSQuickPayment.Current.CuryOrigDocAmt = order.CuryOrderTotal;
POSQuickPayment.Current.CuryID = order.CuryID;
POSQuickPayment.Current.DocDesc = "Text";
if (PaymentType == "Card")
{
POSQuickPayment.Current.PaymentMethodID = POSPreferences.SelectSingle().PaymentMethodsCard;
POSQuickPayment.Current.CashAccountID = POSPreferences.SelectSingle().CardAccount;
}
else if (PaymentType == "Cash")
{
POSQuickPayment.Current.PaymentMethodID = POSPreferences.SelectSingle().PaymentMethodsCash;
POSQuickPayment.Current.CashAccountID = POSPreferences.SelectSingle().CashAccount;
}
POSQuickPayment.Current.ExtRefNbr = PaymentType + " Payment";
// Display the QuickPayment smart panel
POSQuickPayment.AskExt();
}