Skip to main content
Question

My customize working properly but when using acumatica software for more than a week. the customize stop working

  • December 21, 2023
  • 4 replies
  • 87 views

Forum|alt.badge.img

My customize working properly but when using acumatica software for more than a week. the customize stop working. When I restart IIS Server, It’s working again. I think the problem is not my customize. Do you have any solution on that ?

4 replies

Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • December 21, 2023

@kevinheng21 Can you please provide more details about your customization?


Forum|alt.badge.img
  • Author
  • Jr Varsity II
  • December 22, 2023

@kevinheng21 Can you please provide more details about your customization?

Only this block code:

    // Acuminator disable once PX1008 LongOperationDelegateSynchronousExecution [Justification]
    // Acuminator disable once PX1013 PXActionHandlerInvalidReturnType [Justification]
    [PXButton(CommitChanges = true)]
[PXUIField(DisplayName = "Activate", MapEnableRights = PXCacheRights.Delete, MapViewRights = PXCacheRights.Delete)]
protected void Activate() => PXLongOperation.StartOperation((PXGraph) this, (PXToggleAsyncDelegate) (() =>
{
  BOQ current = this.boqView.Current;
  if (current != null && current.Status == "V")
  {
    int? nullable = current.UnBillAccount;
        // Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
        nullable = nullable.HasValue ? current.UnEarnAccount : throw new PXSetPropertyException("Invalid UnBillAccount", PXErrorLevel.Error);
        // Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
        nullable = nullable.HasValue ? current.RevenueAccount : throw new PXSetPropertyException("Invalid UnEarnAccount", PXErrorLevel.Error);
        // Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
        nullable = nullable.HasValue ? current.COGSAccount : throw new PXSetPropertyException("Invalid RevenueAccount", PXErrorLevel.Error);
        // Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
        nullable = nullable.HasValue ? current.WIPAccount : throw new PXSetPropertyException("Invalid COGSAccount", PXErrorLevel.Error);
        // Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
        nullable = nullable.HasValue ? current.ContraAccount : throw new PXSetPropertyException("Invalid WIPAccount", PXErrorLevel.Error);
    if (!nullable.HasValue)
            // Acuminator disable once PX1050 HardcodedStringInLocalizationMethod [Justification]
            throw new PXSetPropertyException("Invalid ContraAccount", PXErrorLevel.Error);
  }
  if (!this.boqView.Current.Released.Value)
  {
    try
    {
      ReasonCodeMaint instance = PXGraph.CreateInstance<ReasonCodeMaint>();
      instance.reasoncode.Insert();
      instance.reasoncode.Current.ReasonCodeID = this.boqView.Current.BOQCode + "I";
      instance.reasoncode.Current.Descr = "Issue on " + this.boqView.Current.Descr;
      instance.reasoncode.Current.Usage = "I";
      instance.reasoncode.Current.AccountID = this.boqView.Current.WIPAccount;
      instance.reasoncode.Current.SubID = this.boqView.Current.SubID;
      instance.Save.Press();
      ReasonCodeExt extension = PXCache<ReasonCode>.GetExtension<ReasonCodeExt>(instance.reasoncode.Current);
      extension.UsrIsBOQ = new bool?(true);
      extension.UsrIsActive = new bool?(true);
      extension.UsrDescrBOQ = this.boqView.Current.Descr;
      extension.UsrSubTaskID = this.boqView.Current.BOQCode;
      instance.reasoncode.Update(instance.reasoncode.Current);
      instance.Actions.PressSave();
    }
    catch (Exception ex)
    {
    }
    try
    {
      ReasonCodeMaint instance = PXGraph.CreateInstance<ReasonCodeMaint>();
      instance.reasoncode.Insert();
      instance.reasoncode.Current.ReasonCodeID = this.boqView.Current.BOQCode + "A";
      instance.reasoncode.Current.Descr = "adjust on " + this.boqView.Current.Descr;
      instance.reasoncode.Current.Usage = "A";
      instance.reasoncode.Current.AccountID = this.boqView.Current.WIPAccount;
      instance.reasoncode.Current.SubID = this.boqView.Current.SubID;
      instance.Save.Press();
      ReasonCodeExt extension = PXCache<ReasonCode>.GetExtension<ReasonCodeExt>(instance.reasoncode.Current);
      extension.UsrIsBOQ = new bool?(true);
      extension.UsrIsActive = new bool?(true);
      extension.UsrDescrBOQ = this.boqView.Current.Descr;
      extension.UsrSubTaskID = this.boqView.Current.BOQCode;
      instance.reasoncode.Update(instance.reasoncode.Current);
      instance.Actions.PressSave();
    }
    catch (Exception ex)
    {
    }
  }
  this.boqView.Current.Status = "A";
  this.boqView.Current.IsValidated = new bool?(false);
  this.boqView.Current.ValidatedCount = new Decimal?(0M);
  this.boqView.Current.Released = new bool?(true);
  this.boqView.Cache.Update((object) this.boqView.Current);
  this.Save.Press();
}));


Naveen Boga
Captain II
Forum|alt.badge.img+19
  • Captain II
  • December 22, 2023

@kevinheng21 Can you please share the issue details or what is not working from the above code?

and Please share the details requested above like in which screen you have written this code and what is expected results.


Chris Hackett
Community Manager
Forum|alt.badge.img
  • Acumatica Community Manager
  • January 15, 2024

Hi @kevinheng21 were you able to find a solution? Thank you!