• Naruto
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 1
    Questions
  • 3
    Replies
I want to provide hyperlink in the apex email body without displaying the url and html tag
message.subject = 'some subject';
emailBody += '<html><a href="'+URL.getSalesforceBaseUrl().toExternalForm()+'/'+someid+'">'+displayname+'</a></html>';

from the above code, I am able to get an email with hyperlink but the hyperlink is not only applied to the 'displayname'. The email body even has the html tag and the complete URL in the hyperlink.
How to provide the hyperlink only to displayname and hide the URL
  • March 31, 2019
  • Like
  • 0
I want to provide hyperlink in the apex email body without displaying the url and html tag
message.subject = 'some subject';
emailBody += '<html><a href="'+URL.getSalesforceBaseUrl().toExternalForm()+'/'+someid+'">'+displayname+'</a></html>';

from the above code, I am able to get an email with hyperlink but the hyperlink is not only applied to the 'displayname'. The email body even has the html tag and the complete URL in the hyperlink.
How to provide the hyperlink only to displayname and hide the URL
  • March 31, 2019
  • Like
  • 0
Hi,

When I am trying to convert a array of task into JSON string in my lightning controller, only the 1st element is returned always even though the array has more values. Here is the code. Has anyone faced the same issue.

Component:
<aura:attribute type="Task[]" name="listTask" />

Controller:
var taskList = component.get("v.listTask"); //tried var taskList = component.get("v.listTask").slice(); as well
console.log(taskList.length); //Length is returned correctly e.g. 3

//converting the array into JSON string
var JSONStr = JSON.stringify(taskList); 
console.log(JSONStr); // [{"sobjectType":"Task","ActivityDate":"2016-3-3","Status":"In Progress","Subject":"task1"},[],[]]
Hi,
I have 2 multiselect picklist component in a visualforce page and when the user modifies the first multiselect picklist I want to change the value from the second multiselect picklist. I want to make a dependency between those 2 picklist multiselect, but my code doesn't work...

Here is my code:
<apex:page standardStylesheets="true" controller="NewAccountAPVController2"  tabStyle="Account">
  <apex:param id="accountID" name="accountID" value=""/>
  <apex:pageMessages />
  <apex:form >
      <script type="text/javascript">  
          function navigate(){ 
              searchServer();  
          }
      </script>
      <apex:actionFunction name="searchServer" action="{!RefreshMultiSelect}" rerender="results"> </apex:actionFunction>
      <apex:pageBlock title="New Account">
          <apex:pageBlockButtons >
              <apex:commandButton action="{!cancel}" value="Cancel" styleClass="btn"/>
              <apex:commandButton action="{!savePage21}" value="Save" styleClass="btn"/>
          </apex:pageBlockButtons>
          <apex:pageBlockSection title="Subcategorie" columns="1">
              <c:MultiselectPicklist leftLabel="Subcategorii" 
                leftOptions="{!subcategory}"
                rightLabel="Subcategorii selectate"
                rightOptions="{!selectedSubcategory}"
                size="15"
                width="300px" onchange="navigate();"
              />
           </apex:pageBlockSection>
         <apex:pageBlockSection title="Subsubcategorie">
            <c:MultiselectPicklist leftLabel="Subsubcategorii" 
                 leftOptions="{!subsubcategory}"
                 rightLabel="Subsubcategorii selectate"
                 rightOptions="{!selectedSubSubCategory}"
                 size="15"
                 width="300px"
                 id="results"
            />  
        </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>

Can anyone help me? 
Hi,

When I am trying to convert a array of task into JSON string in my lightning controller, only the 1st element is returned always even though the array has more values. Here is the code. Has anyone faced the same issue.

Component:
<aura:attribute type="Task[]" name="listTask" />

Controller:
var taskList = component.get("v.listTask"); //tried var taskList = component.get("v.listTask").slice(); as well
console.log(taskList.length); //Length is returned correctly e.g. 3

//converting the array into JSON string
var JSONStr = JSON.stringify(taskList); 
console.log(JSONStr); // [{"sobjectType":"Task","ActivityDate":"2016-3-3","Status":"In Progress","Subject":"task1"},[],[]]
Hi,
I have 2 multiselect picklist component in a visualforce page and when the user modifies the first multiselect picklist I want to change the value from the second multiselect picklist. I want to make a dependency between those 2 picklist multiselect, but my code doesn't work...

Here is my code:
<apex:page standardStylesheets="true" controller="NewAccountAPVController2"  tabStyle="Account">
  <apex:param id="accountID" name="accountID" value=""/>
  <apex:pageMessages />
  <apex:form >
      <script type="text/javascript">  
          function navigate(){ 
              searchServer();  
          }
      </script>
      <apex:actionFunction name="searchServer" action="{!RefreshMultiSelect}" rerender="results"> </apex:actionFunction>
      <apex:pageBlock title="New Account">
          <apex:pageBlockButtons >
              <apex:commandButton action="{!cancel}" value="Cancel" styleClass="btn"/>
              <apex:commandButton action="{!savePage21}" value="Save" styleClass="btn"/>
          </apex:pageBlockButtons>
          <apex:pageBlockSection title="Subcategorie" columns="1">
              <c:MultiselectPicklist leftLabel="Subcategorii" 
                leftOptions="{!subcategory}"
                rightLabel="Subcategorii selectate"
                rightOptions="{!selectedSubcategory}"
                size="15"
                width="300px" onchange="navigate();"
              />
           </apex:pageBlockSection>
         <apex:pageBlockSection title="Subsubcategorie">
            <c:MultiselectPicklist leftLabel="Subsubcategorii" 
                 leftOptions="{!subsubcategory}"
                 rightLabel="Subsubcategorii selectate"
                 rightOptions="{!selectedSubSubCategory}"
                 size="15"
                 width="300px"
                 id="results"
            />  
        </apex:pageBlockSection>
      </apex:pageBlock>
  </apex:form>
</apex:page>

Can anyone help me? 
Hi,

how can i bring out something similar to 
"

<a href="Https://www.google.com">Search</a>

"

in the following code.



trigger chatterfeed on Feedback__c (after update) {

for(Feedback__c feed:trigger.old)
{
FeedItem post = new FeedItem();
post.ParentId = 'Some id';
String fullFileURL = URL.getSalesforceBaseUrl().toExternalForm()+'/'+ Feed.id;
String stringURL  = '<a href='+fullFileURL+' >Test</a>/>';
post.Body =stringURL;
insert post;
}


for which i get a post with a link like below and clicj=king on it should direct to me to the link on the href.
"
Test
"
'String stringURL  = '<a href='+fullFileURL+' >Test</a>/>';   this does no work..