Skip to main content
Answer

How to make a field active after an Invoice is released

  • July 30, 2024
  • 12 replies
  • 270 views

Forum|alt.badge.img

Hello all,

I would like to know how can I make the field remain active till the Invoice Status = Open. I have extended the Default workflow, but not able to find the value where I can mark the required field as Active in Open. How to do this?
 

 

Best answer by Vignesh Ponnusamy

Hi @Harry @Dipak Nilkanth 

From my testing, I think it could be a bug and would need further testing. I would recommend you create a support request with the steps to reproduce the issue. Thanks,

12 replies

DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi @Harry,

If I am not wrong , you want to enable the field till the Invoice status converted to the Open(till releasing the invoice). So you can add your field for next statuses closed, canceled, reserved ,voided, rejected and set the Disabled check box for the field to true.

Disable the field on Rejected Status

 


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • July 30, 2024

Hello @Dipak Nilkanth ,
thank you for your prompt response. So the thing is I am looking to make the field active till the Invoice (AR301000) Status = Open and not after that. So I modified the workflow:
 


And then added the below code:
 

Still the field remains inactive in Open status


DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi @Harry ,

Could you please try something like this?
 

protected void ARInvoice_RowSelected(PXCache cache, PXRowSelectedEventArgs e)
{
var row = (ARInvoice)e.Row;
if (row == null) return;
bool isInvoiceOpen = row.Status == ARDocStatus.Open;
ARRegisterExt invoiceExt = PXCache<ARRegister>.GetExtension<ARRegisterExt>(row);
PXUIFieldAttribute.SetEnabled<ARRegisterExt.Date>(cache, row, isInvoiceOpen);
}

Note: I Assume you are using custom field(Date) because as your code access Date field from ARRegisterExt.


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi @Harry,

Adding to @Dipak Nilkanth comment, if you are trying to enable Date(ARInvoice.DocDate) field, then try like below,

PXUIFieldAttribute.SetEnabled<ARInvoice.docDate>(cache, row, true);

Good Luck,


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • July 30, 2024

Hi @Harry,

Adding to @Dipak Nilkanth comment, if you are trying to enable Date(ARInvoice.DocDate) field, then try like below,

PXUIFieldAttribute.SetEnabled<ARInvoice.docDate>(cache, row, true);

Good Luck,

Also, I am looking to make the field enabled irrespective of the status on the grid level. How can I get this done too.
So I am looking to make the Transaction Description (ARTran.TranDesc) to remain active irrespective of the status.
 

 


DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi @Harry ,

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

This blog helps you to make field enable by modifying workflow.


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • July 31, 2024

Hi @Harry ,

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

This blog helps you to make field enable by modifying workflow.

I already tried this, but not able to get it done.


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • July 31, 2024

Hi @Harry ,

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

This blog helps you to make field enable by modifying workflow.

So I made the changes in the code as per the blog. i made changes in the workflow. But when my invoice goes to closed status then the field becomes non editable.
 

 


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • July 31, 2024

Also,
@Dipak Nilkanth , the above code not only makes the custom field editable, but it converts all the fields in the grids editable.


DipakNilkanth
Pro III
Forum|alt.badge.img+13

Hi @Harry ,

Could you please go through This link, they have similar requirement on another screen and got resolved. 

 


Vignesh Ponnusamy
Acumatica Moderator
Forum|alt.badge.img+5

Hi @Harry @Dipak Nilkanth 

From my testing, I think it could be a bug and would need further testing. I would recommend you create a support request with the steps to reproduce the issue. Thanks,


Forum|alt.badge.img
  • Author
  • Semi-Pro II
  • August 2, 2024

hello all,
I followed the steps, but now except for the field that I had applied the code to make it active → the rest of the fields are now inactive.