This topic contains 2 replies, has 0 voices, and was last updated by chanarbon 7 years, 9 months ago.

  • Author
    Posts
  • #5695 Score: 0

    dmashburn3
    • Contributions: 0
    • Level 1

    Hi,

    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.

  • #5696 Score: 0

    david.smith
    • Contributions: 0
    • Level 1

    Why 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.

  • #5697 Score: 0

    chanarbon
    • Contributions: 0
    • Level 1

    Agreeing 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

You must be logged in to reply to this topic.