• Uvais Komath
  • NEWBIE
  • 325 Points
  • Member since 2015
  • Salesforce Developer


  • Chatter
    Feed
  • 3
    Best Answers
  • 1
    Likes Received
  • 3
    Likes Given
  • 5
    Questions
  • 59
    Replies
I am working on the below requirement where I want to investigate 

1. Can we send a daily summary of leads that got assigned to the partner.
2. Can the partner user Opt-In/Opt-Out of lead notification messages.
3. How to send only one email when leads are uploaded in bulk.
while am creating date-of-brith field in calendar years coming from 2015 to 2019......i want from 1980...can any plz help me 
Hi,

I have written the below classes as part of the trailhead challenge for Apex REST callouts.

The class -

public class AnimalLocator {
  
  public static String getAnimalNameById(Integer id) {
    
    Http http = new Http();
    HttpRequest request = new HttpRequest();
    request.setEndpoint('https://th-apex-http-callout.herokuapp.com/animals/'+id);
    request.setMethod('GET');
    
    HttpResponse response = http.send(request);
    List<Object> animals; 
    String returnValue; 
    
    // parse the JSON response
    if (response.getStatusCode() == 200) {
      Map<String, Object> result = (Map<String, Object>) JSON.deserializeUntyped(response.getBody());
      animals = (List<Object>) result.get('animals');
      System.debug(animals);
    }
    
    if (animals.size() > 0 && animals != NULL && id < animals.size()) {
      returnValue = (String) animals.get(id);
    }
    
    return returnValue;
  } 
    
}

Mock Response Class - 

@isTest
global class AnimalLocatorMock implements HttpCalloutMock {
     // Implement this interface method
    global HTTPResponse respond(HTTPRequest request) {
        // Create a fake response
        HttpResponse response = new HttpResponse();
        response.setHeader('Content-Type', 'application/json');
        response.setBody('{"animals": ["majestic badger", "fluffy bunny", "scary bear", "chicken", "mighty moose"]}');
        response.setStatusCode(200);
        return response; 
    }
}

Test Class - 

@isTest
private class AnimalLocatorTest{
    @isTest static void AnimalLocatorMock1() {
        Test.setMock(HttpCalloutMock.class, new AnimalLocatorMock());
        string result = AnimalLocator.getAnimalNameById(3);
        String expectedResult = 'chicken';
        System.assertEquals(result,expectedResult );
    }
}

I have got 100% code coverage for the main class. But when I check the challenge I get 

Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.NullPointerException: Attempt to de-reference a null object

Please tell me if any changes to the code is required. It's really frustrating as I am stuck from past 3-4 days with this unit.

Thanks & Regards,

Abhiram Sheshadri
  1. Tried with Apex : gets "DML Not supported error"
  2. Tried with Workbench REST Explorer gets following error :
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
message: entity type cannot be inserted: User Presence
errorCode: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY

Any help is appreciated, Basically i am trying to build a lightning component for users to go offline from MOBILE
Tried both Javascript API and OmniChannelToolKit, Both does not work outside service console

I just started my Mulesfoft training but i cannot get the studio working!

Everytime it shows error occured just after workspace selection
Here is the error log:

 

!SESSION 2018-10-08 11:45:44.950 -----------------------------------------------
eclipse.buildId=unknown
java.version=11
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -keyring /Users/uvaiskomath/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -keyring /Users/uvaiskomath/.eclipse_keyring

!ENTRY org.eclipse.osgi 4 0 2018-10-08 11:46:08.122
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:491)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:505)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:204)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:614)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
	... 22 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 24 more

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-10-08 11:46:08.162
!MESSAGE FrameworkEvent ERROR
!STACK 0
java.lang.NoClassDefFoundError: javax/annotation/PreDestroy
	at org.eclipse.e4.core.internal.di.InjectorImpl.disposed(InjectorImpl.java:450)
	at org.eclipse.e4.core.internal.di.Requestor.disposed(Requestor.java:156)
	at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:78)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:111)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.handleInvalid(TrackableComputationExt.java:74)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:178)
	at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.dispose(EclipseContextOSGi.java:99)
	at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.bundleChanged(EclipseContextOSGi.java:141)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
	at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
	at org.eclipse.osgi.container.Module.doStop(Module.java:634)
	at org.eclipse.osgi.container.Module.stop(Module.java:498)
	at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 21 more

