• SFDC Learning 6
  • NEWBIE
  • 0 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 5
    Replies
I am trying to trim characters after ';' character  from map keys. 
For Example: 

{10;00o5B000000AcrdQAC=4583.00000000, 10;00o5B000000AcrqQAC=7250.00000000, 11;00o5B000000AcreQAC=4583.00000000}

want to compare key value with list of integerts {1,2,3,4}
Please suggest the way if you have any.

Thanks in advance.

 
I am trying to dispay multiple lightning components using sites vfpage.
 
<apex:page sidebar="false" showHeader="false" standardStylesheets="false">

    <apex:includeLightning />
    <div id="lightning" />
    <div class="slds">
        <div class="slds-grid">
            <div class="slds-col"><div id="formSelection" /></div>
            <div class="slds-col"><div id="objectSelection" /></div>
        </div>
    </div>
    
    <div id="sldsSpinner" />
    
    
      <script>
        $Lightning.use("c:LtPOfCom", function() {
                $Lightning.createComponent(
                    "c:GC",
                    {},
                    "formSelection"
                );
                $Lightning.createComponent(
                    "c:GeneralPC",
                    {},
                    "objectSelection"
                );
               
            }
        );
    </script>

</apex:page>

It is not working on public site. 

error: http://test-123-developer-edition.ap2.force.com/test/c/LatestPackageOfComponents.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT


Could anyone please solve this issue.

Thanks in advance
I was working with SOBject Lookup Lightning component using this link:https://meltedwires.com/2015/10/27/salesforce-lightning-lookup-component/
Its working cool!!but now i want to display this component via vfpage.Actually I have written this code:

 
<apex:page standardController="Opportunity">
 <apex:includeLightning />

    <div id="myDivId"/> 



  <script>
        $Lightning.use("c:Lookup", function() {
          $Lightning.createComponent("c:AccountLookup",
          { label : "" },
          "myDivId",
          function(cmp) {
            // do some stuff
          });
        });
    </script>




</apex:page>


Can anyone Help me with it! Thanksin advance!!
Here is my Visualforce code:

 
<apex:form id="frm">
<div  style="width:50%;">
        <apex:pageMessages escape="false" ></apex:pageMessages> </div>

    <apex:inputHidden value="{!abc}" id="abc"/>
    <div id="selctMaster">
    <apex:pageBlock id="adminValues">
    
    <apex:pageBlockSection columns="1" collapsible="false" >  
     
    
    <label class="slds-form-element__label"  style="font-weight:bold;color:black;margin-top:10px;font-size:20px;color: #2574a9;test-align:right;">Configure Settings</label>   
  
    <apex:pageBlockSectionItem labelStyle="background-color:#F4F6F9;" > 
       <apex:outputpanel >
        <table style="width:100%">

           <tbody>
             <div class="slds-form-element__row" >  
             <div style="width:50%;">

                 <div class="slds-form-element">  
                   <apex:outputLabel styleClass="slds-form-element__label">Account name:</apex:outputLabel>  
                   <apex:inputText value="{!name}" styleClass="slds-form-element__control slds-input"/>  
                 </div>  
               </div>                

                
      
            </tbody>
        </table>
         </apex:outputpanel>
          </apex:pageBlockSectionItem> 
       </apex:pageBlockSection>


 <div class="slds-p-horizontal--small slds-m-top--medium slds-size--1-of-1 slds-align--absolute-center">
            <apex:commandButton styleclass="slds-button slds-button--brand" value="Save" action="{!abcds}" status="actStatusId" reRender="frm"  />
            </div>


</apex:pageBlock>
            </div>

on button press , Pageblock will be no longer to appear. Can anyone please tell me whats the issue with it?

Thanks in advance 
I am trying to get id from value but i dont know why its not working.Can you please identify what is the issue with this

 
trigger MapDEmo on final__c (before insert,before update) {
    
    list<final__c> alist=new list<final__c>();
    integer mont;
    integer yr;
    Integer yyr;
    List<Matrix__c> mtx;
    Integer mnth_to_trade;
    Map<String,Id> matMap =new Map<String,Id>() ;

    
    for(final__c a:trigger.new) {
        alist.add(a);  }
                
 
    
        mtx=[select id,Cumulative__c,Calendar_Month__c,Fiscal_Year__c from database__c ];
        
        for(database__c mm:mtx){
         
          matMap.put(mm.Calendar_Month__c+mm.Fiscal_Year__c,mm.id);
         
        }
     
        
        system.debug('mappppp'+matMap);
        
        for(final__c af:alist) {
        
        
        if(af.Date_Won__c!=null)  {
        mont=af.Date_Won__c.month();
        yr=af.Date_Won__c.year(); 
        yyr=Integer.valueof(string.valueof(yr).right(2));
        }
        System.debug('Year : ' + yyr);
        System.debug('Month : ' + mont);
        
        if(mont < 6) {
            yyr = Integer.valueof((yyr-1) +''+ yyr);}
        else {
            yyr = Integer.valueof(yyr +''+ (yyr+1));
        }   
        
        String final__cl= string.valueof(mont+yyr);
        
                system.debug('mmmyyy'+mont+yyr);

        system.debug('ccccccccccc'+matMap.get(final__cl));
        
        //   af.Cumulative__c = matMap.get(string.valueof(mont+yyr)).Cumulative__c;

             
             } 
       
  
}

