• Rakesh S
  • NEWBIE
  • 70 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 44
    Questions
  • 25
    Replies
Hi All,

Case assignment rules are not firing while inserting case records through Rest Explorer (using work bench). able to crete the cases but the owner is not assigned to Queue.
Case assignment rules are working while doing update.

Can any one provide suggestions to fire case assignment rule ?

Appriciate your help.

Thanks
 
Hello,

I'm trying to delete an account whenever clicking on the delete button(lightning button). I'm passing the selected account name to Helper where i want to call apex method by passing the parameter.
Helper:

({
         
    	deleteAccounts: function(accountName){
            console.log('accountName: ',accountName);// getting name here- Test Account
            var action = component.get('c.deleteAccounts');
            action.setParams({ 
                 "accName": accountName        
    	     });
        	
    	}
})

the follwing error getting while doing the delete operation.
User-added image
Please help me to define component.


Thanks,
Rakesh
Hello everyone,

while doing Trailhead, i'm getting the error like "The campingHeader component doesn't appear to be using 'lightning:layout'.".

my code:
<aura:component >
	<aura:attribute name="item" type="Camping_Item__c[]" />
    <aura:attribute name="newItem" type="Camping_Item__c" default="{ 'sobjectType': 'Camping_Item__c',
                        'Name': '',
                        'Quantity__c': 0,
                        'Price__c': 0,
                        'Packed__c':false}"/>
    
    <!-- PAGE HEADER -->
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem>
            <lightning:icon iconName="action:goal" alternativeText="My Camping"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Campings</h1>
                <h2 class="slds-text-heading--medium">Camping List</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER,horizontal -->    
    
    <!-- NEW EXPENSE FORM -->
    <lightning:layout>
        <lightning:layoutItem padding="around-small" size="6">
            <!-- CREATE NEW EXPENSE -->
            <div aria-labelledby="newexpenseform">
                <!-- BOXED AREA -->
                <fieldset class="slds-box slds-theme--default slds-container--small">
                <legend id="newexpenseform" class="slds-text-heading--small 
                  slds-p-vertical--medium">
                  Add Expense
                </legend>
          
                <!-- CREATE NEW EXPENSE FORM -->
                <form class="slds-form--stacked">          
                    <lightning:input aura:id="CIform" label="Camping Item Name"
                                     name="itemName"
                                     value="{!v.newItem.Name}"
                                     required="true"/> 
                    <lightning:input type="number" aura:id="CIform" label="Quantity"
                                     name="itemQuantity"
                                     min="1"                                     
                                     step="0.01"
                                     value="{!v.newItem.Quantity__c}"
                                     messageWhenRangeUnderflow="Enter an Quantity that's at least 1."/>
                    <lightning:input aura:id="CIform" label="Price"
                                     name="itemPrice"
                                     formatter="currency"
                                     value="{!v.newItem.Price__c}" />
                   <!-- <lightning:input type="date" aura:id="CIform" label="Expense Date"
                                     name="expensedate"
                                     value="{!v.newItem.Date__c}"/>-->
                    <lightning:input type="checkbox" aura:id="CIform" label="Packed__c?"  
                                     name="expreimbursed"
                                     checked="{!v.newItem.Packed__c}"/>
                    <lightning:button label="Create Item" 
                                      class="slds-m-top--medium"
                                      variant="brand"
                                      onclick="{!c.clickCreateItem}"/>
                </form>
                <!-- / CREATE NEW EXPENSE FORM -->
          
              </fieldset>
              <!-- / BOXED AREA -->
            </div>
            <!-- / CREATE NEW EXPENSE -->
        </lightning:layoutItem>
    </lightning:layout>
</aura:component>
Please help me anyone to resolve the issue. I appriciate your response.

Thanks.
Hi All,

this is my business hours:
List<BusinessHours> lstBusinessHours = [SELECT Id,name,isdefault FROM BusinessHours where name='MGS Business Hours' LIMIT 1];

i want to calculate differece b/w two business days and expecting result is in DateTime format.

Ex:  datetime newDate = system.now().addHours(-8);
Decimal dt = BusinessHours.diff(lstBusinessHours[0].newDate , system.now())/3600000.0;
here i am getting hours. but i am expecting like MM/DD/YY HH:MM:SS.

i appriciate your response.

Thanks.
Hi All,

I have created custom settings with 4 fields and entered all values.
Please find the below image.
User-added image
My scenarios are like follows:
1). If I select country india and group exp then I want to get form list(VLS1,VLS 2,VLS 3, VLS4, VLS5, VLS6)
2).If I select country USA and group Exp then I want to get form list(VLS7,VLS 8)
3). If I select country UK and group Fresher then I want to get form list(VLS13,VLS 14,VLS 15, VLS16)
4).If I select UK then no forms

how we can get the forms besed on condition. 

I appriciate your help.

Thank you
Rakesh 

Hi All,

i want to create an opportunity with description and account field are mandatory. the selected account's contacts object field(Description) need to be update.
Ex. Creating opportunity like JPJN and selected account IBM and Description like JPJN is fortune company.
now we need to retrieve all IBM contacts and then in every contact Description field is there. We need to update that description field value as Description filed value of JPJN(means JPJN is fortune company).

i was tried code and it works successfully. but not Bulkify code.
Please suggest or write code with bulkifying.

