• Amulya
  • NEWBIE
  • 55 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 16
    Replies
Hi All,
I am not able to write the test class code to cover highlighted lines in below trigger code. Please help.

trigger AddPrimaryContRole on Opportunity (after insert, after update) 
{
    for (Opportunity o : Trigger.new) 
    {   
        Integer i=0, j=0;  
        if(Trigger.isUpdate && (o.Primary_Contact_Name__c != trigger.oldMap.get(o.Id).Primary_Contact_Name__c || o.Primary_Contact_Role__c !=trigger.oldMap.get(o.Id).Primary_Contact_Role__c))
        {

            List<OpportunityContactRole> ocrl = [select id, ContactId, Opportunityid, role, isPrimary from OpportunityContactRole where opportunityid =: o.Id];
            system.debug('Queried OCR:'+ocrl);
            
            if(ocrl.size() == 0)
            {
               system.debug('Entered IF');
               OpportunityContactRole new_ocr = new OpportunityContactRole();
               new_ocr.opportunityid = o.Id;
               new_ocr.role = o.Primary_Contact_Role__c;
               new_ocr.ContactId = o.Primary_Contact_Name__c;
               new_ocr.isPrimary = true;
               Insert(new_ocr);
               system.debug('Inserted OCR:'+new_ocr);
            }
            else
            {
                for(OpportunityContactRole oc: ocrl)
                {
                    if(oc.contactId == o.Primary_Contact_Name__c)
                    {
                        i++;
                        oc.isPrimary = true;
                        oc.role = o.Primary_Contact_Role__c;
                        Update oc;
                    } 
                 }
                 if(i==0)
                     j++;

             }
         }   
         if(Trigger.isInsert || j>0)
         { 
            OpportunityContactRole new_ocr = new OpportunityContactRole();
            new_ocr.opportunityid = o.Id;
            new_ocr.role = o.Primary_Contact_Role__c;
            new_ocr.ContactId = o.Primary_Contact_Name__c;
            new_ocr.isPrimary = true;
            Insert(new_ocr);
         }                
    }
}
  • September 17, 2018
  • Like
  • 0
