• Harish M 8
  • NEWBIE
  • 15 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 1
    Questions
  • 12
    Replies

Hello Guys,
in our org, we already overrided our Opportunity__c object New and Edit button with VF pages, currently we are implementing Lightning for Communities,
i created Lightning Component for Override and i selected that component to Override, Please see screen shot For Salseforce Classic - VF For Lightning and Mobile - Lightning Component
but button is not showing in Lightning mode, (if i select No Override for all options then only i am able to see the New button)
any one help on this
Component:


<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride" access="global" >
   
      
</aura:component>


Controller: ({ createRecord : function (component, event, helper) { var createRecordEvent = $A.get("e.force:createRecord"); createRecordEvent.setParams({ "entityApiName": "Opportunity__c" }); createRecordEvent.fire(); } })



User-added image

Hello Guys,
in our org, we already overrided our Opportunity__c object New and Edit button with VF pages, currently we are implementing Lightning for Communities,
i created Lightning Component for Override and i selected that component to Override, Please see screen shot For Salseforce Classic - VF For Lightning and Mobile - Lightning Component
but button is not showing in Lightning mode, (if i select No Override for all options then only i am able to see the New button)
any one help on this
Component:


<aura:component implements="flexipage:availableForRecordHome,force:hasRecordId,lightning:actionOverride" access="global" >
   
      
</aura:component>


Controller: ({ createRecord : function (component, event, helper) { var createRecordEvent = $A.get("e.force:createRecord"); createRecordEvent.setParams({ "entityApiName": "Opportunity__c" }); createRecordEvent.fire(); } })



User-added image
Hi all,
I would need to create an Apex class for the following trigger. I would apprecite any help. I am newbie. Thanks in advance.

trigger Unqualified on Lead (before update ) {
System.debug ('**entro en el trigger before update'); // es un comentario para verlo en el log//

List<Lead> Leads = New List <Lead>();// guarda la información de los leads. Declara e inicializa. List (nombre del objeto) //
List<Id> Ids = New List <Id>();
for (Lead l: Trigger.new){
    Ids.add (l.Id);
}
//Se obtienen los Id de los procesos de aprobación y de los Leads//
List<ProcessInstance> instances = [select Id, TargetObjectId from ProcessInstance where TargetObjectId in :Ids];
Map<Id,Id> LeadProcessMap = new Map<Id,Id>();
Ids = New List <Id>();
for(ProcessInstance pi:instances){
        LeadProcessMap.put (pi.TargetObjectId,pi.Id); 
        Ids.add (pi.Id);// se guardan los Ids de los process instances para que los coja la segunda query//
    }//Con el for se pobla el mapa compuesto por el Id del Lead y del Process Instance//
System.Debug ('** mapa1: '+LeadProcessMap);
    
List<ProcessInstanceStep> instancesSteps = [select Comments,ProcessInstanceId from ProcessInstanceStep where ProcessInstanceId in :Ids];
Map<Id,String> LeadProcessStepMap = new Map<Id,String>(); // String porque hace referencia a comentarios//
for(ProcessInstanceStep pis:instancesSteps){
        LeadProcessStepMap.put (pis.ProcessInstanceId, pis.Comments); 
    }//Con el for se pobla el mapa compuesto por el Id del Lead y del Process Instance//

System.Debug ('** mapa2: '+LeadProcessStepMap);

 //recorre todos los leads//   
for (Lead l: Trigger.new){
    if (l.recordtypeId == '0120Y000000Pquz' && l.status == 'Unqualified' && LeadProcessStepMap.get(LeadProcessMap.get(l.Id))!= null){
        
        System.debug ('** razon2: '+LeadProcessStepMap.get(LeadProcessMap.get(l.Id)));
            l.ReasonRejectedByCommercialPlanning__c = LeadProcessStepMap.get(LeadProcessMap.get(l.Id));
        System.debug ('** razon: '+l.ReasonRejectedByCommercialPlanning__c);
        }


       
}
  • March 21, 2017
  • Like
  • 0
Hai all,
         I have 10 fields in VF page.I had button on VF page name "A".When i Clicked A button VF page data should be converted to PDF and that PDF should to gmail.Can any one help me.

Thanks in advance..

Hi ,
I have created a VF page containing  form which has 4 address fields(street,city,state,country) those are populated by autocomplete functionality using 3rd party application .
I want to display this in edit page of opportunity object .
Later I knew that vf page  cannot be placed in edit page layout .
So I looked into button overriding options , But there is a issue  , The opportunity object has 4 record types/4 page layouts .
If I override the new / edit button with the automplete VF page along with other input fields(replicate edit pagelayout fields)  , the display would be same irrespective of record types .
This will cause a mismatch in fields display or page layouts will be ineffective .

1) So for edit functionality , should I create 4 apex pages to display  fields form 4 correspodning page layouts and check which record type is checked , So the Vf page can be dynamically choosen ?
2) And what about autocomplete VF page? since this functionality is common , Can I convert this Vf page to VF component ,so It can be used in all 4 page layouts?
Regarding the 

  • March 14, 2017
  • Like
  • 0
