• Ashish Deo
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 9
    Replies
I am ready with dynamic tree display with the help of Jquery.

"Now I want to call the function on-click of tree node(+ kind of symbol) in VF. Any idea how to do this."
Hi Experts,

Can Articles to be attached automatically to case if one of the field is found same on Case & Article. If yes please share code snippet.or via any Trigger Thanks
I am using a Mydomain enabled dev org on gs0 (Winter 16) and going throught the exercise in Trailhead. 

Follwed every step and when i click on Preview it takes me to my app (looks right) - https://skypeforbiz-dev-ed.lightning.force.com/c/Sfb.app

But it errors out with -

Lightning components require My Domain. Please contact your system administrator for more information.

Any idea what I might be missing? My org is defenitely provisioned with MyDomin.
provided challange is: Create a Message of The Day component that displays different text based on an attribute...
https://developer.salesforce.com/trailhead/lex_dev/lightning_components/lightning_components_expressions

i completed this challenge but traihead is not accepting it.. it is giving me error. i.e. : 
Challenge not yet complete... here's what's wrong: 
The component is not evaluating the value of the 'DayOfTheWeek' attribute to determine what to display


but when i execute my component it gives me desired output....
Hi ,
I am trying to send a meeting invitation from salesforce to outlook or Gmail with meeting date and time. I have a code to do this, but it is hardcoded. I need to send the meeting invitation with date and time as mentioned by the user.

Here is the code:-
Vf page:-

<apex:page controller="SendEmail">
    <apex:form >
        <apex:pageblock >
            <apex:pageblocksection columns="2">
                <apex:outputText value="Email"/><br/>
                <apex:inputText value="{!sendTo}"/><br/>
                <apex:outputText value="Subject"/><br/>
                <apex:inputText value="{!subject}" maxlength="80"/><br/>
                <apex:inputField value="{!objEvent.ActivityDate}" /><br/>
                <apex:inputField value="{!objEvent.StartDateTime}" /><br/>
                <apex:inputField value="{!objEvent.Description}" /><br/>
                <apex:outputText value="{!SUBSTITUTE(SUBSTITUTE(SUBSTITUTE($CurrentPage.parameters.start,':',''),'-',''),' ','T')}"/>
            </apex:pageblocksection>
        </apex:pageblock>
        
             <!---   <apex:inputField value="{!objEvent.starttime}" /> -->
                <apex:commandButton value="send" action="{!sendInvite}"/>
    </apex:form>
</apex:page>

Controller:-

public class SendEmail {
    public String sendTo { get; set; }
    public String Subject { get; set; }
    public Event objEvent{get;set;}
    public SendEmail() {}
    public PageReference sendInvite() {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {sendTo};
        mail.setToAddresses(toAddresses);
        mail.setSubject(Subject);
        mail.setPlainTextBody('');
        Messaging.EmailFileAttachment attach = new Messaging.EmailFileAttachment();
        attach.filename = 'meeting.ics';
        attach.ContentType = 'text/calendar;';
        attach.inline = true;
        attach.body = invite();
        mail.setFileAttachments(new Messaging.EmailFileAttachment[] {attach});
        Messaging.SendEmailResult[] er = Messaging.sendEmail(new Messaging.Email[] {mail});
        return null;
    }
    private Blob invite() {
        String txtInvite = '';
 
        txtInvite += 'BEGIN:VCALENDAR\n';
        txtInvite += 'PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN\n';
        txtInvite += 'VERSION:2.0\n';
        txtInvite += 'METHOD:PUBLISH\n';
        txtInvite += 'X-MS-OLK-FORCEINSPECTOROPEN:TRUE\n';
        txtInvite += 'BEGIN:VEVENT\n';
        txtInvite += 'CLASS:PUBLIC\n';
        txtInvite += 'CREATED:20150709T083709Z\n';
        txtInvite += 'DTEND:20150709T010000Z\n';
        txtInvite += 'DTSTAMP:20150708T203709Z\n';
        txtInvite += 'DTSTART:20150709T000000Z\n';
        txtInvite += 'LAST-MODIFIED:20150708T203709Z\n';
        txtInvite += 'LOCATION:Online\n';
        txtInvite += 'PRIORITY:5\n';
        txtInvite += 'SEQUENCE:0\n';
        txtInvite += 'SUMMARY;';
        txtInvite += 'LANGUAGE=en-us:Meeting\n';
        txtInvite += 'TRANSP:OPAQUE\n';
        txtInvite += 'UID:4036587160834EA4AE7848CBD028D1D200000000000000000000000000000000\n';
        txtInvite += 'X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//EN"><HTML><HEAD><META NAME="Generator" CONTENT="MS Exchange Server version 08.00.0681.000"><TITLE></TITLE></HEAD><BODY><!-- Converted from text/plain format --></BODY></HTML>\n';
        txtInvite += 'X-MICROSOFT-CDO-BUSYSTATUS:BUSY\n';
        txtInvite += 'X-MICROSOFT-CDO-IMPORTANCE:1\n';
        txtInvite += 'END:VEVENT\n';
        txtInvite += 'END:VCALENDAR';
 
        return Blob.valueOf(txtInvite);
    }
}
I'm using lightning component and I have create two component like below.