trigger DesUpdate on Opportunity (after insert) {
List<Contacts> con = new List<contacts>();
if(trigger.isafter){
        for(opportunity opp : trigger.new){
            if(opp.AccountId != null){
              contact c = [select id,name,accountid,Description from contact where accountid =: opp.AccountId];
              c.Description = opp.Description;
              update c;
            }
        }
        update con;
    }
}
 

Thank you.
 

Hi All,

I want to connect external system using External Data Sources.
Please check the following screen shots.
User-added image

User-added image

After that what are the steps need to connect external system. How can i check whether the system is connected or not with other system.

Please let me know with appropriate information.

Appriciate your response.


Thank you
Rakesh.S
Hi All,

I need workflows in Professional Edition but i know there is no workflows in professional edition.
For testing purpose, we have created a trail PE edition in which i have seen a workflow feature. i dont know exactly how it appears.

User-added image       User-added image
Please let me know, is there any way to configure workflows in PE edition. 

I appreciate your response.

Thank you.
Rakesh.S
Hi All,

I have a custom picklist field that is Courses which has some drop down values like Salesforce,Java, SAP etc. and the same field in three tabs.
In 3rd Tab, when i select value like SAP then it goes to controller and did some actions.-- its working fine.

1st and 2nd Tab, when i select same value SAP then not passing any values to controller and every time it takes value like '---select course---'  in debug log.

And i observed one thing in Debug Log, Internally it takes value which i select from VF page and sets. Again the value is changed as ---Select Course---. 
My Page:
<apex:page standardController="Contact" extensions="RunningBatchController" id="pg">
    <apex:form id="frm">
        <apex:tabPanel switchType="client" selectedTab="name1" id="theTabPanel">
        <apex:tab label="Running Batch Information" name="name1" id="tabOne" title="Running Batch">
            <apex:pageBlock title="Running Batch ">
                <apex:pageBlockSection title="Batch Information" columns="1">
                <apex:selectlist value="{!selectedCourse}" size="1" id="rc" label="Course Name: "> 
                    <apex:SelectOptions value="{!CourseList}" />  
                  <!--  <apex:actionSupport event="onchange" id="rpbt"/> -->   
                </apex:selectlist>
        
            <apex:pageBlockSectionItem >
            <apex:outputLabel value="Batch No:"/>
            <apex:inputField value="{!contact.Batch_No__c}"/>
            </apex:pageBlockSectionItem>
        </apex:pageBlockSection>
        <apex:pageBlockButtons >
            <apex:commandButton value="Search" action="{!searchBatches}" id="rbtn" reRender="rpbt"/>
        </apex:pageBlockButtons>
      <!--  <apex:pageBlockSection >-->
            <apex:pageBlockTable value="{!studentsList}" var="s" id="rpbt">
                <apex:column value="{!s.Name}"/>
                <apex:column value="{!s.Course__r.name}"/>
                <apex:column value="{!s.Batch_No__c}"/>
                <apex:column value="{!s.staff__c}"/>
                <apex:column value="{!s.MobilePhone}"/>
                <apex:column value="{!s.email}"/>
                <apex:column value="{!s.Status__c}"/>
            </apex:pageBlockTable>
     <!--   </apex:pageBlockSection>-->
    </apex:pageBlock>
    </apex:tab>
    
    
    <apex:tab label="Pending Batch Information" name="name2" id="tabTwo" title="Pending Batch">
            <apex:pageBlock title="Pending Batch ">
                <apex:pageBlockSection title="Batch Information" columns="1" id="pbs2">
                <apex:selectlist value="{!selectedCourse}" size="1" id="pc" label="Course Name: "> 
                    <apex:SelectOptions value="{!CourseList}"/>  
                    <apex:actionSupport event="onchange" reRender="ppbt"/>    
                </apex:selectlist>
                 
        </apex:pageBlockSection>
        <apex:pageBlockButtons >
            <apex:commandButton value="Search" action="{!searchPendingBatches}" id="btn" reRender="ppbt"/>
        </apex:pageBlockButtons>
      <!--  <apex:pageBlockSection >-->
            <apex:pageBlockTable value="{!studentsList}" var="s" id="ppbt">
                <apex:column value="{!s.Name}"/>
                <apex:column value="{!s.Course__r.name}"/>
                <apex:column value="{!s.Batch_No__c}"/>
                <apex:column value="{!s.staff__c}"/>
                <apex:column value="{!s.MobilePhone}"/>
                <apex:column value="{!s.email}"/>
                <apex:column value="{!s.Status__c}"/>
            </apex:pageBlockTable>
      <!--   </apex:pageBlockSection>-->
    </apex:pageBlock>
    </apex:tab>
    
    <apex:tab label="Completed Batch Information" name="name3" id="tabThree" title="Completed batch">
            <apex:pageBlock title="Completed Batch ">
                <apex:pageBlockSection title="Batch Information" columns="1" id="pbs3">
                <apex:selectlist value="{!selectedCourse}" size="1" id="cc" label="Course Name: ">
                     
                    <apex:SelectOptions value="{!CourseList}"/> 
                  <!--  <apex:actionSupport event="onchange" reRender="cpbt"/> -->   
                </apex:selectlist>
                 
        </apex:pageBlockSection>
        <apex:pageBlockButtons >
            <apex:commandButton value="Search" action="{!searchCompletedBatches}" id="Cbtn" reRender="cpbt"/>
        </apex:pageBlockButtons>
      <!--  <apex:pageBlockSection >-->
            <apex:pageBlockTable value="{!studentsList}" var="s" id="cpbt">
                <apex:column value="{!s.Name}"/>
                <apex:column value="{!s.Course__r.name}"/>
                <apex:column value="{!s.Batch_No__c}"/>
                <apex:column value="{!s.staff__c}"/>
                <apex:column value="{!s.MobilePhone}"/>
                <apex:column value="{!s.email}"/>
                <apex:column value="{!s.Status__c}"/>
            </apex:pageBlockTable>
      <!--   </apex:pageBlockSection>-->
    </apex:pageBlock>
    </apex:tab>
    
    </apex:tabPanel>
    </apex:form>
