Skip to main content
Solved

Removing "Create Payment" buttton

  • Apr 11, 2025 5:42 PM UTC
  • 8 replies
  • 191 views
  • Translate All

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.

View original

8 replies

DrewNisley
Pro I
Forum|alt.badge.img+4
  • Pro I
  • Apr 11, 2025 7:32 PM UTC

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) { } }
}

 

Translate

Naveen Boga
Captain II
Forum|alt.badge.img+20
  • Captain II
  • Answer
  • Apr 12, 2025 3:10 AM UTC

​@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.

Translate

valentynbeznosiuk
Varsity I
Forum|alt.badge.img+7

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

 

Translate

ricoybanez
Jr Varsity III
Forum|alt.badge.img+5
  • Jr Varsity III
  • Apr 14, 2025 2:34 AM UTC

​@SergioSP 

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

 

 

 

 

Translate

DrewNisley
Pro I
Forum|alt.badge.img+4
  • Pro I
  • Apr 14, 2025 11:19 AM UTC

​@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?

Translate

valentynbeznosiuk
Varsity I
Forum|alt.badge.img+7

​@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

Translate

DrewNisley
Pro I
Forum|alt.badge.img+4
  • Pro I
  • Apr 14, 2025 11:24 AM UTC

​@valentynbeznosiuk Gotcha, appreciate it.

Translate

DrewNisley
Pro I
Forum|alt.badge.img+4
  • Pro I
  • May 1, 2025 5:51 PM UTC

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);
}
}
}

 

Translate