I want to get id of Database__c object when value match. Help me ! Thanks in advance
trigger PreviousGLSalesHandling on financialData__c (before  insert) {
    
    list<financialData__c> saleList = new list<financialData__c>();
    list<string> saleListacc = new list<string>();

    for(financialData__c s:trigger.new) {
        saleList.add(s);     
        saleListacc.add(s.account__c);
    }
    
    list<financialData__c> sllist = [select id,Year__c,Month__c,Account__c,GL_Sales__c, Land_Comm__c from financialData__c where account__C in:saleListacc];
    
    for(financialData__c  st: saleList)   {
        
        for(financialData__c sm: sllist){
            
            if(st.Year__c!=null && st.Month__c!=null && st.Account__c!=null && sm.Year__c!=null && sm.Month__c!=null && sm.Account__c!=null ){
                
                String yr = String.valueof(st.Year__c-1);
                String mnth = String.valueof(st.Month__c);
                
                integer monthhh;
                
                if(mnth=='jan'){monthhh=1;}
                else if(mnth=='feb'){monthhh=2;}
                else if(mnth=='mar'){monthhh=3;}
                else if(mnth=='apr'){monthhh=4;}
                else if(mnth=='may'){monthhh=5;}
                else if(mnth=='jun'){monthhh=6;}
                else if(mnth=='jul'){monthhh=7;}
                else if(mnth=='aug'){monthhh=8;}
                else if(mnth=='sep'){monthhh=9;}
                else if(mnth=='oct'){monthhh=10;}
                else if(mnth=='nov'){monthhh=11;}
                else if(mnth=='dec'){monthhh=12;}
                
                String  acc = st.Account__c;
                Date dd = Date.newInstance(integer.valueof(st.year__c),monthhh, 1);
                
                Integer numberOfDays = Date.daysInMonth(dd.year(), dd.month());
                Date lastDayOfMonth = Date.newInstance(dd.year(), dd.month(), numberOfDays);
                
                system.debug('sssssssssss'+numberOfDays );
                
                st.Start_Day_of_Month__c = '1';
                st.End_Day_of_Month__c = string.valueof(numberOfDays) ;
                
                if(yr.contains(String.valueof(sm.Year__c)) && mnth.contains(String.valueof(sm.Month__c)) && acc.contains(sm.Account__c)){
                    
                    st.Previous_year_GL_Sales__c = sm.GL_Sales__c;
                    //st.Previous_Year_Comm__c = sm.Land_Comm__c;
                }
            }
        }
    }
}




I am getting errro of CPU time exceed. Please help me! Thanks in advance
Display popup when logged user 'Contact' is having birthday today, Please help me with this

Thanks 
I am trying to dispay multiple lightning components using sites vfpage.
 
<apex:page sidebar="false" showHeader="false" standardStylesheets="false">

    <apex:includeLightning />
    <div id="lightning" />
    <div class="slds">
        <div class="slds-grid">
            <div class="slds-col"><div id="formSelection" /></div>
            <div class="slds-col"><div id="objectSelection" /></div>
        </div>
    </div>
    
    <div id="sldsSpinner" />
    
    
      <script>
        $Lightning.use("c:LtPOfCom", function() {
                $Lightning.createComponent(
                    "c:GC",
                    {},
                    "formSelection"
                );
                $Lightning.createComponent(
                    "c:GeneralPC",
                    {},
                    "objectSelection"
                );
               
            }
        );
    </script>

</apex:page>

It is not working on public site. 

error: http://test-123-developer-edition.ap2.force.com/test/c/LatestPackageOfComponents.app?aura.format=JSON&aura.formatAdapter=LIGHTNING_OUT


Could anyone please solve this issue.

