Solved

Allow edit to shipment line field after confirmation

  • 19 June 2023
  • 9 replies
  • 131 views

Userlevel 3
Badge

I’m having trouble figuring out the code to allow me to modify the workflow of preventing a field from becoming disabled at shipment confirmation.

 

The field I want to allow edit’s is ISPSUCC128

 

Here is the code I’m attempting to use but I’m getting a validation error

 

  public class SOShipmentEntryExt : PXGraphExtension<SOShipmentEntry>
    {
        protected virtual void SOShipment_RowSelected(PXCache cache, PXRowSelectedEventArgs e, PXRowSelected InvokeBaseHandler)
        {
            InvokeBaseHandler?.Invoke(cache, e);
            SOShipment row = e.Row as SOShipment;
            if (row != null)
            {
                Base.Document.Cache.AllowUpdate = true;
                PXUIFieldAttribute.SetEnabled<SOPackageDetailEx.ISPSUCC128>(cache, row, true);
                
            }
        }
    }

 

Thanks,
Justin

icon

Best answer by Naveen Boga 20 June 2023, 18:42

View original

9 replies

Userlevel 7
Badge +17

Hi @jcox43  To enable the fields in Acumatica once the document has been changed to CONFIRMED /COMPLETED statuses, we must enable those custom fields both at the Code level and also from the Workflow steps.

 

Here is the article - https://asiablog.acumatica.com/2021/10/enable-customization-fields-when-document-is-completed.html

 

Please let me know if you need any help on this.

 

Hope this helps

Userlevel 3
Badge

Naveen,

Sorry I didn’t explain that I do have the workflow steps also included in this. Which I think is correct but I believe the code is where I’m running into issues. 

 

I’ve attached my customization package

 

Thanks,
Justin

Userlevel 7
Badge +17

Hi @jcox43  I have reviewed the above shared package but in the package below highlighted field is not available. Can you please share the right package?

 

Userlevel 3
Badge

The field I’m attempting to “unlock” is not contained in the same package.

There is a large customization package that includes the ISPSUCC128 custom field.

 

I’ve attached both packages, the “EDI” package contains all of the custom fields and much more. The “JCUCC128” is the package I’m attempting to use to “unlock” that specific field when the shipment is in the confirmed status.

 

Thanks,
Justin

Userlevel 7
Badge +17

Hi Justine, I’m not able to deploy either of the packages.

I created a new sample package and enabled the TRACKING NBR field when the shipment is in COMPLETED status.

You can change the field name and check once. I have attached the package.

 

Screenshot for reference.

 

 

Userlevel 3
Badge

Naveen,

This looks to be getting real close, I had to merge the code with another package that contained “SOShipmentEntry”. But there is something in the code that unlocks the entire row instead of specific fields and also for every status instead of just confirmed.

 

I disabled all other customization packages and used the one you provided and it seems to do the same thing.

 

Thanks,
Justin

Userlevel 7
Badge +17

@jcox43  If you have included the necessary fields in the package, I am able to assist you in making modifications and returning the package to you.

Userlevel 3
Badge

Naveen, 

 

Thanks for you help on this, I think I’m okay with how this is working right now. (The requirement for this is only temporary).

 

Again thanks for helping me out!

Userlevel 3
Badge

Naveen,

 

We just recently upgraded to 2023 R2 so I had to update this package to get it to validate. I didn’t like the line -   PXUIFieldAttribute.SetEnabled<SOPackageDetailEx.ISPSUCC128>(cache, row, true);

 

It was telling me that field didn’t exist.. but it said the same thing when I changed the field to “TrackNumber”. But anyways I removed that line and was able to get it published. However now when making a change it tells me the save button is disabled, but I can click the save button a second time and it works correctly.

 

Am I missing something here?

 

Thanks

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