This topic contains 2 replies, has 0 voices, and was last updated by chanarbon 7 years, 11 months ago.
-
AuthorPosts
-
December 1, 2016 at 12:21 pm #5695
dmashburn3Hi,
I’m playing around with my first attempt at incorporating google maps. I’ve created a suitelet that I’ve verified as working by calling directly from the address bar, however, upon the load of the record, I can’t seem to get it to work. Here is my code:
Code:
function googleMapForm(type, form)
{
if ( type == ‘view’ || type == ‘edit’ )
{
/* Add Google Map tab to page. */
var tab = form.addTab( ‘custpage_googlemap_tab’, ‘Google Map’ )
form.insertTab( tab, ‘general’ )
nlapiLogExecution(‘debug’,’Test 1′, ‘Success’);
var map = form.addField(‘custpage_googlemap’, ‘inlinehtml’, null, null, ‘custpage_googlemap_tab’)
nlapiLogExecution(‘debug’,’Test 2′,’Success’);
/* Generate URL for Suitelet, include internalid of the current customer. */
var serverUrl = nlapiResolveURL( ‘SUITELET’, ‘customscript_google’, ‘customdeploy_google’ ) + ‘&truckloadid=’+nlapiGetRecordId();
nlapiLogExecution(‘debug’,’Details’,’serverUrl = ‘+serverUrl)
/* Output IFRAME container for Google map page. */
map.setDefaultValue( ‘‘ )
nlapiLogExecution(‘debug’,’Test 3′, ‘Success’);
}
}
I get all 3 test executions successful, however it can’t seem to load the record or much less call the suitelet for some reason.Any thoughts?
Thanks
This is a cached copy. Click here to see the original post. -
December 1, 2016 at 12:54 pm #5696
david.smithWhy are you setting this as an iframe?
If I were debugging this I would start with putting “hello world” in my default inlinehtml field to make sure that’s working. Then I think I would have my suitelet return the HTML and just populate that instead of an iFrame.
-
December 1, 2016 at 8:12 pm #5697
chanarbonAgreeing with david.smith, I would rather get the Suitelet return a rendered HTML string value passed from request.write() which you can retrieve from nlapiRequestURL() then use an inline HTML field populated for you to show the Google maps
-
AuthorPosts
You must be logged in to reply to this topic.