Hagar Ahmed
08/19/2024, 7:14 AMCeligo AI
08/19/2024, 7:14 AMAI generated answer (using internal Slack threads):To make the checkbox "Mark Sub-Assemblies Phantom" on work order run only on assemblies with no quantities, you would need to create a SuiteScript that checks the quantity of the assembly before marking it as phantom. Here is a general idea of how you could approach this: 1. Use a search to find all assembly items. 2. For each assembly item, check if the quantity is zero. 3. If the quantity is zero, update the assembly item to mark the sub-assemblies as phantom. Here is a pseudo-code example:
javascript
var assemblySearch = search.create({
type: search.Type.ASSEMBLY_ITEM,
filters: [],
columns: ['internalid', 'quantityonhand']
});
assemblySearch.run().each(function(result){
var quantity = result.getValue('quantityonhand');
if(quantity == 0){
var assemblyId = result.getValue('internalid');
var assemblyRecord = record.load({
type: record.Type.ASSEMBLY_ITEM,
id: assemblyId
});
assemblyRecord.setValue('custitem_mark_sub_assemblies_phantom', true);
assemblyRecord.save();
}
return true;
});
Please note that this is a simplified example and may not cover all edge cases. You would need to adjust this to fit your specific needs and thoroughly test it before deploying.
******
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
08/19/2024, 7:14 AMSlack thread 1: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.81053853
Slack thread 2: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.795340836
Slack thread 3: here (available only if the original thread was posted in the last 90 days)
Similarity score: 0.791804254
Celigo AI
08/19/2024, 7:14 AM