</apex:page>
​Controller:
public with sharing class RunningBatchController{
    
    public String selectedCourse { get; set; }
    public List<Contact> studentsList{get;set;}  
    
    public ApexPages.StandardController controller{get;set;}
    public RunningBatchController(ApexPages.StandardController controller) {
        this.controller = controller;
        system.debug('ddd '+controller);
        
    }

    public List<SelectOption> getCourseList(){
        
        List<SelectOption> CourseList = new List<SelectOption>();
        
        CourseList.add(new SelectOption('------- Select Course -------','------- Select Course -------')); 
        List<Product2> prodList = [Select id, Name from Product2];
        for(Product2 pc :prodList){
            CourseList.add(new SelectOption(pc.Id,pc.Name));     
        }
       return CourseList;    
    }
    
    
    
    
    
    public void searchBatches(){
        
        Contact bch = (Contact)controller.getRecord();
       system.debug('course '+selectedCourse);
       system.debug('batch '+bch.Batch_No__c);
      // String course = bch.Course__c;
       String batch = bch.Batch_No__c;
       
       if(selectedCourse != '------- Select Course -------' && batch != '--None--'){
           studentsList = [select id,Name,course__c,Course__r.name,Batch_No__c,Staff__c,MobilePhone,Status__c,Email from Contact where course__c =: selectedCourse and Batch_No__c =: batch and Status__c ='Active'];
        }else if(selectedCourse != '------- Select Course -------' && batch == '--None--'){
            studentsList = [select id,Name,course__c,Course__r.name,Batch_No__c,Staff__c,MobilePhone,Status__c,Email from Contact where course__c =: selectedCourse and Status__c ='Active'];
        }else{
            studentsList = [select id,Name,course__c,Course__r.name,Batch_No__c,Staff__c,MobilePhone,Status__c,Email from Contact where Status__c ='Active'];
        }
    }
    
    public void searchPendingBatches(){
        
        Contact bch = (Contact)controller.getRecord();
      system.debug('ppppp '+selectedCourse);
            
      if(selectedCourse == '------- Select Course -------'){
          system.debug('nothing ');
          studentsList = [select id,Name,course__c,Course__r.name,Batch_No__c,Staff__c,MobilePhone,Status__c,Email from Contact where Status__c ='Pending'];        
      }else{
          system.debug('selected course');
          studentsList = [select id,Name,course__c,Course__r.name,Batch_No__c,Staff__c,MobilePhone,Status__c,Email from Contact where course__c =: selectedCourse and Status__c ='Pending'];
        }
      
    }
    
    public void searchCompletedBatches(){
            
        Contact bch = (Contact)controller.getRecord();
                
       system.debug('cccc '+selectedCourse);
      if(selectedCourse == '------- Select Course -------'){
          system.debug('##');     
           studentsList = [select id,Name,course__c,Course__r.name,Batch_No__c,Staff__c,MobilePhone,Status__c,Email from Contact where Status__c ='In Active'];
           system.debug('@@'+studentsList.size());
      }else{
          system.debug('hii');
          studentsList = [select id,Name,course__c,Course__r.name,Batch_No__c,Staff__c,MobilePhone,Status__c,Email from Contact where course__c =: selectedCourse and Status__c ='In Active'];
        }
      
    }
    
}

 Debug Log:
User-added image

Please anyone help me with appropriate solution.

I appriciate your response.

Thank You
Rakesh.
Hi All,

In Contact Object, Acivity History related list having Log a Call Button. When i click on Button then open a page and prepopulate some fields like Assigned To, Priority and Related To etc.. But here my problem is that "Related To" field(Picklist) is prepopulated with Opportunity object, Now i want to change that as "Patient" custom object.
Related To field having some values like Asset, Campaign, Case, Contact,Patient,Opportunity etc..

Can i change that field value ? Please let me know with appropriate solution.

Thanks
Rakesh
Hi All,

i have a custom page in that i want to display data in table. In that table, some data display with some color and it comes from controller.User-added image
in VF page, i put it like this 
<td style="background-color:{!w.EnglishColor}">
SocialColor came from controller. its working fine.

But now i want to use style class at <td>. and that color needs to come from controller. 
How should i acheave this problem using CSS. Because need CSS file that i put in static Resources.
Please help me any one using CSS only.

I appriciate your response.


Thank you.
Rakesh.S

 
Hi All,