navigateSampleView1.cmp
<aura:component implements='force:appHostable'> <ui:button aura:id="normal" label="Go to SampleView2" press="{!c.pressButton}"/> </aura:component>

navigateSampleView1Controller.js
({ pressButton: function(component, event, helper) { var evt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef: "c:navigateSampleView2", componentAttributes: { whom: "Lightning" } }); evt.fire(); } })

navigateSampleView2.cmp
<aura:component> <aura:attribute name="whom" type="String" default="world"/> Hello {!v.whom}! </aura:component>

Now, what I want to do is that navigate from navigateSampleView1 to navigateSampleView2, but the error is happened, please help me out!!
The error is "Uncaught error in $A.run() : Unknown component: markup://c:navigateSampleView2"
Hi guys

Can you give me a link or code on how to add outlook calendar event using apex, i try to google it but i cannot find any hint. thanks for answering

i am having a class

public class region{
public Integer region_id{get;set;}
public String region_name{get;set;}
public List<Integer> country_id{get;set;}
public list<String> country_name{get;set;}
}

 i have given a list of this class

when i tried to generate tree view withpage code

-------------------------

<apex:page Controller="Tree" showHeader="true" tabStyle="account">
<!-- Include the Jquery Script files -->
<link rel="stylesheet" href="{!URLFOR($Resource.Jtreeview,'/jquery.treeview.css')}"/>
<script src="{!URLFOR($Resource.Jtreeview,'/lib/jquery.js')}" type="text/javascript"></script>
<script src="{!URLFOR($Resource.Jtreeview,'/lib/jquery.cookie.js')}" type="text/javascript"></script>
<script src="{!URLFOR($Resource.Jtreeview,'/jquery.treeview.js')}" type="text/javascript"></script>
<!-- End of Javascript files -->
<script type="text/javascript">
        $(function() {
            $("#tree").treeview({
                collapsed: false,
                animated: "medium",
                control:"#sidetreecontrol",
                persist: "location"
            });
        })
</script><apex:form >
<br/> <br/> <br/>
<!-- Tree -->
<div class="treeheader" style="height:0px;">&nbsp;</div>
<div id="sidetreecontrol"><a href="?#"><font style="color:blue;">Collapse All</font></a> | <a href="?#"><font style="color:blue;">Expand All</font></a></div>
<ul id="tree">
    <apex:repeat value="{!Accounts}" var="parent">
        <li><strong><apex:inputCheckbox id="checkedone3">

</apex:inputCheckbox><apex:outputtext style="color:blue;" escape="false" value="{!parent.region_name}"/></strong>
             <ul>
                 <apex:repeat value="{!parent}" var="child">
                    <li><span class="formattextcon"><apex:inputCheckbox id="checkedone3">

