Convert a NetSuite Lead to a Vendor

This article is relevant if you are working with NetSuite CRM and instead of converting leads to customers, you want to convert them to vendors.

Backgroud

One of the great things about NetSuite is that an entity can be many things at the same time.  Many NetSuite users are not aware that they can turn a Customer into a Vendor or Partner using the Other Relationships  function.  The power of this feature is that you can create invoices to customers and you can send checks to them as vendors.

We have clients that work in brokering businesses.  They match their customers to their suppliers to make markets.  Their lead generation work may bring them new customers or new suppliers (vendors).  In their CRM work, using different inbound techniques, they appropriately capture information suggesting a new lead is a customer or it is vendor.

NetSuite’s default “Convert Lead” function will change a lead into a prospect record. ¬†A prospect record is effectively a customer record with a status this is not won. ¬† ¬†There is no out-of-the-box mechanism to instead convert a NetSuite lead to a vendor.

Solving the Convert to NetSuite Lead to Vendor Challenge

The key to solve this problem is to understand that NetSuite provides a way convert customers to  vendors.  This is done via a client side link that calls a NetSuite server side function.  By appropriately calling the right URL with key information, we can convert the customer to a vendor.   Below is the client side code to do this:

function Convert_Lead_To_Vendor() {
    var recid = nlapiGetRecordId();

	//only act if we get a record ID
    if (!recid) return;

	//ask the user if they really want to do this
	if (!confirm("Are you sure you want to convert this lead to a vendor?"))return;

    // hitting this url will add the entity as a vendor
    var url = '/app/common/entity/company.nl?e=T&target=s_relation:otherrelationships&label=Other+Relationships&fromtype=custjob&id=' + recid + '&totype=vendor';
    nlapiRequestURL(url);

    // now try to load the vendor record to confirm we did the work
    var worked = false;
    try{
        nlapiLoadRecord('vendor', recid);
        worked = true;
    }catch(e){
        worked = false;
    }

	//if it worked, redirect the user to the entity vendor view
    if (worked){
        var url = nlapiResolveURL('RECORD', 'lead', recid) + '&custparam_flag_lead='+CONST_CUSTSTATUS_APPROVED + '&custparam_next_entity=vendor';
        document.location = url;
        return;
    }
}

Take Control over NetSuite

Remember, NetSuite is a platform designed to give you control over your business functions. If you are looking to get more out of your NetSuite investment by being creative to drive innovation and hence more value, 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

| Tags: , , , | Category: CRM, NetSuite | 2 Comments

2 Comments

  1. Robert
    Posted October 7, 2015 at 12:19 pm | Permalink

    How are you implementing this code? Here is an scenario of what I am trying to accomplish. I will have a website that a user will fill out a questionnaire. The questions and answers will be attached to a NetSuite Lead via RESTlet and asp page. From the questions the company will decided if the lead is eligible to move forward. If they move forward the lead will need to be converted to a Vendor. Also the questions the lead answered will be carried over also.

  2. Posted October 9, 2015 at 5:49 am | Permalink

    Hi Robert,

    Indeed, this works. The key to this function is that it is client side. Your workflow is all server side so the best I can offer is to figure out how to get the users to work the records client side as some part of their manual review flow.

    Marty

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>