Any idea on this? I am running on macOs HighSeirra , JDK 8 installed

net::ERR_FILE_NOT_FOUND(file:///android_asset/www/index.html)



User-added image

Getting this error while running.
Any idea how to solve this?

User-added image
net::ERR_FILE_NOT_FOUND(file:///android_asset/www/index.html)

 

Getting this error while running.
Any idea how to solve this?

Please clear following doubts :

(1) How do i make the values of a picklist as the list of all objects available in my org

(2) How do i enable searching in these objects?

For eg:- if i select accounts then i should be able to search for accounts specifying condition (or How do i retrieve details on objects using an SOQL on the selected object in picklist)

(3) How do i Make the search available on multiple objects

for eg:- If i select multiple values : like Account,Contacts and Leads

Then search result list should show all accounts,contacts and leads that meet search condition (Like a search of account,lead,contact that have name starting with "a")

 

Please guide me through the procedure

 


net::ERR_FILE_NOT_FOUND(file:///android_asset/www/index.html)



User-added image

Getting this error while running.
Any idea how to solve this?

I just started my Mulesfoft training but i cannot get the studio working!

Everytime it shows error occured just after workspace selection
Here is the error log:

 

!SESSION 2018-10-08 11:45:44.950 -----------------------------------------------
eclipse.buildId=unknown
java.version=11
java.vendor=Oracle Corporation
BootLoader constants: OS=macosx, ARCH=x86_64, WS=cocoa, NL=en_US
Framework arguments:  -keyring /Users/uvaiskomath/.eclipse_keyring
Command-line arguments:  -os macosx -ws cocoa -arch x86_64 -keyring /Users/uvaiskomath/.eclipse_keyring

!ENTRY org.eclipse.osgi 4 0 2018-10-08 11:46:08.122
!MESSAGE Application error
!STACK 1
org.eclipse.e4.core.di.InjectionException: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:410)
	at org.eclipse.e4.core.internal.di.InjectorImpl.make(InjectorImpl.java:318)
	at org.eclipse.e4.core.contexts.ContextInjectionFactory.make(ContextInjectionFactory.java:162)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultHeadlessContext(E4Application.java:491)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createDefaultContext(E4Application.java:505)
	at org.eclipse.e4.ui.internal.workbench.swt.E4Application.createE4Workbench(E4Application.java:204)
	at org.eclipse.ui.internal.Workbench.lambda$3(Workbench.java:614)
	at org.eclipse.core.databinding.observable.Realm.runWithDefault(Realm.java:336)
	at org.eclipse.ui.internal.Workbench.createAndRunWorkbench(Workbench.java:594)
	at org.eclipse.ui.PlatformUI.createAndRunWorkbench(PlatformUI.java:148)
	at org.eclipse.ui.internal.ide.application.IDEApplication.start(IDEApplication.java:151)
	at org.eclipse.equinox.internal.app.EclipseAppHandle.run(EclipseAppHandle.java:196)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.runApplication(EclipseAppLauncher.java:134)
	at org.eclipse.core.runtime.internal.adaptor.EclipseAppLauncher.start(EclipseAppLauncher.java:104)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:388)
	at org.eclipse.core.runtime.adaptor.EclipseStarter.run(EclipseStarter.java:243)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
	at java.base/jdk.internal.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:62)
	at java.base/jdk.internal.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
	at java.base/java.lang.reflect.Method.invoke(Method.java:566)
	at org.eclipse.equinox.launcher.Main.invokeFramework(Main.java:653)
	at org.eclipse.equinox.launcher.Main.basicRun(Main.java:590)
	at org.eclipse.equinox.launcher.Main.run(Main.java:1499)
Caused by: java.lang.NoClassDefFoundError: javax/annotation/PostConstruct
	at org.eclipse.e4.core.internal.di.InjectorImpl.inject(InjectorImpl.java:124)
	at org.eclipse.e4.core.internal.di.InjectorImpl.internalMake(InjectorImpl.java:399)
	... 22 more
Caused by: java.lang.ClassNotFoundException: javax.annotation.PostConstruct cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 24 more