I have written a VF page to show popup in home page , it will shown whenever user login to organization. my requirement is here is popup window should show only once per user while login.

I have refered many Jqurey examples but unfurnatly i am not able to figure it out , please find my following code and suggest me.
<apex:page >
 <html>
<head>
  <title></title>
    <script src="//ajax.googleapis.com/ajax/libs/jquery/1.10.2/jquery.min.js"></script>
    <script src="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/jquery-ui.min.js"></script>
    <link rel="stylesheet" href="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.3/themes/start/jquery-ui.css" type="text/css" media="all" />
    <script src="/soap/ajax/28.0/connection.js" type="text/javascript"></script>
    <script type="text/javascript">
        function showAlert(){
            jQuery('h2').each(
                function(){
                    if(this.innerHTML == 'Announcements') 
                        this.style.display='none';
                }
            );
            sforce.connection.sessionId = '{!$Api.Session_ID}';
            sforce.connection.query("SELECT Id,Message__c FROM Announcement__c WHERE Display_This_Annoncement__c = TRUE",
                {
                    onSuccess: function(result){
                        var records = result.getArray("records");
                        var message = '';
                        for(var i=0; i<records.length; i++){
                            message = 
                                message +
                                '<b>Announcement ' + (i+1) + '</b><br/>' 
                                + records[i].Message__c + '<br/><br/>';
                        }
                        jQuery( "#message" ).html(message);
                        jQuery( "#dialog-message" ).dialog({
                            modal: true,
                            buttons: {
                                Ok: function() {
                                        jQuery( this ).dialog( "close" );
                                    }
                            }
                        });
                    },
                    onFailure : function(error) {
                        jQuery( "#message" ).html('Error: ' + error);
                        jQuery( "#dialog-message" ).dialog({
                            modal: true,
                            buttons: {
                                Ok: function() {
                                        jQuery( this ).dialog( "close" );
                                    }
                            }
                        });
                    }                
                }
            );            
        }
        showAlert();
    </script>
</head>
<body>
    <div id="dialog-message" title="Attention!">
        <div id="message"></div>
    </div>
</body>
</html>
</apex:page>

Thanks in advance..
public class BikeController
{

    public BikeController() {}

    public Sell_Your_Bike__c bike{set;get;}
 
    public BikeController(ApexPages.StandardController std)
    {
        this.bike=(Sell_Your_Bike__c)std.getRecord();
    }
    
    public Sell_Your_Bike__c saveRecord()
    {
        Sell_Your_Bike__c bike=new Sell_Your_Bike__c
        (
            Registration_Number__c=bike.Registration_Number__c,
            Owner_Name__c=bike.Owner_Name__c,
            Model__c=bike.Model__c,
            Mileage__c=bike.Mileage__c,
            Cubic_Capicity__c=bike.Cubic_Capicity__c,
            Fuel_Capacity__c=bike.Fuel_Capacity__c,
            Speedometer__c=bike.Speedometer__c,
            Disk_Brake__c=bike.Disk_Brake__c,
            Tubeless_Tyres__c=bike.Tubeless_Tyres__c,
            Alloys__c=bike.Alloys__c,
            Price__c=bike.Price__c,
            Contact_Number__c=bike.Contact_Number__c
        );
        
        Insert bike;
        return bike;
    }
    
    public PageReference save()
    {    
        Sell_Your_Bike__c bike= this.saveRecord();
        PageReference pg=null;
        if(!bike.Id.equals(NULL))
        {
            pg=new PageReference('/apex/Bike_SuccessPage?ID='+bike.Id+'&NAME='+bike.Owner_Name__c);
            pg.setRedirect(true);
            return pg;
        }
        else
        {
            pg=Page.Bike_FailurePage;
            pg.setRedirect(true);
            return pg;
        }
    }
    
