Hi Guys!, Can someone confirm if you're able to hi...
# suitescript
j
Hi Guys!, Can someone confirm if you're able to hide the "Mark Packed" or "Mark Shipped" button on Item fulfillment module?
m
Should be able to, I've done similar on Sales Order hiding the request fulfillment
Copy code
if (record.getValue('custbody12') == true) {
                    var form = context.form;
                    form.removeButton({
                        id: 'requestfulfillment',
                    });
                }
Just need to find the id those buttons
markpacked is the id of the button.
In case you need to turn off pick pack ship, You can have a look at https://system.netsuite.com/app/help/helpcenter.nl?fid=section_N1230197.html
j
I do have a condition on the line item of the item fulfillment, and if it doesnt meet the condition, the Mark Shipped should be hidden from the user.
Copy code
/**
 * Module Description
 * 
 * Version    Date            Author           Remarks
 * 1.00       13 Apr 2021     JM Tangile
 *
 */

/**
 * The recordType (internal id) corresponds to the "Applied To" record in your script deployment. 
 * @appliedtorecord recordType
 *   
 * @param {String} type Operation types: create, edit, view, copy, print, email
 * @param {nlobjForm} form Current form
 * @param {nlobjRequest} request Request object
 * @returns {Void}
 */
function userEventBeforeLoad(type, form, request){
	try{
		var ctx = nlapiGetContext();
		var exec_context = ctx.getExecutionContext();
		var rec = nlapiGetNewRecord();
		var rec_type = nlapiGetRecordType();
		if(rec_type == 'itemfulfillment'){
			var if_status = rec.getFieldValue('shipstatus');
			var order_type = rec.getFieldValue('ordertype');
			nlapiLogExecution('DEBUG',type+exec_context+rec_type+if_status+order_type);
			if(type == 'view' && exec_context == 'userinterface' && if_status == 'B' && order_type == 'SalesOrd'){
				form.removeButton('markepacked');
			}
		}
	}
	catch(e){
		nlapiLogExecution('DEBUG', 'ERROR ON beforeLoad', e.name+' : '+e.message);
	}
}
I'm always using the form.removeButton when hiding buttons.
but this time it doesnt work on the mark shipped button on IF module
b
dont expect Button IDs not on the list to support suitescript
expect to do dom manipulations to hide it
j
got it. thanks!
m
Have you checked if button is available to hide via workflow?
@tuli I was referring to sublist buttons there
🆗 1