• Jason Sparks
  • NEWBIE
  • 0 Points
  • Member since 2022

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 2
    Replies
I am quite new to Force.com development, and I am struggling with an issue that I thought would be quite simple.  I have a custom VisualForce page, and I want the help text bubble icon and text to be displayed on my page, but I cannot figure out how to do that. I have read the posts on this forum for that same question and have implemented what I think is the correct approach, but it still shows nothing.  My VF code is like this:

<apex:pageBlockSectionItem HelpText="{!$ObjectType.BNTE_Build_Note__c.Fields.Work_Order_ID__c.InlineHelpText}"> 
                    <apex:outputLabel value="{!$ObjectType.BNTE_Build_Note__c.fields.Work_Order_ID__c.label}"/>
                    <apex:inputField value="{!BNTE_Build_Note__c.Work_Order_Id__c}"/> 
                 </apex:pageBlockSectionItem>

My page is set to ShowHeader = "true".

Could anybody suggest what I could try to get this to work?
Does anyone know why our Javascript code works only on the 2nd to nth try in SFDC, but on 1st attempt in stand-alone HTML?

We are creating "button" that executes Javascript to copy certain contents of a Case into the clipboard. The same result is seen under Chrome, IE, Safari, and Firefox.

The problem code we're attaching to the button is below.  Works 2nd to nth try:
{!REQUIRESCRIPT("/soap/ajax/38.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/38.0/apex.js")}

console.log('browser supports copy?: ' + document.queryCommandSupported("copy"));

var text = 'Ticket #: {!Case.Id}\n';

//window.prompt("Copy to clipboard: Ctrl+C, Enter", text);

var tempInput = document.createElement("textarea");
tempInput.setAttribute('id', 'copyid');
tempInput.value = text;
document.body.appendChild(tempInput);

i = document.getElementById('copyid');
i.select();

try {
    var result = document.execCommand("Copy");

    // clicking button this JS is embedded in first time results in a FALSE
    // clicking button this JS is embedded in second to nth time results in a TRUE
    console.log('execcommand copy result: ' + result);
}
catch (e) {
    console.log('Copy exception: ' + e);
}


And here is the same code in a standalone HTML which works 1st to nth click:
<script>

function doit() {

    console.log ('browser supports copy?: ' + document.queryCommandSupported("copy"));

    var text = 'blah blah';
    var tempInput = document.createElement("textarea");
    tempInput.setAttribute('id', 'copyid');
    tempInput.value = text;
    document.body.appendChild(tempInput);
    document.getElementById('copyid').select();

    try {
        var result = document.execCommand("copy", false, null);
        // clicking button this JS is embedded in first time results in a FALSE
        // clicking button this JS is embedded in second to nth time results in a TRUE
        console.log('execcommand copy result: ' + result);
    }
    catch (e) {
        console.log('Copy exception: ' + e);
    }

    document.body.removeChild(tempInput);

</script>

<input type="button" value="copy text" onClick="doit()">