Skip to main content
Answer

Removing "Create Payment" buttton

  • April 11, 2025
  • 8 replies
  • 134 views

SergioSP
Freshman II
How can we remove the “Create Payment” button for Sales users while still allowing our users (Salespeople) to create pre-payments?
 

 

 
Our goal is to allow prepayments, but prevent the team from using the standard payment processing flow.

Thanks!

Best answer by Naveen Boga

@SergioSP  Instead of customizing, you can simply create a role for your team that restricts access to the 'Create Payment' feature by configuring the appropriate access rights.

8 replies

DrewNisley
Pro I
Forum|alt.badge.img+3
  • Pro I
  • April 11, 2025

It depends, you can remove it by going into a customization project and making it disabled. However, this can be an issue if you use any sales order types where you can’t use prepayments, such as mixed orders. In my case, I conditionally disabled it by creating a custom field that checks the order type and spits out true for order types that it needs to be enabled and spits out false for the others.

If that doesn’t matter to you, then just set the Enabled field to false instead of worrying about the DependOnGrid and StateColumn. It’s the second button from the top on the Adjustments grid.

// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
// Acuminator disable once PX1011 InheritanceFromPXCacheExtension [Justification]
public class SO_SOOrder_ExistingColumn : PXCacheExtension<PX.Objects.SO.SOOrder>
{
#region UsrPaymentVisibleCondition
[PXBool]
[PXUIField(DisplayName = "PaymentVisibleCondition")]
[PXUIEnabled(typeof(False))]
[PXDefault(PersistingCheck = PXPersistingCheck.Nothing)]
[PXFormula(typeof(IIf<SOOrder.behavior.IsEqual<SOOrderConstants.orderTypeMO>
.And<SOOrder.curyUnpaidBalance
.IsNotEqual<SOOrderConstants.decimalZero>>, True, False>),
Persistent = true)]
public virtual bool? UsrPaymentVisibleCondition { get; set; }
public abstract class usrPaymentVisibleCondition :
PX.Data.BQL.BqlBool.Field<usrPaymentVisibleCondition> { }
#endregion
}

public class SOOrderConstants
{
public const string OrderTypeMO = "MO";
public class orderTypeMO : BqlType<IBqlString, string>.Constant<orderTypeMO>
{ public orderTypeMO() : base(OrderTypeMO) { } }
}

 


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • Answer
  • April 12, 2025

@SergioSP  Instead of customizing, you can simply create a role for your team that restricts access to the 'Create Payment' feature by configuring the appropriate access rights.


valentynbeznosiuk
Jr Varsity I
Forum|alt.badge.img+3

@Naveen Boga ​@SergioSP It’s actually a good advice. I’ve tried the following and it works as expected.

 


ricoybanez
Jr Varsity III
Forum|alt.badge.img+3
  • Jr Varsity III
  • April 14, 2025

@SergioSP 

  • Go to your Access Rights by Role (SM201025)
  • Select the Role Name
  • Change Access Rights to REVOKE

 

 

 

 


DrewNisley
Pro I
Forum|alt.badge.img+3
  • Pro I
  • April 14, 2025

@SergioSP  Instead of customizing, you can simply create a role for your team that restricts access to the 'Create Payment' feature by configuring the appropriate access rights.

@Naveen Boga Hmm, I never even thought about doing it that way. Can you do it per sales order type that way as well?


valentynbeznosiuk
Jr Varsity I
Forum|alt.badge.img+3

@DrewNisley Access Rights works for the screen generally and cannot apply it only for specific SOTypes, so in this case, your method steps in as the best way to do it


DrewNisley
Pro I
Forum|alt.badge.img+3
  • Pro I
  • April 14, 2025

@valentynbeznosiuk Gotcha, appreciate it.


DrewNisley
Pro I
Forum|alt.badge.img+3
  • Pro I
  • May 1, 2025

By the way, just in case anyone was planning on using my method, I realized I am an idiot and there is a much simpler way to accomplish it.

// Acuminator disable once PX1016 ExtensionDoesNotDeclareIsActiveMethod extension should be constantly active
public class SOOrderEntryExt : PXGraphExtension<SOOrderEntry>
{
protected virtual void _(Events.RowSelected<SOOrder> e, PXRowSelected baseHandler)
{
SOOrder line = e.Row;

baseHandler?.Invoke(e.Cache, e.Args);

var ext = Base.GetExtension<PX.Objects.SO.GraphExtensions.SOOrderEntryExt.CreatePaymentExt>();

if (line.Behavior == "MO" && line.UnpaidBalance != 0)
{
ext.createDocumentPayment.SetEnabled(true);
}
else
{
ext.createDocumentPayment.SetEnabled(false);
}
}
}