!ENTRY org.eclipse.e4.ui.workbench 4 0 2018-10-08 11:46:08.162
!MESSAGE FrameworkEvent ERROR
!STACK 0
java.lang.NoClassDefFoundError: javax/annotation/PreDestroy
	at org.eclipse.e4.core.internal.di.InjectorImpl.disposed(InjectorImpl.java:450)
	at org.eclipse.e4.core.internal.di.Requestor.disposed(Requestor.java:156)
	at org.eclipse.e4.core.internal.contexts.ContextObjectSupplier$ContextInjectionListener.update(ContextObjectSupplier.java:78)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.update(TrackableComputationExt.java:111)
	at org.eclipse.e4.core.internal.contexts.TrackableComputationExt.handleInvalid(TrackableComputationExt.java:74)
	at org.eclipse.e4.core.internal.contexts.EclipseContext.dispose(EclipseContext.java:178)
	at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.dispose(EclipseContextOSGi.java:99)
	at org.eclipse.e4.core.internal.contexts.osgi.EclipseContextOSGi.bundleChanged(EclipseContextOSGi.java:141)
	at org.eclipse.osgi.internal.framework.BundleContextImpl.dispatchEvent(BundleContextImpl.java:908)
	at org.eclipse.osgi.framework.eventmgr.EventManager.dispatchEvent(EventManager.java:230)
	at org.eclipse.osgi.framework.eventmgr.ListenerQueue.dispatchEventSynchronous(ListenerQueue.java:148)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEventPrivileged(EquinoxEventPublisher.java:213)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:120)
	at org.eclipse.osgi.internal.framework.EquinoxEventPublisher.publishBundleEvent(EquinoxEventPublisher.java:112)
	at org.eclipse.osgi.internal.framework.EquinoxContainerAdaptor.publishModuleEvent(EquinoxContainerAdaptor.java:168)
	at org.eclipse.osgi.container.Module.publishEvent(Module.java:476)
	at org.eclipse.osgi.container.Module.doStop(Module.java:634)
	at org.eclipse.osgi.container.Module.stop(Module.java:498)
	at org.eclipse.osgi.container.SystemModule.stop(SystemModule.java:202)
	at org.eclipse.osgi.internal.framework.EquinoxBundle$SystemBundle$EquinoxSystemModule$1.run(EquinoxBundle.java:165)
	at java.base/java.lang.Thread.run(Thread.java:834)
Caused by: java.lang.ClassNotFoundException: javax.annotation.PreDestroy cannot be found by org.eclipse.e4.core.di_1.6.100.v20170421-1418
	at org.eclipse.osgi.internal.loader.BundleLoader.findClassInternal(BundleLoader.java:433)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:395)
	at org.eclipse.osgi.internal.loader.BundleLoader.findClass(BundleLoader.java:387)
	at org.eclipse.osgi.internal.loader.ModuleClassLoader.loadClass(ModuleClassLoader.java:150)
	at java.base/java.lang.ClassLoader.loadClass(ClassLoader.java:521)
	... 21 more

Any idea on this? I am running on macOs HighSeirra , JDK 8 installed
Hi all,

I have a standard date field in VF page. When i redirect to this URL i want to pass the date through the URL and set date as default value. How to do that. Please help

Amita
Hi All,

I have created a VF page for community to add employee details. I have used a custom object (Employee) for which the master object is Account. I have also added the Account field on the VF page. Now i need to set the account value as the account of the logged in user[Community user Account). How can i achieve this?

<h5>Emergency Contact Information</h5>
                                    <div class="form-field-row">
                                        <div class="form-field-label">First Name</div>
                                        <div class="form-field-input"><apex:inputText value="{!Employee__c.Emergency_First_Name__c}" /></div>
                                    </div>
                                    <div class="form-field-row">
                                        <div class="form-field-label">Last Name</div>
                                        <div class="form-field-input"><apex:inputText value="{!Employee__c.Emergency_Last_Name__c}" /></div>
                                    </div>
                                    <div class="form-field-row">
                                        <div class="form-field-label">Last Name</div>
                                        <div class="form-field-input"><apex:inputText value="{!Employee__c.Account__c}" /></div>
                                    </div>