I have two objects like Event and Registration. In both objects are having invoice as related list. From both objects, i want to create new Invoice. 
So that i want to create new custom button on invoice using URL with help of IF condition. because depending on object clicking that value should be auto populate field in new invoice page.
getting error like " URL No Longer Exists " and Address Bar showing like this: https://na16.salesforce.com/servlet/if(a04j0000009RESq)%7Bwindow.alert(You%20must%20populate%20the%20Field%20before%20using%20this%20button);%7Delse%7B/a0o/e?CF00Nj0000000OfdG=R-00103&CF00Nj0000000OfdG_lkid=a04j0000009RESq&retURL=%2Fa04j0000009RESq}

i tried like this 
if({!Registrations__c.Id})
{
/a0o/e?CF00Nj0000000OfdG={!Registrations__c.Name}&CF00Nj0000000OfdG_lkid={!Registrations__c.Id}&retURL=%2F{!Registrations__c.Id}
}else{
/a0o/e?CF00Nj0000000OfdG={!Event__c.Name}&CF00Nj0000000OfdG_lkid={!Event__c.Id}&retURL=%2F{!Event__c.Id}

}

I appreciate your help.

Thank you.
Rakesh
Hi All,

I have two objects like Patient1__c(Parent) and Patient2__c(child) and Master-Detail relationship b/w them.
Now i want to diplay ActivityHistories of Patient2__c in Patient1__c object related list. Patient1__c detail page is custom page.
I written a page for ActivityHistories of Patient2__c and that i want to put it in Patient1__c detail page. Trying to use <apex:include > component. but showing some error like " Id value a021a000002wbSa is not valid for the Patient2__c standard controller ".

page for ActivityHistories : 
<apex:page standardController="Patient2__c"> <apex:relatedList list="ActivityHistories" title="Communication History" id="ch"/> </apex:page>

page for Patient1 view:
 <apex:page standardController="Patient1__c"> 
<apex:include pageName="myPage"/>
</apex:page>

I need solution without using of apex class. Please help me.


Thank you.
Rakesh.S
Hi All,

I have a Patient__c object in which Referring_Physician__c is lookup field. So now i can retrieve physician field using like..{!Patient__c.Referring_Physician__c}.

But now i want to retrieve physician__c object fileds.  like Primary_Phone__c filed.
Can i do that ?. Please help me. I am using this in Email template where am passing Patient__c object details while sending an email.

I tried many ways but it is not working(not displaying field values in email template).
{!Patient__r.Referring_Physician__c.Phone_Primary__c}
{!Patient__r.Referring_Physician__r.Phone_Primary__c}
{!Referring_Physician__c.Phone_Primary__c}
{!Referring_Physician__r.Phone_Primary__c}

Thank you.
Rakesh.S
Hi All,
I want to Prepopulate Fields on a Standard Edit page. How we can do that ?
Every time display only default value for any appointment like " SRManagement " for Organization. 
User-added image
then i tried using custom button through url. It looks like working but getting some error like
User-added image
Standard button url is: /a03/e?CF00N1a000006x8Xb=Gloria+Hejduk&CF00N1a000006x8Xb_lkid=a021a000003HpXA&retURL=%2Fapex%2FPatientView%3Fid%3Da021a000003HpXA%26sfdc.override%3D1.

My custom button url like this: /a03/e?CF00N1a000006x8Xb={!Patient__c.Name}&CF00N1a000006x8Xb_lkid={!Patient__c.Id}&CF00N1a0000077UQp=SRManagement&retURL=%2Fapex%2FPatientView%3Fid%3D{!Patient__c.Id}%26sfdc.override%3D1.

Please help me with appropriate solution. 
I appriciate your response.

Thank you.
Rakesh.S
Hi All,

i want to send email every day 4 pm. for that i written some code.
Please check it below code once and let me know, what i have to do.
 
global class scheduledEmail implements Schedulable {

    public static String CRON_EXP = '0 20 16 * * * *';

    global static String scheduleIt() {
        scheduledEmail sm = new scheduledEmail();
        return System.schedule('Monthly Email', CRON_EXP, sm);
    }
    
   global void execute(SchedulableContext SC) {
   
      sendmail();
      
   }
   public void sendmail()
       {
           Messaging.SingleEmailMessage email = new Messaging.SingleEmailMessage();
           string [] toaddress= New string[]{'sircilla.rakesh7@gmail.com'};
           email.setSubject('Testing Apex Scheduler-Subject');
           email.setPlainTextBody('Testing Apex Scheduler-Body');
           email.setToAddresses(toaddress);
           Messaging.sendEmail(New Messaging.SingleEmailMessage[]{email});
       }
}

Please explain step by step.
I appriciate your response.


Thank you.
Rakesh.S

Hi All,

The controller has 78% code coverage in sandbox then it was moved into the production. after that it has only 0% code coverage. Now it effected on overall code coverage. i tested code coverage without using SeeAllData=true.

Please let me know the solution. Why it happens? 

Thank you.

Hi All,

i want to get all class dates more than today. But I got the following exception while Controller and test class moving to Production.
     System.limitException: Too many query rows:50001.
User-added image

this is my method:
public List < SelectOption > getClassDate() {
// Error coming below line.
    List < AggregateResult > listOFClassDates = [SELECT Class_Date__c FROM Class_Book__c where Class_Date__c >= Today GROUP BY Class_Date__c];

        List < SelectOption > listOfSelectOption = new List < SelectOption > ();
        listOfSelectOption.add(new Selectoption('0', 'Please Select'));
        for (AggregateResult lb: listOFLogBook) {

            Date dt = (date) lb.get('Class_Date__c');
            dateStr = string.valueOf(dt.month()) + '/' + string.valueOf(dt.day()) + '/' + string.valueOf(dt.year());

            listOfSelectOption.add(new Selectoption(string.valueOf(dt), dateStr));

        }
        return listOfSelectOption;
    }

