Skip to main content
Solved

How to make a field active after an Invoice is released


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?
 

 

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

 


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


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.


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,


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.
 

 


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.


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.


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.
 

 


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


Hi @Harry ,

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

 


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,


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.


Reply