UD Fields Read Only and uneditable on PO Entry after approved

Hello,

I know similar has been discussed on other Entry screens but…

On the PO Entry screen (POHeader) I have added a couple of UD fields, when the PO is approved the fields become ReadOnly and uneditable

I have managed to make them “Enabled” so I can tick the checkbox, but when I save, it errors out and says “This field cannot be updated because the PO is approved”

Does anyone know how to successfully overcome the Epi(not so)magic logic

One way to address is to add a UD table as a child using the customization wizard, then add the UDFs to the UD table. The wizard will create the data view to bind the UI controls. This way, the records are related but the fields don’t follow the same rules.
I’ve used this approach with other tables that have rules about the editablity based on state(order, job, …)

1 Like

Thank you for the reply, I was sort of hoping that this wouldn’t be the answer…

Np, it’s really not that bad and can usually be done with the wizard alone.
Let me know if you hit any issues.

The other option is much worse…

Ok, I got it sorted, I ended up doing a BO Adapter for a UD table, the customization sends enough info from the PO Entry across to the UD table to … print a PO and attach it to an HTML email and attach any attachments from the PO entry screen and send it

I was trying to use a UD field on the PO Header to trigger it but the BO Adapter does that now

Hello @adaniell ,

I’ve been playing with this again because I need to add more fields that can be edited after approval, I have used the wizard to add UD39 as a child table, I was wondering if there is a way to use hardcoded text to fill one of the Key fields on the UD table, i.e Key2 = “POHeader”??

Hello,

Yes, you could definitely do this. Use the wizard to create all the boiler plate code and then hard code the one key in the following methods that will be generated by the wizard:

  • GetUD39Data – Hard code key2 value in the where clause that is passed to InvokeSearch.
// Build where clause for search.
			string whereClause = "Key1 = \'" + key1 + "\' And Key2 = \'POHeader\' And Key3 = \'" + key3 + "\' And Key4 = \'" + key4 + "\'";
			System.Collections.Hashtable whereClauses = new System.Collections.Hashtable(1);
			whereClauses.Add("UD39", whereClause);

			// Call the adapter search.
			SearchOptions searchOptions = SearchOptions.CreateRuntimeSearch(whereClauses, DataSetMode.RowsDataSet);
			this._ud39Adapter.InvokeSearch(searchOptions);
  • GetNewUD39Record – Hard code the value for key2 in the newly created record.
editRow["Key2"] = "POHeader";
1 Like

Thank you!!