Thanks in advance
I was working with SOBject Lookup Lightning component using this link:https://meltedwires.com/2015/10/27/salesforce-lightning-lookup-component/
Its working cool!!but now i want to display this component via vfpage.Actually I have written this code:

 
<apex:page standardController="Opportunity">
 <apex:includeLightning />

    <div id="myDivId"/> 



  <script>
        $Lightning.use("c:Lookup", function() {
          $Lightning.createComponent("c:AccountLookup",
          { label : "" },
          "myDivId",
          function(cmp) {
            // do some stuff
          });
        });
    </script>




</apex:page>


Can anyone Help me with it! Thanksin advance!!
I am trying to get id from value but i dont know why its not working.Can you please identify what is the issue with this

 
trigger MapDEmo on final__c (before insert,before update) {
    
    list<final__c> alist=new list<final__c>();
    integer mont;
    integer yr;
    Integer yyr;
    List<Matrix__c> mtx;
    Integer mnth_to_trade;
    Map<String,Id> matMap =new Map<String,Id>() ;

    
    for(final__c a:trigger.new) {
        alist.add(a);  }
                
 
    
        mtx=[select id,Cumulative__c,Calendar_Month__c,Fiscal_Year__c from database__c ];
        
        for(database__c mm:mtx){
         
          matMap.put(mm.Calendar_Month__c+mm.Fiscal_Year__c,mm.id);
         
        }
     
        
        system.debug('mappppp'+matMap);
        
        for(final__c af:alist) {
        
        
        if(af.Date_Won__c!=null)  {
        mont=af.Date_Won__c.month();
        yr=af.Date_Won__c.year(); 
        yyr=Integer.valueof(string.valueof(yr).right(2));
        }
        System.debug('Year : ' + yyr);
        System.debug('Month : ' + mont);
        
        if(mont < 6) {
            yyr = Integer.valueof((yyr-1) +''+ yyr);}
        else {
            yyr = Integer.valueof(yyr +''+ (yyr+1));
        }   
        
        String final__cl= string.valueof(mont+yyr);
        
                system.debug('mmmyyy'+mont+yyr);

        system.debug('ccccccccccc'+matMap.get(final__cl));
        
        //   af.Cumulative__c = matMap.get(string.valueof(mont+yyr)).Cumulative__c;

             
             } 
       
  
}

I want to get id of Database__c object when value match. Help me ! Thanks in advance
trigger PreviousGLSalesHandling on financialData__c (before  insert) {
    
    list<financialData__c> saleList = new list<financialData__c>();
    list<string> saleListacc = new list<string>();

    for(financialData__c s:trigger.new) {
        saleList.add(s);     
        saleListacc.add(s.account__c);
    }
    
    list<financialData__c> sllist = [select id,Year__c,Month__c,Account__c,GL_Sales__c, Land_Comm__c from financialData__c where account__C in:saleListacc];
    
    for(financialData__c  st: saleList)   {
        
        for(financialData__c sm: sllist){
            
            if(st.Year__c!=null && st.Month__c!=null && st.Account__c!=null && sm.Year__c!=null && sm.Month__c!=null && sm.Account__c!=null ){
                
                String yr = String.valueof(st.Year__c-1);
                String mnth = String.valueof(st.Month__c);
                
                integer monthhh;
                
                if(mnth=='jan'){monthhh=1;}
                else if(mnth=='feb'){monthhh=2;}
                else if(mnth=='mar'){monthhh=3;}
                else if(mnth=='apr'){monthhh=4;}
                else if(mnth=='may'){monthhh=5;}
                else if(mnth=='jun'){monthhh=6;}
                else if(mnth=='jul'){monthhh=7;}
                else if(mnth=='aug'){monthhh=8;}
                else if(mnth=='sep'){monthhh=9;}
                else if(mnth=='oct'){monthhh=10;}
                else if(mnth=='nov'){monthhh=11;}
                else if(mnth=='dec'){monthhh=12;}
                
                String  acc = st.Account__c;
                Date dd = Date.newInstance(integer.valueof(st.year__c),monthhh, 1);
                
                Integer numberOfDays = Date.daysInMonth(dd.year(), dd.month());
                Date lastDayOfMonth = Date.newInstance(dd.year(), dd.month(), numberOfDays);
                
                system.debug('sssssssssss'+numberOfDays );
                
                st.Start_Day_of_Month__c = '1';
                st.End_Day_of_Month__c = string.valueof(numberOfDays) ;
                
                if(yr.contains(String.valueof(sm.Year__c)) && mnth.contains(String.valueof(sm.Month__c)) && acc.contains(sm.Account__c)){
                    
                    st.Previous_year_GL_Sales__c = sm.GL_Sales__c;
                    //st.Previous_Year_Comm__c = sm.Land_Comm__c;
                }
            }
        }
    }
}




I am getting errro of CPU time exceed. Please help me! Thanks in advance