Skip to main content

Hi, 

I am new to acumatica and I am trying to do some customization

I have created a new payment method and would want to have create a function related to it. eg, on selecting the said payment method, a TextEdit to appear for input of a variable, a given action button to be enabled. On the Button Click, I want to query a table and return true or false. If true the save action to go through.

 

namespace PX.Objects.AR
{
  public class ARPaymentEntry_Extension : PXGraphExtension<ARPaymentEntry>
  {
    #region Event Handlers

    public PXAction<PX.Objects.AR.ARPayment> ProcessTemp;
  
    ;PXButton(CommitChanges = true)]
    aPXUIField(DisplayName = "Process Temp")]
    protected void processTemp()
    {

    }



    #endregion
  }
}

 

Someone kindly help.

Dan

Hi @doyuga,

 

Can you please provide details on the “Process Temp” action? What exactly you wanted to do on this button click.

 

 


I would want it to call a function while passing passing the parameters(paymentmethod,Tempinput, and the amount). The function to return true or false. If the function returns true, then the save process goes through else the save process raises exception.


Hi @doyuga,

 

Can you please provide details on the “Process Temp” action? What exactly you wanted to do on this button click.

 

 

 

I would want it to call a function while passing passing the parameters(paymentmethod,Tempinput, and the amount). The function to return true or false. If the function returns true, then the save process goes through else the save process raises exception.


Hi @doyuga,

 

Please find the below code and hope that helps you!!

 

  public PXAction<PX.Objects.AR.ARPayment> ProcessTemp;
PXButton()]
PXUIField(DisplayName = "Process Temp", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = true)]
protected virtual IEnumerable processTemp(PXAdapter adapter)
{
bool status = GetTemparatureDetails(Base.Document.Current.PaymentMethodID, Base.Document.Current.TempInputValue);
if (status == false)
{
throw new PXException("Error");
}

return adapter.Get();
}
public bool GetTemparatureDetails(string PaymentMethod, string tempInput)
{

bool status = false;

// logic here

if (condtion)
{
status = true;
}
else
{
status = false;
}

return status;
}


Hi @doyuga,

 

Please find the below code and hope that helps you!!

 

  public PXAction<PX.Objects.AR.ARPayment> ProcessTemp;
PXButton()]
PXUIField(DisplayName = "Process Temp", MapEnableRights = PXCacheRights.Select, MapViewRights = PXCacheRights.Select, Enabled = true)]
protected virtual IEnumerable processTemp(PXAdapter adapter)
{
bool status = GetTemparatureDetails(Base.Document.Current.PaymentMethodID, Base.Document.Current.TempInputValue);
if (status == false)
{
throw new PXException("Error");
}

return adapter.Get();
}
public bool GetTemparatureDetails(string PaymentMethod, string tempInput)
{

bool status = false;

// logic here

if (condtion)
{
status = true;
}
else
{
status = false;
}

return status;
}

 

Thanks Naveen for great help.

My tempinput field is not recognized as part of current document, which property can i configure to make it recognizable. 

I would also wish, to apply a condition that if the paymentmethod is TEMP and status is false, then You cannot save that sales entry.

Thanks.


Hi @doyuga,

As “Temp Input” is a DAC extended column. Please use the below syntax to get that column.

 

Base.Document.Cureent.GetExtension<ARRegister>().UsrTempInput.


Reply