Marty Zigman

Conversations with Marty Zigman

Certified Administrator • ERP • SuiteCloud

NetSuite SuiteScript 2.0 Mass Update for Updating Customer Deposit

NetSuite Technical



Sometimes having a quick code template can make learning easier. In this case, NetSuite’s customer deposit record cannot be updated via CSV uploads. Thus, we may need to use mass update technology to do so.

SuiteScript 2.0 Mass Update Code Snippet

Here is a simple code snippet to help you update customer deposit records using NetSuite SuiteScript 2.0.

/**
* @NApiVersion 2.x
* @NScriptType MassUpdateScript
*
*/

/*
* 
* Read records from the Customer Deposit and sets the payment method
* 
*/

define(['N/record'],
	function(record) {

		function each(params) {
	
			var funcName = "mts_MU_customer_deposit_paymethod" + params.type + " " + params.id;
			
			var PAYMENT_METHOD_CASH = 11;
			
			try {
				
				var CDEP = record.load({type: params.type, id: params.id});
				CDEP.setValue("paymentmethod",PAYMENT_METHOD_CASH);

				var id = CDEP.save();
				
				log.audit(funcName, "Record Processed.  Customer Deposit updated: " + id);
				
			} catch (e) {
				log.error(funcName, e);	
	    	}
		}
	
		return {
			each: each
		};
	}
);

See other Customer Deposit Scripts and Get Help

I have written about other Customer Deposit scripts. These may be helpful to you:

  1. Learn the NetSuite SuiteScript 2.0 Pattern to Apply Customer Deposits to Invoices
  2. Use NetSuite SuiteScript to Automate Posting Customer Deposits to Invoices

If you need help developing SuiteScript programs for your NetSuite account, let’s have a conversation.

Marty Zigman LinkedIn

Marty Zigman

Holding three official certifications, Marty is widely recognized as a top NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. A former Deloitte & Touche CPA and technology executive with CTO roles, he brings over 35 years of leadership in ERP, CRM, and eCommerce business systems. Contact Marty to engage directly.

BiographyYouTubeLinkedInX (Twitter)

Leave a Reply

Your email address will not be published. Required fields are marked *