</apex:inputCheckbox><apex:outputtext style="color:green;" escape="false" value="{!child.country_name}"/></span>
                 
                    </li>
                 </apex:repeat>  
             </ul>  
        </li>
    </apex:repeat>
</ul></apex:form>
<!-- End of Tree -->       
</apex:page>

-------------------------------------------------------

 i am getting a tree like this

 

 

  • Africa
    • [Algeria, Angola, Benin, Botswana, Burkina Faso, Burundi, Cameroon, Cape Verde, Central African Republic, Chad, Comoros, Congo (Brazzaville), Democratic Republic of the Congo, Djibouti, Egypt, Equatorial Guinea, Eritrea, Ethiopia, Gabon, Gambia, Ghana, Guinea, Guinea-Bissau, Kenya, Lesotho, Liberia, Libya, Madagascar, Malawi, Mali, Mauritania, Mauritius, Morocco, Mozambique, Namibia, Niger, Nigeria, Réunion, Rwanda, São Tomé and Príncipe, Senegal, Seychelles, Sierra Leone, Somalia, South Africa, St. Helena, Sudan, Swaziland, Tanzania, Togo, Tunisia, Uganda, Western Sahara, Zambia, Zimbabwe]
  • Asia
    • [Afghanistan, Bangladesh, Bhutan, Brunei, Cambodia, China, East Timor, Hong Kong, India, Indonesia, Japan, Kazakhstan, Kyrgyzstan, Laos, Macao, Malaysia, Maldives, Mongolia, Myanmar, Nepal, North Korea, Pakistan, Philippines, Singapore, South Korea, Sri Lanka, Taiwan, Tajikistan, Thailand, Turkmenistan, Uzbekistan, Vietnam]
  • Caribbean
    • [Anguilla, Antigua and Barbuda, Aruba, Bahamas, Barbados, British Virgin Islands, Cayman Islands, Cuba, Dominica, Dominican Republic, Grenada, Guadeloupe, Haiti, Jamaica, Martinique, Montserrat, Netherlands Antilles, St. Kitts and Nevis, St. Lucia, St. Vincent and the Grenadines, Trinidad and Tobago, Turks and Caicos]
  • Central America
    • [Belize, Costa Rica, El Salvador, Guatemala, Honduras, Nicaragua, Panama]

 

 

i want in this format

  Central America

         Belize

        Costa rica

        El Salvador

        Guatemala

 what changes should i make to the page code

Regards

Punnoose

 

 

I wrote a test method to cover code for the class shown below.

But its not covering the wrapper class .

please direct me to test wrapper class.

 

public with sharing class sno_in_table
{

public list<wrap> getRecords()

{
integer sno=1;
list<wrap>emps=new list<wrap>();
list<employee__c>emp_records=[select name,phone__c from employee__c];

for(employee__c em:emp_records)
{

emps.add(new wrap(sno,em));
sno++;

}
return emps;
}

 

//wrapper class

 

public class wrap
{
public integer sno{get;set;}
public employee__c emp{get;set;}

public wrap(integer sn, employee__c e)
{
emp=e;
sno=sn;
}

}

public static testmethod void m1()
{
sno_in_table sno=new sno_in_table();
sno.getrecords();
}
}

I'm using lightning component and I have create two component like below.

navigateSampleView1.cmp
<aura:component implements='force:appHostable'> <ui:button aura:id="normal" label="Go to SampleView2" press="{!c.pressButton}"/> </aura:component>

navigateSampleView1Controller.js
({ pressButton: function(component, event, helper) { var evt = $A.get("e.force:navigateToComponent"); evt.setParams({ componentDef: "c:navigateSampleView2", componentAttributes: { whom: "Lightning" } }); evt.fire(); } })

navigateSampleView2.cmp
<aura:component> <aura:attribute name="whom" type="String" default="world"/> Hello {!v.whom}! </aura:component>

Now, what I want to do is that navigate from navigateSampleView1 to navigateSampleView2, but the error is happened, please help me out!!
The error is "Uncaught error in $A.run() : Unknown component: markup://c:navigateSampleView2"