Hi all,
I am facing a familiar issue on Viewstates but not able to figure out what's causing it. 
Internal is holding 210KB
Internal is holding 210KB though my VF page has single Form. Below is the code.
<apex:page standardController="Account" extensions="AccountServiceControllerExtension2" readOnly="true" id="page">
    
    <style type="text/css">        
   
       .vfTableMainInfo {
            table-layout:fixed;
            word-wrap:break-word;
            overflow:hidden; 
            width: 50px;
                       
        }
        
        .vfTable {
            table-layout:fixed;
            word-wrap:break-word;
            overflow:hidden; 
            width: 50px;
}
        .expandFoldText{
            color: rgb(1,91,167);           
        }
        .expandFoldText1{
            color: rgb(1,91,167);           
        }       
        .expandFoldText2{
            color: rgb(1,91,167);    
            display: none;       
        }
       
    </style>
     
    <apex:form id="form">
   
    <apex:pageBlock id="main1" title="Service Data">    
              <apex:repeat id="repeat" value="{!allList}" var="innerList">
                       
        <apex:pageBlockTable id="subTable1" value="{!innerList}" var="item" styleClass="vfTable">        
                                   
             <apex:column >

                     <label id="plus{!innerList[0][14]}" class="expandFoldText1" onmouseover="componentColorMouseOver(this);"  onmouseout="componentColorMouseOut(this);" onclick="expandProudct1(this,{!innerList[0][14]});" >(+)</label>
                     <label id="minus{!innerList[0][14]}" class="expandFoldText2" onmouseover="componentColorMouseOver(this);"  onmouseout="componentColorMouseOut(this);" onclick="expandProudct2(this,{!innerList[0][14]});">(-) </label>

                     {!item[0]}
                    <apex:facet name="header">                        
                       <label>Product</label>
                    </apex:facet> 
             </apex:column>

             
             <apex:column value="{!item[1]}">

                    <apex:facet name="header">Status</apex:facet>
            
             </apex:column>
             <apex:column value="{!item[2]}">
                    <apex:facet name="header">Abstract</apex:facet>
             </apex:column>
             <apex:column value="{!item[3]}">
                    <apex:facet name="header">Date Open</apex:facet>
             </apex:column>
  
        </apex:pageBlockTable>     
        
        
        <div id="{!innerList[0][14]}" style="display:none">
                              
        <apex:pageBlockTable id="subTable2" value="{!innerList}" var="item" styleClass="vfTable">               
             <apex:column >
                    <apex:facet name="header"></apex:facet>
             </apex:column>       
             <apex:column value="{!item[4]}">
                    <apex:facet name="header">Name</apex:facet>
             </apex:column>
             <apex:column value="{!item[5]}">
                    <apex:facet name="header">SR Number</apex:facet>
             </apex:column>
             <apex:column value="{!item[6]}">
                    <apex:facet name="header">Date Closed</apex:facet>
             </apex:column>                           
        </apex:pageBlockTable>       
        
        <apex:pageBlockTable id="subTable3" value="{!innerList}" var="item" styleClass="vfTable">               
             <apex:column >
                    <apex:facet name="header"></apex:facet>
             </apex:column>       
             <apex:column value="{!item[7]}">
                    <apex:facet name="header">Resolution</apex:facet>
             </apex:column>
             <apex:column value="{!item[8]}">
                    <apex:facet name="header">Owner</apex:facet>
             </apex:column>
             <apex:column value="{!item[9]}">
                    <apex:facet name="header"></apex:facet>
             </apex:column>                           
        </apex:pageBlockTable> 
          
        </div>
        
        </apex:repeat>        
    </apex:pageBlock>

    </apex:form>
    
    <script>
  
          function hideAllHeader(){
            var headerList=document.getElementsByClassName("headerRow");
            tableList=document.getElementsByTagName("table");
            var aTable;                        
            var headers;
           
            var test=tableList[3];

                        
          for (var i = 0; i < tableList.length; i++) {
            if((tableList[i].id!=="page:form:main1:repeat:0:subTable1")&&(tableList[i].id.indexOf("page:form:main1:repeat:")===0)){           
                headers=tableList[i].getElementsByTagName("thead");                
                for(var j =0; j<headers.length; j++){
                    headers[j].style.display="none";  
                }
               }                                            
            }
         }
         
         hideAllHeader();      
                            
   </script>
    
    <script>
         window.onload = function(){
             hideAllHeader();               
         };   
    
         function componentColorMouseOver(component){
             //component.style.color="rgb(1,91,167)";
             component.style.color="red";
         }
         
         function componentColorMouseOut(component){
             //component.style.color="black";
             component.style.color="rgb(1,91,167)";
         }
         
                          
         function expandProudct1(t, div){
         
             var headerId=div.id.replace("pageBlockTable","page:form:main1:repeat:"); //page:form:main1:repeat:0:subTable1
             var headerId1=headerId+":subTable1";
             var headerId2=headerId+":subTable2";
             
             var headerId3=headerId+":subTable3";
                         
             var tableElem1=document.getElementById(headerId1);
             var headersElem1=tableElem1.getElementsByTagName("thead"); 
             var tableElem2=document.getElementById(headerId2);
             var headersElem2=tableElem2.getElementsByTagName("thead"); 
             var tableElem3=document.getElementById(headerId3);
             var headersElem3=tableElem3.getElementsByTagName("thead"); 
                          
             
             var curDisplay=String(div.style.display);
             if(curDisplay==='none'){             
                 //expand/fold table
                 div.style.display="inline";        
                 
                 t.style.display="none"; //hide/display plus and minus sine                 
                 document.getElementById(t.id.replace("plus","minus")).style.display="inline";    //hide/display plus and minus sine
                 
                 //expand/fold table header
                 if(headerId1.indexOf("page:form:main1:repeat:0:subTable1")===-1){
                     for(var x1 =0; x1<headersElem1.length; x1++){
                         headersElem1[x1].style.display="table-row-group";  
                     }
                 }    
                 for(var x2 =0; x2<headersElem1.length; x2++){
                     headersElem2[x2].style.display="table-row-group";  
                 }  
                 for(var x3 =0; x3<headersElem1.length; x3++){
                     headersElem3[x3].style.display="table-row-group";  
                 }  
                
             }    
                 
         }
         
                  
         function expandProudct2(t, div){
         
             var headerId=div.id.replace("pageBlockTable","page:form:main1:repeat:"); //page:form:main1:repeat:0:subTable1
             var headerId1=headerId+":subTable1";
             var headerId2=headerId+":subTable2";
             var headerId3=headerId+":subTable3";
                         
             var tableElem1=document.getElementById(headerId1);
             var headersElem1=tableElem1.getElementsByTagName("thead"); 
             var tableElem2=document.getElementById(headerId2);
             var headersElem2=tableElem2.getElementsByTagName("thead"); 
             var tableElem3=document.getElementById(headerId3);
             var headersElem3=tableElem3.getElementsByTagName("thead"); 
            
             var curDisplay=String(div.style.display);            
             if(curDisplay=='inline'){
                 div.style.display="none";
                 t.style.display="none"; 
                 document.getElementById(t.id.replace("minus","plus")).style.display="inline";   
             
 //expand/fold table header
                 
                 if(headerId1.indexOf("page:form:main1:repeat:0:subTable1")===-1){
                     for(var x1 =0; x1<headersElem1.length; x1++){
                         headersElem1[x1].style.display="none";  
                     }
                 }
                 for(var x2 =0; x2<headersElem1.length; x2++){
                     headersElem2[x2].style.display="none";  
                 }  
                 for(var x3 =0; x3<headersElem1.length; x3++){
                     headersElem3[x3].style.display="none";  
                 } 
                
             }      
             
         }
         function displayAllColumns(){
             document.getElementById("pageBlock1").style.display="none";    
             document.getElementById("pageBlock2").style.display="inline";    
         }
         
         function displayMainColumns(){
             document.getElementById("pageBlock2").style.display="none";    
             document.getElementById("pageBlock1").style.display="inline";    
         }
                  
    </script>