Hi All,
I am trying to do Trailhead module about Heroku Connect module 
The application's server.js file in the root directory contains the server-side Node.js application. If you edit that file, you see the SQL statement used to update the database:UPDATE salesforce.Contact SET Phone = $1, MobilePhone = $1 WHERE ...
I couldn't find any such file containing the UPDATE salesforce.Contact SET Phone = $1, MobilePhone = $1 WHERE ... 
 please help
decimal bu=0;
        decimal se=0;
        decimal tot = 0;
        string tot1;
        total.clear();
       imbalances1=[SELECT sum(BuyFormula__c) BUY,sum(sellFormula__c) SELL, meter_dum__c meter FROM dealsheet__c where End_Date__c>=:datePicker and Start_Date__c<=:datePicker and  meter_dum__c <> null GROUP BY meter_dum__c ];
       for (AggregateResult ar :  imbalances1)  {
           if(ar.get('buy')==null){bu=0;}
           else{bu=(decimal)ar.get('BUY');}
            if(ar.get('SELL')==null){se=0;}
           else{se= (decimal) ar.get('SELL');}
           tot=bu-se;
            system.debug(bu);
           system.debug(se);
          system.debug(tot);
         //    tot1=(string)tot;
           
          total.add(tot);
           // system.debug('total:'+total.get(0));
       }
       }

I am unable to write Test Code for this code ....any one can help me

thanking u... 
Hi,
I'm in a terrible dilemma with the trigger. I was wondering why there is no id assigned on the record anymore
trigger trigger_Account on Account(before insert, before update){
  for( Account acc : Trigger.new){
    system.debug('Account id: ' + acc.id);
  }
}
this change affected some of my previous triggers
  • June 10, 2016
  • Like
  • 1

Hello guys,

I need help on the Google Map Marker to be available in my Visualforce Email Template.
Basically, the code below works fine in a visualforce page and I want to do similar to a Visualforce Email Template.

<script src="https://maps.googleapis.com/maps/api/js?&sensor=false">
  </script>

  <script>
      function showMap(){
      var latlng = new google.maps.LatLng(15.477830, 120.589827);
      var myOptions = {
          zoom: 8,
          center : latlng,
         mapTypeId:google.maps.MapTypeId.ROADMAP
      };
      var myMap = new google.maps.Map(document.getElementById('theMap'),myOptions);
      
      var marker = new google.maps.Marker({position:latlng,map:myMap});
     }
     window.onload = showMap;
  </script>

  <div id="theMap" style="width:300px;height:300px"> </div>

When the code is applied in a Visualforce Email Template, it returns me an entirely blank page. I have it directly coded in the Visualforce Email template (rendering html) and tried using a custom component as well but no luck.

I'm able to place the Map using the link below (Directly in my Visualforce Template) but no Marker of course.
 
<img src="https://maps.googleapis.com/maps/api/staticmap?center={!RelatedTo.job__r.Address__c}&zoom=14&size=300x400&sensor=false" ></img>

can anyone help me on this. Thanks a lot in advance :)

Zach
I am working on the below requirement where I want to investigate 

1. Can we send a daily summary of leads that got assigned to the partner.
2. Can the partner user Opt-In/Opt-Out of lead notification messages.
3. How to send only one email when leads are uploaded in bulk.
public class Displayprods
{

 //This is where we have defined the Wrapper Class. 
    public class OpportunityLineItemwrapper
    {
      // all the line record instance create
        public OpportunityLineItem prd{get; set;}
        public Boolean selected {get; set;}
        public OpportunityLineItemwrapper(OpportunityLineItem a)
        {
            prd = a;
            selected = false;
        }
    }
 // This is the Wrapper Name for the object Opportunity Line Items
    List<OpportunityLineItemwrapper> OppList = new List<OpportunityLineItemwrapper>();
    List<OpportunityLineItem> selectedProducts = new List<OpportunityLineItem>();

 //Defines a Map to store all items selected based on the ID from the  ID from the URl.
    Map<Id,OpportunityLineItem> selectedProductsMap = new Map<Id,OpportunityLineItem>();
   

    public Displayprodsinopprtunity(ApexPages.StandardController controller) {

    }
        
