NetSuite SuiteScript 2.0 Mass Update for Updating Customer Deposit

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.

Be Sociable, Share!

Marty Zigman

Holding all three official certifications, Marty is Southern California's NetSuite expert and leads a team of senior professionals at Prolecto Resources, Inc. He is a former Deloitte & Touche CPA and has held CTO roles. For over 25 years, Marty has produced leadership in ERP, CRM and eCommerce business systems. Contact Marty to setup a conversation.

More Posts - Website - Twitter - Facebook - LinkedIn - Google Plus - YouTube

| Category: NetSuite, Technical | Leave a comment

Post a Comment

Your email is never published nor shared. Required fields are marked *

*
*

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>