In production, i got only 100 records for this query like 
[SELECT Class_Date__c FROM Class_Book__c where Class_Date__c >= Today GROUP BY Class_Date__c];

How can i achieve this problem. Any one please help me.

Thank you.
Hi All,

We are facing a big problem with professional edition because my client purchased a professional edition and use this to make an application.
But problem is that we are not able to write apex classes, triggers and many things.

We found one solution that Force.com ISV Security Review, using this we can publish the app in App Exchange(with Managed). Now we can use this app after installation.
But problem is here, i want to add more features to that app. How Can i do that ? because we couldnot find Apex Class and Trigger in Develop(Setup-->Develop).

So please any one let me know how we can achieve this issue.

I appreciate your response.

Thank you..
Hi All,
executing this in anonymous block.
 
List<Log_book__c> lbc = [Select id,Subject__c, Level__c, Week__c,Student__c,Subjects_Registered__c from Log_Book__c];
             List<Log_Book__c> needToUpdate=new List<Log_Book__c>();
       for(Log_Book__c slws : lbc){
           Log_Book__c c = new Log_Book__c();
              String s1 = slws.Subject__c+':'+slws.Level__c+':'+slws.Week__c;
             Subjects_Levels_and_Weeks__c slw1=Subjects_Levels_and_Weeks__c.getinstance(s1);
              if(slw1!=null){
               c.id = slws.id;
               c.isExam__c=true;
               c.Exam__c=slw1.Exam__c;
              // c.Student__c=slws.Student__c;
                  //  c.Subjects_Registered__c=slws.Subjects_Registered__c;
             }
          needToUpdate.add(c);
          }
update needToUpdate;

getting error like  MISSING_ARGUMENT, Id not specified in an update call: [].

Please let me know how i can resolve this problem.


thank you..
Hello everyone,

while doing Trailhead, i'm getting the error like "The campingHeader component doesn't appear to be using 'lightning:layout'.".

my code:
<aura:component >
	<aura:attribute name="item" type="Camping_Item__c[]" />
    <aura:attribute name="newItem" type="Camping_Item__c" default="{ 'sobjectType': 'Camping_Item__c',
                        'Name': '',
                        'Quantity__c': 0,
                        'Price__c': 0,
                        'Packed__c':false}"/>
    
    <!-- PAGE HEADER -->
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem>
            <lightning:icon iconName="action:goal" alternativeText="My Camping"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Campings</h1>
                <h2 class="slds-text-heading--medium">Camping List</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER,horizontal -->    
    
    <!-- NEW EXPENSE FORM -->
    <lightning:layout>
        <lightning:layoutItem padding="around-small" size="6">
            <!-- CREATE NEW EXPENSE -->
            <div aria-labelledby="newexpenseform">
                <!-- BOXED AREA -->
                <fieldset class="slds-box slds-theme--default slds-container--small">
                <legend id="newexpenseform" class="slds-text-heading--small 
                  slds-p-vertical--medium">
                  Add Expense
                </legend>
          
                <!-- CREATE NEW EXPENSE FORM -->
                <form class="slds-form--stacked">          
                    <lightning:input aura:id="CIform" label="Camping Item Name"
                                     name="itemName"
                                     value="{!v.newItem.Name}"
                                     required="true"/> 
                    <lightning:input type="number" aura:id="CIform" label="Quantity"
                                     name="itemQuantity"
                                     min="1"                                     
                                     step="0.01"
                                     value="{!v.newItem.Quantity__c}"
                                     messageWhenRangeUnderflow="Enter an Quantity that's at least 1."/>
                    <lightning:input aura:id="CIform" label="Price"
                                     name="itemPrice"
                                     formatter="currency"
                                     value="{!v.newItem.Price__c}" />
                   <!-- <lightning:input type="date" aura:id="CIform" label="Expense Date"
                                     name="expensedate"
                                     value="{!v.newItem.Date__c}"/>-->
                    <lightning:input type="checkbox" aura:id="CIform" label="Packed__c?"  
                                     name="expreimbursed"
                                     checked="{!v.newItem.Packed__c}"/>
                    <lightning:button label="Create Item" 
                                      class="slds-m-top--medium"
                                      variant="brand"
                                      onclick="{!c.clickCreateItem}"/>
                </form>
                <!-- / CREATE NEW EXPENSE FORM -->
          
              </fieldset>
              <!-- / BOXED AREA -->
            </div>
            <!-- / CREATE NEW EXPENSE -->
        </lightning:layoutItem>
    </lightning:layout>
</aura:component>
Please help me anyone to resolve the issue. I appriciate your response.

Thanks.
Hi,

I have managed to get the challenge working but the trailhaed keeps displaying the following message when I press the Check challgene button:
The campingList component isn't iterating the array of 'items' and creating 'campingListItem' components.

It could possibly be the way I have written the code (as separate components) compared to what the trailhead is expecting:

Here is my code:

a) harnessApp.app

<aura:application extends="force:slds">
    <c:campingHeader />
    <c:campingList />

</aura:application>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

b) campingHeader.cmp

<aura:component >
    <!--<h1>Camping List</h1>-->
