Ibrahim Ali
04/29/2025, 6:19 PMCeligo AI
04/29/2025, 6:19 PMAI generated answer (using internal Slack threads):Based on the conversations, it seems that the best way to lock the PO Issuer field after the Purchase Order has been created is by using a workflow. You can create a workflow that triggers after record submit when the Purchase Order is created. In this workflow, you can add a state with an action that sets the field 'PO Issuer' to read-only. This will prevent the field from being edited after the Purchase Order has been created. Here is a sample code snippet that you can use as a reference:
javascript
var workflow = nlapiCreateRecord('workflow');
workflow.setFieldValue('name', 'Lock PO Issuer');
workflow.setFieldValue('recordtype', 'purchaseorder');
var state = workflow.createSubrecord('workflowstates');
state.setFieldValue('statedefinition', 'Start');
var action = state.createSubrecord('workflowactions');
action.setFieldValue('actiontype', 'fieldchange');
action.setFieldValue('field', 'custbody_po_issuer');
action.setFieldValue('attribute', 'readonly');
action.setFieldValue('value', 'T');
nlapiSubmitRecord(workflow);
Please replace 'custbody_po_issuer' with the actual internal id of your 'PO Issuer' field.
******
Disclaimer:
This response was generated by an artificial intelligence assistant based on previous conversations from multiple Slack channels, and may contain inaccuracies or mistakes.
******Celigo AI
04/29/2025, 6:19 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.819579244
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.81761539
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.815349042
Celigo AI
04/29/2025, 6:19 PM