    public List<OpportunityLineItemwrapper> getProducts() {
        ID str = ApexPages.currentPage().getParameters().get('ID');         
        OppList.clear();
        
        for(OpportunityLineItem a : [Select Id,Quantity,
ListPrice,PricebookEntry.Product2Id,TotalPrice
 PricebookEntry.Name From OpportunityLineItem
 where Opportunity.id=:str]){
            
            
            OpportunityLineItemwrapper opplineItem = new OpportunityLineItemwrapper(a);            
            if (selectedProductsMap.get(a.Id) != null)
                opplineItem.selected = true;

            OppList.add(opplineItem);        
        }
        return OppList;
    }
    
    public PageReference getSelected() {
        selectedProducts.clear();
        for(OpportunityLineItemwrapper accwrapper : OppList)
        if(accwrapper.selected == true) {
            selectedProducts.add(accwrapper.prd);
            selectedProductsMap.put(accwrapper.prd.id, accwrapper.prd);
        }
        return null;    
        
    }
    
    public List<OpportunityLineItem> GetSelectedProducts()  {
        if(selectedProducts.size()>0)
   return selectedProducts;
        else
   return null;
    }    

    public void updateQuantity() {
        List<Id> SelectedIds = new List<Id>();
       
        for(OpportunityLineItem litem: selectedProducts) {            
             OpportunityLineItem updateQuantity = new OpportunityLineItem (Id=litem.Id,Quantity=22); 
             Update updateQuantity ;            
        }      
    }
        }
Hi All,

I have a scenario where on object recordtype selection page, I am redirecting to standard edit page  and pre-populating some field values based on some criteria using custom logic(using a bypass visualforce page). Functionaltiy is working fine for desktop.
When i am trying to implement the same scenario in Salesforce1, custom logic is not working.
Its an urgent client environment issue and quick help will be appriciated.
 
Hi,

I am writing the below after update trigger for sharing an opportunity record whose stage is CLOSED WON to another user in the organization through APEX but I am getting the bellow error. Can any one please help me where and what type of mistake I am doing hear.

Please find the below attached code :

trigger opptrigger on Opportunity (after update)
{
    list<opportunityshare>opps=new list<opportunityshare>();
    user u=[Select ID From user Where Alias='kuser'];
    for(opportunity op:Trigger.new)
    {
        if(op.StageName=='Closed Won')
        {
          opportunityshare p = new opportunityshare();
            p.opportunityID = op.ID;
            p.UserOrGroupId = u.ID;
            p.opportuniryAccessLevel ='read';
            p.RowCause ='manual';
        }
    }
insert opps;
}

Error I am getting :
Field is not writeable: OpportunityShare.OpportunityId


Thanks & Regards,
Aj
 
hello i am writting a trigger to send mail. i am having two objects one is custom and one is contact. on custom object there is lookup relationship with contact. means from custom object we can choose contact. contact will be having email as a mandatory field. when i will choose contact from custom object(Sent feedback) using lookup field then mail will be sent to email address of that contact. can you help me with this?? this is my code. i am not getting mail.

trigger SentFbtrigger on Sent_Feedback__c (after insert) {
    
//Create a master list to hold the emails we'll send

   List<Messaging.SingleEmailMessage> mails = new List<Messaging.SingleEmailMessage>();
    for(Sent_Feedback__c s : Trigger.new) {
    if(s.Contact__r.Email != null && s.Contact__r.Name != null) {
       
        //Create a new Email
      Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
    
      //Set list of people who should get the email
      List<String> sendTo = new List<String>();
      sendTo.add(s.Contact__r.Email);
      mail.setToAddresses(sendTo);
        mail.setTargetObjectId(s.Contact__r.Id);
        
         //Set who the email is sent from
       mail.setReplyTo('james12@ror.com');
      mail.setSenderDisplayName('James R');
    
    
      // Set email contents - you can use variables!
      mail.setSubject('Subject Content');
      String body = 'Dear ' + s.Contact__r.FirstName + ', ';
      body += 'Email Body';
      
      mail.setHtmlBody(body);
    
      //Add your email to the master list
      mails.add(mail);
    }
  }
  // Send all emails in the master list
  Messaging.sendEmail(mails);
}
Scenario:

I have a component that has an <aura:renderIf> within an <aura:iteration>. The <aura:iteration> references a component attribute called "selectedItems" to display a list of items, accompanied by a delete button. When the delete button is clicked, the following actions are performed on the Controller:

1. var selectedItem = component.get('v.selectedItems');
2. selectedItems.splice() the event.target.value
3. component.set('v.selectedItems', selectedItems);