<!-- PAGE HEADER -->
    <lightning:layout class="slds-page-header slds-page-header--object-home">
        <lightning:layoutItem >
            <lightning:icon iconName="action:goal" alternativeText="Camping List"/>
        </lightning:layoutItem>
        <lightning:layoutItem padding="horizontal-small">
            <div class="page-section page-header">
                <h1 class="slds-text-heading--label">Camping Item</h1>
                <h2 class="slds-text-heading--medium">My Camping Items</h2>
            </div>
        </lightning:layoutItem>
    </lightning:layout>
    <!-- / PAGE HEADER -->
    
</aura:component>

---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
c) campingList.cmp

<aura:component >
    
    <aura:attribute name="items" type="Camping_Item__c[]"/>
    
    <aura:attribute name="newItem" type="Camping_Item__c"
     default="{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Packed__c': '',
                    'Price__c': '0',
                    'Quantity__c': '0' }"/>
    
    <!-- NEW CAMPING ITEM FORM -->
    <lightning:layout >
        <lightning:layoutItem padding="around-small" size="6">

        <!-- CREATE NEW CAMPING ITEM -->
    <div aria-labelledby="newcampingitemform">

    <!-- BOXED AREA -->
    <fieldset class="slds-box slds-theme--default slds-container--small">

    <legend id="newcampingitemform" class="slds-text-heading--small 
      slds-p-vertical--medium">
      Add Camping Item
    </legend>

    <!-- CREATE NEW CAMPING ITEM FORM -->
    <form class="slds-form--stacked">  
       
        <lightning:input aura:id="campingitemform" label="Item Name"
                         name="campingitemname"
                         value="{!v.newItem.Name}"
                         required="true"/> 
        
        <lightning:input type="number" aura:id="campingitemform" label="Quantity"
                         name="campingitemquantity"
                         min="1"
                         value="{!v.newItem.Quantity__c}"
                         messageWhenRangeUnderflow="Enter at least 1"/>
        
        <lightning:input type="number" aura:id="campingitemform" label="Price"
                         name="campingitemprice"
                         formatter="currency"
                         step="0.01"
                         value="{!v.newItem.Price__c}" />
        
        <lightning:input type="checkbox" aura:id="campingitemform" label="Packed?"  
                         name="campingitempacked"
                         checked="{!v.newItem.Packed__c}"/>
        
        <lightning:button label="Create Item" 
                          class="slds-m-top--medium"
                          variant="brand"
                          onclick="{!c.clickCreateItem}"/>
    </form>
    <!-- / CREATE NEW CAMPING ITEM FORM -->

  </fieldset>
  <!-- / BOXED AREA -->

</div>
<!-- / CREATE CAMPING NEW ITEM -->

        </lightning:layoutItem>
    </lightning:layout>
    <!-- / NEW CAMPING ITEM FORM -->
   
    <c:campingListItem items="{!v.items}"/>

  
</aura:component>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

d) campingListController.js

({
    clickCreateItem: function(component, event, helper) {
        var validItem = component.find('campingitemform').reduce(function (validSoFar, inputCmp) {
            // Displays error messages for invalid fields
            inputCmp.showHelpMessageIfInvalid();
            return validSoFar && inputCmp.get('v.validity').valid;
        }, true);
        // If we pass error checking, do some real work
        if(validItem){
            // Create the new expense
            var newItem = component.get("v.newItem");
            console.log("Create item: " + JSON.stringify(newItem));
            helper.createItem(component, newItem);
        }
   
    }
 
})
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

e) campingListHelper.js

({createItem: function(component, item) {
        var theItem = component.get("v.items");
 
        // Copy the expense to a new object
        // THIS IS A DISGUSTING, TEMPORARY HACK
        var newItem = JSON.parse(JSON.stringify(item));
 
        console.log("Item before 'create': " + JSON.stringify(theItem));
        theItem.push(newItem);
        component.set("v.items", theItem);
        console.log("Item after 'create': " + JSON.stringify(theItem));
        component.set("v.newItem",{ 'sobjectType': 'Camping_Item__c',
                    'Name': '',
                    'Quantity__c': 0,
                    'Price__c': 0,
                    'Packed__c': false });
        }
 })
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

f) campingListItem.cmp

<aura:component >

    <aura:attribute name="items" type="Camping_Item__c[]"/>

    <lightning:card title="Items">
        <p class="slds-p-horizontal--small">
            <aura:iteration items="{!v.items}" var="item">
                <c:campingListItems item="{!item}"/>
            </aura:iteration>
        </p>
    </lightning:card>
    
</aura:component>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

g) campingListItems.cmp

<aura:component >
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>
    <!--aura:attribute name="formatdate" type="Date"/-->
    <aura:attribute name="item" type="Camping_Item__c"/>


    <lightning:card title="{!v.item.Name}" iconName="standard:scan_card"
                    class="{!v.item.Packed__c ?
                           'slds-theme--success' : ''}">
        <aura:set attribute="footer">
            <!--p>Date: <lightning:formattedDateTime value="{!v.formatdate}"/></p-->
            <!--p class="slds-text-title"><lightning:relativeDateTime value="{!v.formatdate}"/></p-->
        </aura:set>
        
        <p class="slds-p-horizontal--small">
            Quantity: {!v.item.Quantity__c}
        </p>
        
        <p class="slds-text-heading--medium slds-p-horizontal--small">
           Price: <lightning:formattedNumber value="{!v.item.Price__c}" style="currency"/>
        </p>

        <p>
            <lightning:input type="toggle" 
                             label="Packed?"
                             name="packed"
                             class="slds-p-around--small"
                             checked="{!v.item.Packed__c}"
                             messageToggleActive="Yes"
                             messageToggleInactive="No"
                             onchange="{!c.clickPacked}"/>
        </p>
    </lightning:card>
