Aly
12/05/2024, 6:48 PMCeligo AI
12/05/2024, 6:49 PMAI generated answer (using internal Slack threads):Yes, it is possible to set the line level department on journals as mandatory or not mandatory depending on the journal entry form selected. This can be achieved by using a User Event Script in SuiteScript. Here is a sample code snippet that was shared in one of the conversations:
javascript
function userEventBeforeLoad_mandatory(type, form, request){
var sublistobj = nlapiGetSubList('line');
var memofield = sublistobj.getField('memo');
memofield.setMandatory(true);
}
In this example, the 'memo' field is set as mandatory. You would need to replace 'memo' with the internal id of the department field. Also, you would need to deploy this script on the Journal Entry record type.
Please note that this script uses SuiteScript 1.0 API. If you are using SuiteScript 2.0, you would need to adjust the syntax accordingly.
******
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
12/05/2024, 6:49 PMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.865894258
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.86130482
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.854946
Celigo AI
12/05/2024, 6:49 PMCeligo AI
12/05/2024, 6:50 PM