    public PageReference save_new()
    {
        Sell_Your_Bike__c bike= this.saveRecord();
        PageReference pg=null;
        if(!bike.Id.equals(NULL))
        {
            pg=new PageReference('/apex/VFP_BikeSell');
            pg.setRedirect(true);
        }
        return pg;        
    }
    
    public PageReference cancel()
    {
        PageReference pg=new PageReference('/apex/VFP_BikeSell');
        pg.setRedirect(true);
        return pg;
    }
    
}
Linked each rating to this site i have created. Everything works fine, but my Manager wants this :
When Customer clicks say Rating 8 in his email (this redirects to survey page) that value 8 has to reflect in the Site Rating (there are Radio buttons 0 to through 10 in the site).
Any ideas how I can make the clicked rating in the Email reflect on Site Rating? Please Help 
I built a report and need to show it on home page, I added a report on a VF and added this VF as component on home page but when I click on home it redirects me to the reports page
Could you please guide me
Hi All,

I have created a SOA DB Adapter webservice to update database. I am able to successfully test the service from Em console and using SOAPUI. I now want to call this service from Salesforce. I have:

1. Generated Stub classes using the WSDL 
2. Write a class to call web service
3. Invoke the class from trigger

I am getting following error:

16:07:42:030 EXCEPTION_THROWN [37]|System.CalloutException: Web service callout failed: Unexpected element. Parser was expecting element 'http://schemas.xmlsoap.org/soap/envelope/:Envelope' but found ':html'

I cannot see any instances getting generated on EM console so perhaps it isn't hitting the service at all. 

Also my webservice end point looks like:

http://192.168.24.7:8001/soa-infra/services/default/TestDBAdapter/bpelprocess1_client_ep

So what should I put in Remote Sites Settings? Currently I have following http://192.168.24.7:8001

TIA



 

Hi all,

 

Does anyone know if it is possible to generate an iCalendar/.ical/.ics file based on the content of a Salesforce record?

 

Ideally we would like to be able to have a custom button on a record that on pressing it generates a Meeting Invite to be saved/sent from Outlook. The recipients/attendees, subject, dates, etc. would be defined by fields on the Salesforce record.

 

I have searched the AppExchange but cannot find anything that meets this requirement. Any help or advice is much appreciated.

 

Thanks,

 

Marco

public class BikeController
{

    public BikeController() {}

    public Sell_Your_Bike__c bike{set;get;}
 
    public BikeController(ApexPages.StandardController std)
    {
        this.bike=(Sell_Your_Bike__c)std.getRecord();
    }
    
    public Sell_Your_Bike__c saveRecord()
    {
        Sell_Your_Bike__c bike=new Sell_Your_Bike__c
        (
            Registration_Number__c=bike.Registration_Number__c,
            Owner_Name__c=bike.Owner_Name__c,
            Model__c=bike.Model__c,
            Mileage__c=bike.Mileage__c,
            Cubic_Capicity__c=bike.Cubic_Capicity__c,
            Fuel_Capacity__c=bike.Fuel_Capacity__c,
            Speedometer__c=bike.Speedometer__c,
            Disk_Brake__c=bike.Disk_Brake__c,
            Tubeless_Tyres__c=bike.Tubeless_Tyres__c,
            Alloys__c=bike.Alloys__c,
            Price__c=bike.Price__c,
            Contact_Number__c=bike.Contact_Number__c
        );
        
        Insert bike;
        return bike;
    }
    
    public PageReference save()
    {    
        Sell_Your_Bike__c bike= this.saveRecord();
        PageReference pg=null;
        if(!bike.Id.equals(NULL))
        {
            pg=new PageReference('/apex/Bike_SuccessPage?ID='+bike.Id+'&NAME='+bike.Owner_Name__c);
            pg.setRedirect(true);
            return pg;
        }
        else
        {
            pg=Page.Bike_FailurePage;
            pg.setRedirect(true);
            return pg;
        }
    }
    
    public PageReference save_new()
    {
        Sell_Your_Bike__c bike= this.saveRecord();
        PageReference pg=null;
        if(!bike.Id.equals(NULL))
        {
            pg=new PageReference('/apex/VFP_BikeSell');
            pg.setRedirect(true);
        }
        return pg;        
    }
    
    public PageReference cancel()
    {
        PageReference pg=new PageReference('/apex/VFP_BikeSell');
        pg.setRedirect(true);
        return pg;
    }
    
}