</aura:component>
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

Thanks in advance for your assistance on this. 


 
Hi All,

I want to connect external system using External Data Sources.
Please check the following screen shots.
User-added image

User-added image

After that what are the steps need to connect external system. How can i check whether the system is connected or not with other system.

Please let me know with appropriate information.

Appriciate your response.


Thank you
Rakesh.S
Hi All,

In Contact Object, Acivity History related list having Log a Call Button. When i click on Button then open a page and prepopulate some fields like Assigned To, Priority and Related To etc.. But here my problem is that "Related To" field(Picklist) is prepopulated with Opportunity object, Now i want to change that as "Patient" custom object.
Related To field having some values like Asset, Campaign, Case, Contact,Patient,Opportunity etc..

Can i change that field value ? Please let me know with appropriate solution.

Thanks
Rakesh
Hi All,

i have a custom page in that i want to display data in table. In that table, some data display with some color and it comes from controller.User-added image
in VF page, i put it like this 
<td style="background-color:{!w.EnglishColor}">
SocialColor came from controller. its working fine.

But now i want to use style class at <td>. and that color needs to come from controller. 
How should i acheave this problem using CSS. Because need CSS file that i put in static Resources.
Please help me any one using CSS only.

I appriciate your response.


Thank you.
Rakesh.S

 
Hi All,

I have two objects like Patient1__c(Parent) and Patient2__c(child) and Master-Detail relationship b/w them.
Now i want to diplay ActivityHistories of Patient2__c in Patient1__c object related list. Patient1__c detail page is custom page.
I written a page for ActivityHistories of Patient2__c and that i want to put it in Patient1__c detail page. Trying to use <apex:include > component. but showing some error like " Id value a021a000002wbSa is not valid for the Patient2__c standard controller ".

page for ActivityHistories : 
<apex:page standardController="Patient2__c"> <apex:relatedList list="ActivityHistories" title="Communication History" id="ch"/> </apex:page>

page for Patient1 view:
 <apex:page standardController="Patient1__c"> 
<apex:include pageName="myPage"/>
</apex:page>

I need solution without using of apex class. Please help me.


Thank you.
Rakesh.S
Hi All,
I want to Prepopulate Fields on a Standard Edit page. How we can do that ?
Every time display only default value for any appointment like " SRManagement " for Organization. 
User-added image
then i tried using custom button through url. It looks like working but getting some error like
User-added image
Standard button url is: /a03/e?CF00N1a000006x8Xb=Gloria+Hejduk&CF00N1a000006x8Xb_lkid=a021a000003HpXA&retURL=%2Fapex%2FPatientView%3Fid%3Da021a000003HpXA%26sfdc.override%3D1.

My custom button url like this: /a03/e?CF00N1a000006x8Xb={!Patient__c.Name}&CF00N1a000006x8Xb_lkid={!Patient__c.Id}&CF00N1a0000077UQp=SRManagement&retURL=%2Fapex%2FPatientView%3Fid%3D{!Patient__c.Id}%26sfdc.override%3D1.

Please help me with appropriate solution. 
I appriciate your response.

Thank you.
Rakesh.S
Hi All,

i want to get all class dates more than today. But I got the following exception while Controller and test class moving to Production.
     System.limitException: Too many query rows:50001.
User-added image

this is my method:
public List < SelectOption > getClassDate() {
// Error coming below line.
    List < AggregateResult > listOFClassDates = [SELECT Class_Date__c FROM Class_Book__c where Class_Date__c >= Today GROUP BY Class_Date__c];

        List < SelectOption > listOfSelectOption = new List < SelectOption > ();
        listOfSelectOption.add(new Selectoption('0', 'Please Select'));
        for (AggregateResult lb: listOFLogBook) {

            Date dt = (date) lb.get('Class_Date__c');
            dateStr = string.valueOf(dt.month()) + '/' + string.valueOf(dt.day()) + '/' + string.valueOf(dt.year());

            listOfSelectOption.add(new Selectoption(string.valueOf(dt), dateStr));

        }
        return listOfSelectOption;
    }

In production, i got only 100 records for this query like 
[SELECT Class_Date__c FROM Class_Book__c where Class_Date__c >= Today GROUP BY Class_Date__c];

How can i achieve this problem. Any one please help me.

Thank you.
Hi All,

We are facing a big problem with professional edition because my client purchased a professional edition and use this to make an application.
But problem is that we are not able to write apex classes, triggers and many things.

We found one solution that Force.com ISV Security Review, using this we can publish the app in App Exchange(with Managed). Now we can use this app after installation.
But problem is here, i want to add more features to that app. How Can i do that ? because we couldnot find Apex Class and Trigger in Develop(Setup-->Develop).

So please any one let me know how we can achieve this issue.

I appreciate your response.

