the Error Msg Coming from PO table

MAK9666
Tera Contributor

MAK9666_0-1786097151860.png

i had all the ACLs, Business rules, Client scripts and Ui Policies but i don't where this error coming. the error coming on this table proc_po

2 REPLIES 2

Dr Atul G- LNG
Tera Patron

Could you please add a larger screenshot? The current one is not clearly visible.

*************************************************************************************************************
Regards
Dr. Atul G. - Learn N Grow Together
ServiceNow Techno - Functional Trainer
LinkedIn: https://www.linkedin.com/in/dratulgrover
YouTube: https://www.youtube.com/@LearnNGrowTogetherwithAtulG

****************************************************************************************************************

Abhishek Pal
Mega Guru

Hi @MAK9666 ,

This warning is not coming from an ACL, Business Rule, Client Script, or UI Policy.

The message:

UI updates to the following strict read-only fields were ignored: total_cost

is generated by the ServiceNow platform read-only enforcement framework.

For Purchase Order [proc_po], Total cost [total_cost] is an OOB Strict Read Only field.

Because of that, ServiceNow rejects any attempt from the UI, client script, API, or normal server-side update to manually change this field.

So you should not change the dictionary configuration or create another Business Rule to bypass it.

The Total cost on a Purchase Order is calculated by the OOB Procurement logic from the Purchase Order line items and shipping cost.

Recommended approach:

1. Open:

System Definition > Dictionary

2. Search for:

Table: proc_po
Column: total_cost

You should see that Total cost is configured as read-only/Strict Read Only.

3. Search your customizations for:

total_cost

Especially check for code such as:

g_form.setValue('total_cost', ...);

current.total_cost = ...;

poGR.setValue('total_cost', ...);

Also check:

- Client Scripts
- UI Actions
- Workspace client scripts
- Flows/Subflows
- Integrations
- Data imports
- Custom Script Includes

4. Remove any custom logic that directly updates proc_po.total_cost.

Instead, update the appropriate source values:

Purchase Order Line Item [proc_po_item]
- Cost
- Ordered quantity

Purchase Order [proc_po]
- Shipping / Ship rate where applicable

Allow the OOB Procurement logic to recalculate Total cost.

For example, the expected design is:

PO Line Item Cost
+
PO Line Item Quantity
+
Shipping Cost
-> OOB calculation
-> proc_po.total_cost

Do not change Total cost directly.

Also note that ServiceNow has an OOB Business Rule named:

Shipping Cost Changes

on Purchase Order, which recalculates the purchase order total when the shipping rate changes.

There is also OOB calculation logic on Purchase Order Line Item for calculating the line-item total.

If you have removed all custom attempts to update total_cost and this warning still occurs while using a completely OOB Purchase Order form, reproduce it in a sub-production instance with the same release/ITAM application version. If it also occurs OOB, raise a Now Support case because the field itself is intentionally protected.

I would not change the Read only option from Strict Read Only simply to suppress this warning. ServiceNow explicitly lists proc_po.total_cost as a strict read-only Asset Management field.

Official references:

https://www.servicenow.com/docs/r/it-asset-management/asset-management/read-only-fields-am.html

https://www.servicenow.com/docs/r/it-service-management/procurement/t_CreateAPurchaseOrder.html

https://www.servicenow.com/docs/r/platform-administration/table-administration-and-data-management/r...

So the root cause is:

Something is attempting to update proc_po.total_cost
-> total_cost is OOB Strict Read Only
-> ServiceNow ignores the update
-> readonly_enforcement_violation warning is logged

Hope this helps!

If this response helped, please mark it as Helpful.
If it resolves your issue, please Accept it as Solution.

Kind Regards,
Abhishek Pal