</apex:page>
We are using a HTTP Restful Outbound Webservice which was working fine for 2 years but suddenly stopped working which we are not able to understand the reason. It's giving below error. 'System.CalloutException: Unable to tunnel through proxy. Proxy returns "HTTP/1.0 404 Not Found"'. It's based on TLS 1.0 protocol so expect it to work till July 22nd atleast. It looks like Firewall issue to us, but our internal Network team is claiming that, the outbound request from Salesforce is not reaching our Firewall as per logs though IP's provided by Salesforce are correctly whitelisted. But this is working in Sandboxes so we don't think it's Salesforce issue. I would like to know if there is a tool or by any means, can we ping our ESB servers from Salesforce instance?
Below code we use to invoke web service.
public class postCall(String siebelId )
{
Http h = new Http(); HttpRequest req = new HttpRequest();
req.setEndpoint('https://esb.ent.abc.org/ServiceRequest');
req.setMethod('POST');
req.setBody('{"ocl:accountId":"'+siebelId+'"}');
req.setHeader('Token', '9fdb3ab5-efc8-473f-bc5e-a474b0b9d1e2');
HttpResponse res = h.send(req);
System.debug(res.getBody());
}
Hi All,

I am beginner to SF Web Services and have got a requirement to Integrate SF and SAP Business Objects(BOJ). Basically I need to create a Visualforce page which fetches Service Request records from BOJ and display as related list under Accounts. Can anybody suggest how to start with. Whether to go for SOAP or REST API. Any suggestions related to Integration strategies is much appreciated. This is kind of temporary solution so our Management doesn't want to go for any paid service.
Thanks.
  • February 10, 2017
  • Like
  • 0
