Hey Guys,
We have set up some integration between Netsuite and our inhouse customer portal.
When a new customer registers online, the details are passed though to Netsuite using the Suitelet.
All of this works perfectly, except that when i enter the address details for the customer, the addrtext box is not populated even though I have set the dosourcing to true on the record submittion.
Any idea why? Alternatively, i can create the HTML to populate this box but I am passed the country code (ie GB) and need to do a lookup on the country name so that i save it as United Kingdon (GB) instead of just GB?
Below is the extract of code that handles this
//Pulls the parameters from the XML sent from the MS var leadid = request.getParameter('leadid') var oppid = request.getParameter('oppid') var companyname = request.getParameter('companyname') var custvatid = request.getParameter('custvatid') var sector = request.getParameter('sector') var maindomain = request.getParameter('maindomain') var addr1 = request.getParameter('addr1') var addr2 = request.getParameter('addr2') var city = request.getParameter('city') var county = request.getParameter('county') var country = request.getParameter('country') var postcode = request.getParameter('postcode') var currency = request.getParameter('currency') //Updates the lead to a prospect and adds the additional information var lead = nlapiLoadRecord('customer',leadid) lead.setFieldValue('companyname',companyname) lead.setFieldValue('vatregnumber',custvatid) lead.setFieldValue('entitystatus',20)//Online Registration lead.setFieldValue('custentitysector',sector) lead.setFieldValue('custentitymaindomain',maindomain) //Sets the bill to and ship to address lead.setLineItemValue('addressbook','defaultbilling',1,'T') lead.setLineItemValue('addressbook','defaultshipping',1,'T') lead.setLineItemValue('addressbook','label',1,companyname) lead.setLineItemValue('addressbook','addressee',1,companyname) lead.setLineItemValue('addressbook','addr1',1,addr1) lead.setLineItemValue('addressbook','addr2',1,addr2) lead.setLineItemValue('addressbook','city',1,city) lead.setLineItemValue('addressbook','state',1,county) lead.setLineItemValue('addressbook','zip',1,postcode) lead.setLineItemValue('addressbook','country',1,country) nlapiSubmitRecord(lead,true,true)