Thank you..
Hi All,
this is my Controller:
public with sharing class LogACallController{

    public Task tsk{get;set;}
    public String WhoId{get;set;}
    public String WhatId{get;set;}
    public Task t{get;set;}
    Public ApexPages.StandardController con;
    public boolean isReminder{get;set;}
    public string RedirectId{get;set;}
    
    public LogACallController(ApexPages.StandardController controller) {
        
        this.con = controller;
        
        WhoId  = ApexPages.currentPage().getParameters().get('who_id');
        WhatId  = ApexPages.currentPage().getParameters().get('what_id');
        If(WhoId != null){
            tsk = new task();
            tsk.OwnerId = UserInfo.getUserId();
            //tsk.isReminderset=true;
            
       }else{
            tsk = new task();
            tsk.OwnerId = UserInfo.getUserId();
             // tsk.isReminderset=true;
        }
         //t = (Task)con.getRecord();
    }
    
    public PageReference save(){
      Task t = (Task)con.getRecord();
      tsk.Status = 'Completed';
      tsk.Date__c = t.Date__c;
      tsk.Subject = 'Call';
      tsk.isReminderset = isReminder;
      system.debug('XXXXXXX' + tsk);
      
   if(WhoId != null){
       // tsk.Status = 'Completed';
        
        tsk.Whoid=WhoId;
        insert tsk;
        this.RedirectId = WhoId;
        
        }
    else{
        //tsk.Status = 'Completed';
        tsk.WhatId=whatId;
        insert tsk;
        this.RedirectId = WhatId;
        
        }
        
        PageReference page = new PageReference('/'+RedirectId);
        page.setRedirect(true);
        return page;
    }
}

This is my Test Class:
@isTest
public class TestLogACall {
    static testmethod void SavetaskTestforContact1()
    {
        Contact c = new Contact();
        c.LastName = 'thamma';
        c.FirstName = 'harsha';
        insert c;
        Task tk = new Task();
        tk.OwnerId = UserInfo.getUserId();
        tk.WhoId = c.Id;
        ApexPages.currentPage().getParameters().put('who_id',c.id);
        ApexPages.StandardController sc = new ApexPages.StandardController(tk);
        LogACallController log = new LogACallController(sc);
        log.WhoId = c.Id;
        log.t = tk;
        log.RedirectId = c.id;
        log.save();
    }    
    static testmethod void SavetaskTestforwhat1()
    {
        physician__c p = new physician__c();
        p.Last_Name__c = 'ranga';
        p.First_Name__c = 'billa';
        p.Name ='dfed';
        insert p;
        Task tk = new Task();
        tk.OwnerId = UserInfo.getUserId();
        tk.WhatId= p.Id;
        ApexPages.currentPage().getParameters().put('what_id',p.id);
        ApexPages.StandardController sc = new ApexPages.StandardController(tk);
        LogACallController log = new LogACallController(sc);
        log.WhatId= p.Id;
        log.t = tk;
        log.RedirectId = p.Id;
        log.save();   
    }
}

this code not covered:
PageReference page = new PageReference('/'+RedirectId);
        page.setRedirect(true);
        return page;

Please help me to write test class.


Thank you..

Hi All,
I have created a page for Physician__c and it has Communication History as a related list.
And it has "Log a Call" button(Custom).

when i click on "Log a Call" button then it goes to new Task page(Custom).
And this page has the following fields like Assign To, Date, Type,Reminder Date etc...
I entered all fields and save it then successfully saved and added it in communication History.

But problem is that In New Task page, i need current user as default in "Assign To" field
and it should be lookup only(it may change).

When i am using Standard button then it works fine but its not my requirement.
Please give appropriate solution for this. Let me know, If any body not understanding.
User-added image


Thank you
Rakesh
I have created a VF Page for Patient__c object. Now i want to create record detailpage for Patient__c.

My Page like this:
<apex:page StandardController="Patient__c" extensions="PatientController" >  
    <apex:sectionHeader subtitle="{!Patient__c.Name}" title="Patient" />
<apex:form id="formid" >

----- All entered all out put field with my requirement.-----

 </apex:form> 

    <apex:relatedList list="Appointments__r"/> 
    <apex:relatedList list="ActivityHistories"  />  // which is not displayed in relatedlist.
    <apex:relatedList list="CombinedAttachments"/>
</apex:page>
while creating an object, Allow Activities check box checked. In standard Detail page, Activity History is appeared.

Please any one help me to acheive this problem. i was tried many ways but not working.


Thank you
Rakesh.S
Hi All,

i am creating a input VF page in which i want to place some fields right side of the page. how can i acheave this problem?
i tried many ways but not properly getting.

like this, User-added image

Thank you
Rakesh.
Hi All,

this is my query: its working well.
Merchandise__c mer = new Merchandise__c(Name='Book1',Description__c='New Book1',
                                        Price__c=400, Total_Inventory__c=50000);
// insert merchandise using DML
insert mer;
but i want to insert in another way for that one code here: its getting error like variable doent exit: Name.
List<Merchandise__c> mer = new List<Merchandise__c>{Name='Book1',Description__c='New Book1',Price__c=500, Total_Inventory__c=10000};
    upsert mer;
Could you pls tell me anyone, what is the different b/w them. And when i should use collection.

Thank you.
 

I'm wondering is it possible to create Excel or CSV file in apex code (as attachment) is it possible ? currently i only see it works with VF page, but i'm looking to do it in apex code not using vf page, I don't see any options.

 

Any help is appreciated.

 

Thanks

Ram

 

  • December 29, 2011
  • Like
  • 0