We have a Webservice implementation done by some consultants which uses Rest API. We are trying to trace the code and understand. It looks like, we have used JSON Id tokens for authentication. Wanted to know if there is any expiry period for that and how to generate those tokens. We see that token value is same in Sandboxes as well as Production. Please find below the code snippet of JSON Parser.
public list<map<String,String>> parseJason(String result)
{
Map<String, String> amap=new Map<string, String>();
List<map<String,String>> mapList=new List<map<String,String>>();
if(result==''||result==null)
{ return mapList; }
Map<String, String> tempMap;
JSONParser parser = JSON.createParser(result);
boolean flag=false;
while (parser.nextToken() != null) { //System.debug('----');
if ((parser.getCurrentToken() == JSONToken.FIELD_NAME))
{ String fieldName = parser.getText();
if(flag)
{
if(fieldName=='abstract')
{ ......}
} } }
  • February 06, 2017
  • Like
  • 0
For one of our Inbound web service, external system has moved to different server and we have updated new URL in Remote site setting and Apex class. Still it's not able to fetch data. We even whitelisted the external IP address but still data is not fetched.
  • December 09, 2016
  • Like
  • 0
Below is my trigger and I am not sure how to write test class for trigger with validations and adding errors. Please help.
My trigger:
trigger PreventTaskDelete on Task (before delete) 
{
    String ProfileId = UserInfo.getProfileId();  
   List<Profile> profiles=[select id from Profile where name='System Administrator'];

   if (profiles.size() == 1)
   {
      for (Task a : Trigger.old)      
       {            
          if (profileId != profiles[0].id)
          {  a.addError('Activities should not be deleted, it can only be Closed');
          }
       }
   }
  • October 28, 2016
  • Like
  • 0
Whenever I try to login with my password, it says Invalid Username/password. When I reset it and try logging in, first time it allows but next time when I try to login, again it doesn't let me in. This is happening from the last PROD to Sandbox migration we did 10 days ago.
Does anybody experienced the same?
  • September 23, 2016
  • Like
  • 0
Hi All,
I have a requirement where, we need to send an Email on the status of failed Bulk Data Load jobs. But I am not sure the Object Name or how to refer those jobs programatically in my APex code. When I use 'AsyncApexJob', it's referring to Scheduled Apex Jobs. But I want the reference of Bulk Data Load Jobs. (Bulk Data Load jobs will be submitted by Mule ESB process using Salesforce Connectors.) Any info on this helps.
Thanks.
  • September 07, 2016
  • Like
  • 0
Hi All,
I am not able to write the test class code to cover highlighted lines in below trigger code. Please help.

trigger AddPrimaryContRole on Opportunity (after insert, after update) 
{
    for (Opportunity o : Trigger.new) 
    {   
        Integer i=0, j=0;  
        if(Trigger.isUpdate && (o.Primary_Contact_Name__c != trigger.oldMap.get(o.Id).Primary_Contact_Name__c || o.Primary_Contact_Role__c !=trigger.oldMap.get(o.Id).Primary_Contact_Role__c))
        {

            List<OpportunityContactRole> ocrl = [select id, ContactId, Opportunityid, role, isPrimary from OpportunityContactRole where opportunityid =: o.Id];
            system.debug('Queried OCR:'+ocrl);
            
            if(ocrl.size() == 0)
            {
               system.debug('Entered IF');
               OpportunityContactRole new_ocr = new OpportunityContactRole();
               new_ocr.opportunityid = o.Id;
               new_ocr.role = o.Primary_Contact_Role__c;
               new_ocr.ContactId = o.Primary_Contact_Name__c;
               new_ocr.isPrimary = true;
               Insert(new_ocr);
               system.debug('Inserted OCR:'+new_ocr);
            }
            else
            {
                for(OpportunityContactRole oc: ocrl)
                {
                    if(oc.contactId == o.Primary_Contact_Name__c)
                    {
                        i++;
                        oc.isPrimary = true;
                        oc.role = o.Primary_Contact_Role__c;
                        Update oc;
                    } 
                 }
                 if(i==0)
                     j++;

             }
         }   
         if(Trigger.isInsert || j>0)
         { 
            OpportunityContactRole new_ocr = new OpportunityContactRole();
            new_ocr.opportunityid = o.Id;
            new_ocr.role = o.Primary_Contact_Role__c;
            new_ocr.ContactId = o.Primary_Contact_Name__c;
            new_ocr.isPrimary = true;
            Insert(new_ocr);
         }                
    }
}
  • September 17, 2018
  • Like
  • 0
Hi all,
I am facing a familiar issue on Viewstates but not able to figure out what's causing it. 
Internal is holding 210KB
Internal is holding 210KB though my VF page has single Form. Below is the code.
<apex:page standardController="Account" extensions="AccountServiceControllerExtension2" readOnly="true" id="page">
    
    <style type="text/css">        
   
       .vfTableMainInfo {
            table-layout:fixed;
            word-wrap:break-word;
            overflow:hidden; 
            width: 50px;
                       
        }
        
        .vfTable {
            table-layout:fixed;
            word-wrap:break-word;
            overflow:hidden; 
            width: 50px;
}
        .expandFoldText{
            color: rgb(1,91,167);           
        }
        .expandFoldText1{
            color: rgb(1,91,167);           
        }       
        .expandFoldText2{
            color: rgb(1,91,167);    
            display: none;       
        }
       
    </style>
     
    <apex:form id="form">
   
    <apex:pageBlock id="main1" title="Service Data">    
              <apex:repeat id="repeat" value="{!allList}" var="innerList">
                       
        <apex:pageBlockTable id="subTable1" value="{!innerList}" var="item" styleClass="vfTable">        
                                   
             <apex:column >

                     <label id="plus{!innerList[0][14]}" class="expandFoldText1" onmouseover="componentColorMouseOver(this);"  onmouseout="componentColorMouseOut(this);" onclick="expandProudct1(this,{!innerList[0][14]});" >(+)</label>
                     <label id="minus{!innerList[0][14]}" class="expandFoldText2" onmouseover="componentColorMouseOver(this);"  onmouseout="componentColorMouseOut(this);" onclick="expandProudct2(this,{!innerList[0][14]});">(-) </label>

                     {!item[0]}
                    <apex:facet name="header">                        
                       <label>Product</label>
                    </apex:facet> 
             </apex:column>

             
             <apex:column value="{!item[1]}">

                    <apex:facet name="header">Status</apex:facet>
            
             </apex:column>
             <apex:column value="{!item[2]}">
                    <apex:facet name="header">Abstract</apex:facet>
             </apex:column>
             <apex:column value="{!item[3]}">
                    <apex:facet name="header">Date Open</apex:facet>
             </apex:column>
  
        </apex:pageBlockTable>     
        
        
        <div id="{!innerList[0][14]}" style="display:none">
                              
        <apex:pageBlockTable id="subTable2" value="{!innerList}" var="item" styleClass="vfTable">               
             <apex:column >
                    <apex:facet name="header"></apex:facet>
             </apex:column>       
             <apex:column value="{!item[4]}">
                    <apex:facet name="header">Name</apex:facet>
             </apex:column>
             <apex:column value="{!item[5]}">
                    <apex:facet name="header">SR Number</apex:facet>
             </apex:column>
             <apex:column value="{!item[6]}">
                    <apex:facet name="header">Date Closed</apex:facet>
             </apex:column>                           
        </apex:pageBlockTable>       
        
        <apex:pageBlockTable id="subTable3" value="{!innerList}" var="item" styleClass="vfTable">               
             <apex:column >
                    <apex:facet name="header"></apex:facet>
             </apex:column>       
             <apex:column value="{!item[7]}">
                    <apex:facet name="header">Resolution</apex:facet>
             </apex:column>
             <apex:column value="{!item[8]}">
                    <apex:facet name="header">Owner</apex:facet>
             </apex:column>
             <apex:column value="{!item[9]}">
                    <apex:facet name="header"></apex:facet>
             </apex:column>                           
        </apex:pageBlockTable> 
          
        </div>
        
        </apex:repeat>        
    </apex:pageBlock>

    </apex:form>
    
    <script>
  
          function hideAllHeader(){
            var headerList=document.getElementsByClassName("headerRow");
            tableList=document.getElementsByTagName("table");
            var aTable;                        
            var headers;
           
            var test=tableList[3];

                        
          for (var i = 0; i < tableList.length; i++) {
            if((tableList[i].id!=="page:form:main1:repeat:0:subTable1")&&(tableList[i].id.indexOf("page:form:main1:repeat:")===0)){           
                headers=tableList[i].getElementsByTagName("thead");                
                for(var j =0; j<headers.length; j++){
                    headers[j].style.display="none";  
                }
               }                                            
            }
         }
         
         hideAllHeader();      
                            
   </script>
    
    <script>
         window.onload = function(){
             hideAllHeader();               
         };   
    
         function componentColorMouseOver(component){
             //component.style.color="rgb(1,91,167)";
             component.style.color="red";
         }
         
         function componentColorMouseOut(component){
             //component.style.color="black";
             component.style.color="rgb(1,91,167)";
         }
         
                          
         function expandProudct1(t, div){
         
             var headerId=div.id.replace("pageBlockTable","page:form:main1:repeat:"); //page:form:main1:repeat:0:subTable1
             var headerId1=headerId+":subTable1";
             var headerId2=headerId+":subTable2";
             
             var headerId3=headerId+":subTable3";
                         
             var tableElem1=document.getElementById(headerId1);
             var headersElem1=tableElem1.getElementsByTagName("thead"); 
             var tableElem2=document.getElementById(headerId2);
             var headersElem2=tableElem2.getElementsByTagName("thead"); 
             var tableElem3=document.getElementById(headerId3);
             var headersElem3=tableElem3.getElementsByTagName("thead"); 
                          
             
             var curDisplay=String(div.style.display);
             if(curDisplay==='none'){             
                 //expand/fold table
                 div.style.display="inline";        
                 
                 t.style.display="none"; //hide/display plus and minus sine                 
                 document.getElementById(t.id.replace("plus","minus")).style.display="inline";    //hide/display plus and minus sine
                 
                 //expand/fold table header
                 if(headerId1.indexOf("page:form:main1:repeat:0:subTable1")===-1){
                     for(var x1 =0; x1<headersElem1.length; x1++){
                         headersElem1[x1].style.display="table-row-group";  
                     }
                 }    
                 for(var x2 =0; x2<headersElem1.length; x2++){
                     headersElem2[x2].style.display="table-row-group";  
                 }  
                 for(var x3 =0; x3<headersElem1.length; x3++){
                     headersElem3[x3].style.display="table-row-group";  
                 }  
                
             }    
                 
         }
         
                  
         function expandProudct2(t, div){
         
             var headerId=div.id.replace("pageBlockTable","page:form:main1:repeat:"); //page:form:main1:repeat:0:subTable1
             var headerId1=headerId+":subTable1";
             var headerId2=headerId+":subTable2";
             var headerId3=headerId+":subTable3";
                         
             var tableElem1=document.getElementById(headerId1);
             var headersElem1=tableElem1.getElementsByTagName("thead"); 
             var tableElem2=document.getElementById(headerId2);
             var headersElem2=tableElem2.getElementsByTagName("thead"); 
             var tableElem3=document.getElementById(headerId3);
             var headersElem3=tableElem3.getElementsByTagName("thead"); 
            
             var curDisplay=String(div.style.display);            
             if(curDisplay=='inline'){
                 div.style.display="none";
                 t.style.display="none"; 
                 document.getElementById(t.id.replace("minus","plus")).style.display="inline";   
             
 //expand/fold table header
                 
                 if(headerId1.indexOf("page:form:main1:repeat:0:subTable1")===-1){
                     for(var x1 =0; x1<headersElem1.length; x1++){
                         headersElem1[x1].style.display="none";  
                     }
                 }
                 for(var x2 =0; x2<headersElem1.length; x2++){
                     headersElem2[x2].style.display="none";  
                 }  
                 for(var x3 =0; x3<headersElem1.length; x3++){
                     headersElem3[x3].style.display="none";  
                 } 
                
             }      
             
         }
         function displayAllColumns(){
             document.getElementById("pageBlock1").style.display="none";    
             document.getElementById("pageBlock2").style.display="inline";    
         }
         
         function displayMainColumns(){
             document.getElementById("pageBlock2").style.display="none";    
             document.getElementById("pageBlock1").style.display="inline";    
         }
                  
    </script>
</apex:page>
Hi All,

I am beginner to SF Web Services and have got a requirement to Integrate SF and SAP Business Objects(BOJ). Basically I need to create a Visualforce page which fetches Service Request records from BOJ and display as related list under Accounts. Can anybody suggest how to start with. Whether to go for SOAP or REST API. Any suggestions related to Integration strategies is much appreciated. This is kind of temporary solution so our Management doesn't want to go for any paid service.
Thanks.
  • February 10, 2017
  • Like
  • 0
We have a Webservice implementation done by some consultants which uses Rest API. We are trying to trace the code and understand. It looks like, we have used JSON Id tokens for authentication. Wanted to know if there is any expiry period for that and how to generate those tokens. We see that token value is same in Sandboxes as well as Production. Please find below the code snippet of JSON Parser.
public list<map<String,String>> parseJason(String result)
{
Map<String, String> amap=new Map<string, String>();
List<map<String,String>> mapList=new List<map<String,String>>();
if(result==''||result==null)
{ return mapList; }
Map<String, String> tempMap;
JSONParser parser = JSON.createParser(result);
boolean flag=false;
while (parser.nextToken() != null) { //System.debug('----');
if ((parser.getCurrentToken() == JSONToken.FIELD_NAME))
{ String fieldName = parser.getText();
if(flag)
{
if(fieldName=='abstract')
{ ......}
} } }
  • February 06, 2017
  • Like
  • 0
Below is my trigger and I am not sure how to write test class for trigger with validations and adding errors. Please help.
My trigger:
trigger PreventTaskDelete on Task (before delete) 
{
    String ProfileId = UserInfo.getProfileId();  
   List<Profile> profiles=[select id from Profile where name='System Administrator'];

   if (profiles.size() == 1)
   {
      for (Task a : Trigger.old)      
       {            
          if (profileId != profiles[0].id)
          {  a.addError('Activities should not be deleted, it can only be Closed');
          }
       }
   }
  • October 28, 2016
  • Like
  • 0
Whenever I try to login with my password, it says Invalid Username/password. When I reset it and try logging in, first time it allows but next time when I try to login, again it doesn't let me in. This is happening from the last PROD to Sandbox migration we did 10 days ago.
Does anybody experienced the same?
  • September 23, 2016
  • Like
  • 0
Hi,

I just want to know if i can use the Marketing Cloud connector tool with my Sales Cloud developer edition. I already have access to a Marketing Cloud platform and i want to link both of them to be see what can be done once both of the platform are link (to train myself).
Can I do that ?

Thank you for your help.
Any one can suggest any PDF or Example on Web Services and Salesforce Integration?
i am going through few PDF's and links but not able to get hands on practise  properly how to use SOAP, REST,WSDL step by step?
Is any Practical example step by step?
Hi, I'm trying to add an External Data Source of type Lightning Connect: OData 2.0 as described near the end of this article [1] but when I am on the New External Data Source [2] page, the only type in the dropdown is Simple URL.  I've checked Enable Lightning Components in the Develop | Lightning Components (Beta) menu.

Is there anything else I need to do to be able to select "Lightning Connect: OData 2.0" in the Type dropdown?  Thanks!

[1] https://developer.salesforce.com/blogs/developer-relations/2015/03/accessing-sql-server-azure-database-lightning-connect.html?eid=singlesend
[2] https://help.salesforce.com/apex/HTViewHelpDoc?id=platform_connect_add_external_data_source.htm&language=en_US