Question

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

  • 21 December 2023
  • 4 replies
  • 57 views

Userlevel 3
Badge

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

Userlevel 7
Badge +17

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

Userlevel 3
Badge

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

Userlevel 7
Badge +17

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

Userlevel 7
Badge

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

Reply


About Acumatica ERP system
Acumatica Cloud ERP provides the best business management solution for transforming your company to thrive in the new digital economy. Built on a future-proof platform with open architecture for rapid integrations, scalability, and ease of use, Acumatica delivers unparalleled value to small and midmarket organizations. Connected Business. Delivered.
© 2008 — 2024  Acumatica, Inc. All rights reserved