0

IN Kit Assembly screen, once i release Kit Assembly then i can never update INKitAssembly,

But I have to allow KitAssembly Extension table fields to update. how may i allow to update custom fields added in INRegister(InKitAssembly) extension table?

Is there a way to update InKitAssembly extension table fields on Release operation completion, DO you have any call back delegate after Release kitAssembly long operation completion?

user_mat
  • 191
  • 2
  • 16
  • What types of fields are you looking to update? simple fields when released, or calculations? – KRichardson May 08 '20 at 17:38
  • It's about updating a custom field located in a INRegister DAC extension. The solution is to re-enable the fields in RowSelected event and in worst case to disable the automation steps which disables the fields. There are similar questions, general guidelines like setting AllowUpdate=true can be found in this answer: https://stackoverflow.com/questions/46004556/how-to-enable-a-custom-field-on-gl301000-when-the-batch-is-posted/46963349#46963349 – Hugues Beauséjour May 08 '20 at 19:26
  • Another answer on the same subject: https://stackoverflow.com/a/46436074/7376238 – Hugues Beauséjour May 08 '20 at 19:42
  • This related answer focus on automation steps: https://stackoverflow.com/a/46450281/7376238 – Hugues Beauséjour May 08 '20 at 19:43
  • Same topic again: https://stackoverflow.com/a/45177649/7376238 – Hugues Beauséjour May 08 '20 at 19:44
  • Thanks @Hugues sir for help, In case of "Kit Assembly", when i update after release i got the error Serial Number 'SRF000' for item 'ABC001' is already received. any comment on it? – user_mat May 11 '20 at 12:47
  • What do you mean by update? This happens when you call an update method? – Hugues Beauséjour May 11 '20 at 14:10
  • Update means, when call save method. when call Base.Document.Update(inRegObj); then call Base.Persist() method. – user_mat May 11 '20 at 16:10

1 Answers1

0

Updating your extension values in the INReleaseProcess persist should work. Something like this:

public class INReleaseProcessExte : PXGraphExtension<INReleaseProcess>
{
    [PXOverride]
    public virtual void Persist(Action del)
    {
        foreach (INTran row in Base.intranselect.Cache.Updated)
        {
            if (row?.DocType != INDocType.Production || row.Released != true)
            {
                continue;
            }

            // update your extension here
            var inTranExt = PXCache<INTran>.GetExtension<INTranMyExtension>(row);
            inTranExt.MyField = "X";
            Base.intranselect.Update(row);
        }

        del?.Invoke();
    }
}
Brendan
  • 5,428
  • 2
  • 17
  • 33