• Sander de Jong (1966)
  • NEWBIE
  • 0 Points
  • Member since 2019
  • Senior Software Engineer
  • Heuver Tyrewholesale


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 1
    Questions
  • 3
    Replies
Since a couple of weeks, some of my users have a problem with a custom Javascript button in Classic. They get the error message "Unable to set property 'innerHTML' of undefined or null reference". No line number is reported.

The error does not always occur, and after trying two or three times the button does what it is supposed to do, no error message. The used browser is Chrome. I cannot reproduce this message, I clicked dozens of times and for me, the button always works.

This is the code:
 
{!REQUIRESCRIPT("/soap/ajax/37.0/connection.js")} {!REQUIRESCRIPT("/soap/ajax/37.0/apex.js")} var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay']; try{ var verkoopGroep = "{!Quote.Account_verkoopgroep__c}"; if(verkoopGroep.indexOf("F0") == 0) { pdfOverlay.summlid = '0EH580000003OAC'; } else { var taal = "{!Quote.Account_taal__c}"; switch(taal){ case 'Nederlands': pdfOverlay.summlid = '0EH58000000GcPS';break; case 'Engels': pdfOverlay.summlid = '0EH58000000GjHG';break; case 'Duits': pdfOverlay.summlid = '0EH58000000Gg9F';break; case 'Spaans': pdfOverlay.summlid = '0EH5800000085ZN';break; case 'Roemeens': pdfOverlay.summlid = '0EH5800000085ZS';break; case 'Frans': pdfOverlay.summlid = '0EH5800000085ZX';break; case 'Pools': pdfOverlay.summlid = '0EH5800000085Zh';break; case 'Italiaans': pdfOverlay.summlid = '0EH5800000085Zc';break; default:pdfOverlay.summlid = '0EH58000000GjHG';break; } } } catch(e){ alert('Er is een fout opgetreden: '+e); pdfOverlay.summlid = '0EH58000000GcPS'; }; pdfOverlay.dialog.buttonContents = '<input value=\"{!$Label.Opslaan_naar_offerte}\" class=\"btn\" name=\"save\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'0\',\'0\');\" title=\"Opslaan naar offerte\" type=\"button\" /><input value=\"{!$Label.Offerte_opslaan_en_per_e_mail_verzenden}\" class=\"btn\" name=\"saveAndEmail\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');\" title=\"Offerte opslaan en per e-mail verzenden\" type=\"button\" /><input value=\"{!$Label.Annuleren}\" class=\"btn\" name=\"cancel\" onclick=\"QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\" title=\"Annuleren\" type=\"button\" />'; pdfOverlay.setSavable(true); pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id={!Quote.Id}','/quote/quoteTemplateHeaderData.apexp?id={!Quote.Id}'); pdfOverlay.display();

It creates a PDF for a quote and displays it. This code has worked properly for the past 3 years, but all of a sudden some of my users have problems with it.

Note that 'innerHTML' does not occur in the Javascript, so the problem occurs in the QuotePDFPreview library?
Hello,

Can some one let me how to disable clip and wrap text possibility in lighnting:datatable

Thanks
Is there a way to stop the drop down that give and option to wrap or clip text in a lightning data table?

User-added image
Hello,

Can some one let me how to disable clip and wrap text possibility in lighnting:datatable

Thanks
Is there a way to stop the drop down that give and option to wrap or clip text in a lightning data table?

User-added image
Hi there,

A query:
select id, sobjecttype from objectterritory2association
returns records that have sObjectType of 'Account'.

But when I try to filter by it, it doesn't return any row:
select id, sobjecttype from objectterritory2association where sobjecttype = 'Account'
According to documentation, only the value 'Account' is suported, but why this can't be filtered?
https://developer.salesforce.com/docs/atlas.en-us.object_reference.meta/object_reference/sforce_api_objects_objectterritory2association.htm?search_text=objectterritory2association says it should be filterable.

https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_erd_territory2.htm doesn't even list the file sObjectType.
A possible flaw in the documentation maybe?

Anyway, this seems to work though:
select id, sobjecttype, object.type from objectterritory2association where object.type = 'Account'

Can someone from the support explain the behavior?

Thank you
Petr Svestka