Problem:

Uncaught TypeError: a.getAttribute is not a function appears.


Other observations:

Aside from the error message, the delete button functions as expected.


Attempted fixes:

1. I have tried to wrap either the <aura:renderIf> or the <aura:iteration> in a <span> without success as instructed in the stack exchange link below.

http://salesforce.stackexchange.com/questions/71604/lightning-bug-in-lightning-framework-when-using-aurarenderif

2. When the code updating the component attribute is removed, there's no error, but the delete button does not function as desired.

3. Changing splice() to pop() still shows the error, but only if the delete button of the last item is clicked. The delete button does not function as desired.

4. The <aura:iteration> in the component was stripped down to just the delete button with an onclick controller event and a value attribute of an ID, while the controller was also stripped down to the component.get('v.selectedItems'), selectedItems.splice() based on event.target.value, then component.set(). Still shows the error even though the item is deleted.

Component
<aura:attribute name="selectedItems" type="sObject[]" /> 
....
<aura:iteration items="{!v.selectedItems}" var="obj">
    <tr>
        <td>
            <button type="button" class="btn btn-default" onclick="{!c.removeItem}" value="{!obj.x__Lookup_ID__c}">
                Del
            </button>
        </td>
    </tr>
</aura:iteration>

Controller
removeItem : function(component, event, helper) {
        var target = event.target.value;
        var selectedItems = component.get('v.selectedItems');
        
        for (var i = 0; i < selectedItems.length; i++) {
            if (target == selectedItems[i].x__Lookup_ID__c) {
				selectedItems.splice(i, 1);
            }
        }
        
        component.set('v.selectedItems', selectedItems);
    }


Question:

How do I make the problem go away?
Hi,

I have an visual force email tempalte however the currency field is giving me some problems: 

  <p> 
                We are writing to advise you that an amount of £{!relatedTo.Amount__c} is outstanding on your account
 </p>

This works ok however if the amount is £200.00 when the email is sent it displays as £200.0

The same thing happens if this is £200.50 it will show as £200.5

It works correctly when the amount is e.g £200.11

Can anybody help? 

Thanks
Hi Dear,

Can you update the governor limits  in detail after dream force exsited.

 
Not strictly development I know, but......

Does anybody know why the standard Contacts with Accounts report type defaults the Account Billing Address into the Contact Mailing Address when the Contact Mailing Address is blank.  I know this is standard platform behavior when creating a new Contact on an Account via the UI but would not expect a report to do the same.

Any thoughts welcome.
  • September 12, 2015
  • Like
  • 1
I followed the steps necessary for creating a hybrid remote app. But once I build and run the project I am getting error index.html is missing. 

1) forcedroid create 

2) fill in all the remaining things 

3) change bootconfig.json file with connected app value etc . 

4) Cordova prepare 

In bootconfig.json, I replaced remoteAccessConsumerKey with the right value from my developer org. The start page is "/apex/myStartPage", which is just a simple page printing some static text. But when I ran this app in Eclipse, android simulator comes up but with no salesforce login page. Instead it is giving error as "Index.html not found".Can you point out where I possibly missed in the setup? 
 
Create an Apex class that returns an array (or list) of strings: 
Create an Apex class that returns an array (or list) of formatted strings ('Test 0', 'Test 1', ...). The length of the array is determined by an integer parameter.The Apex class must be called 'StringArrayTest' and be in the public scope.
The Apex class must have a public static method called 'generateStringArray'.
The 'generateStringArray' method must return an array (or list) of strings. Each string must have a value in the format 'Test n' where n is the index of the current string in the array. The number of returned strings is specified by the integer parameter to the 'generateStringArray' method.

MyApexClass to above Challenge:

public class StringArrayTest {
    
    public static List<string> generateStringArray(Integer n)
    {
        List<String> myArray = new List<String>();
        
        for(Integer i=0;i<n;i++)
        {
            myArray.add('Test'+i);
            System.debug(myArray[i]);
        }
        return myArray;
        
    }


It's compile and execute as per requirement in Developer console. But Traihead showing the below error:

Challenge not yet complete... here's what's wrong: 
Executing the 'generateStringArray' method failed. Either the method does not exist, is not static, or does not return the proper number of strings.

Anyhelp would be greatly appreciated. Thanks.