• raz r
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 22
    Questions
  • 49
    Replies
ischatbotsession filed not visible in chat transcript  in test class .How to make ischatbotsession as true
  • August 06, 2020
  • Like
  • 0
how to cover the casemilestone records in test class 
  • September 28, 2018
  • Like
  • 0
can we write a trigger on AccountTeamMember ?Please help do we need to do any settings to write  a trigger on AccountTeamMember
  • July 27, 2018
  • Like
  • 0
I want to parse the below json and return the Value from DailyApiRequests Max into a Integer.

"ConcurrentSyncReportRuns":{"Max":20,"Remaining":20},
        "DailyAnalyticsDataflowJobExecutions":{"Max":40,"Remaining":40},
        "DailyApiRequests":{"Max":16124600,"Remaining":16123983}

Please helep me .Urgent!!!!
  • July 26, 2018
  • Like
  • 0
I want to Parse the below JSON and results should be displayed in VF Page as Accounts with related contacts.

JSON:
{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Account","url":"/services/data/v39.0/sobjects/Account/00190000016V11FAAS"},"Id":"00190000016V11FAAS","Name":"birlasoft","Contacts":{"totalSize":6,"done":true,"records":[{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYh46AAD"},"Id":"0039000002MYh46AAD","Name":"Krishna K"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYgxfAAD"},"Id":"0039000002MYgxfAAD","Name":"Krishna K"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYgXrAAL"},"Id":"0039000002MYgXrAAL","Name":"Riaz Test"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYhF4AAL"},"Id":"0039000002MYhF4AAL","Name":"Deepika HR"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYhHoAAL"},"Id":"0039000002MYhHoAAL","Name":"Romit Shilpe"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000001AlZ2XAAV"},"Id":"0039000001AlZ2XAAV","Name":"Riazgood boy"}]}}]}

Thanks in Advance!
  • February 22, 2018
  • Like
  • 0
Hi All,

how to get Accounts with related contacts using Rest API callout and display in VF page .

Please help me ASAP.

Thanks .
  • February 22, 2018
  • Like
  • 0
How to send json data form salesforce to external system using restresourse with username and password authentication ..?
  • November 17, 2017
  • Like
  • 0
Hi ,

We are trying to upload the attachmnets through REST api from Salesforce to Dot.net appliction. We have recieved the below error.
System.HttpResponse[Status=Internal Server Error, StatusCode=500]
Please fidn the below code for your reference. please provide teh solution asap.

public class FiniWiseAttachmentClass {
    
     public static HTTPResponse uploadFile()
    {
       list<Attachment> attch=[SELECT ContentType, Body, Name, ParentId, Id, OwnerId,Description,BodyLength FROM Attachment where ParentId in (select id from Analysis__c where Opportunity__c='0065C000002Q7fz')];
    system.debug('Attachment list'+attch);
 
    String boundary ='__boundary__rrr';
    String header ='--'+boundary+'n';
    String body='';    
   body +='Content-Disposition: form-data; name="data"; filename="'+attch[0].name+'"nContent-Type: application/octet-stream';
    
    String footer ='n--'+boundary+'--';
    
    // no trailing padding on header by adding ' ' before the last "nn" characters
    String headerEncoded = EncodingUtil.base64Encode(Blob.valueOf(header+'nn'));
    //this ensures no trailing "=" padding
    while(headerEncoded.endsWith('='))
    {
    header+=' ';
    headerEncoded = EncodingUtil.base64Encode(Blob.valueOf(header+'nn'));
        system.debug('headerEncoded'+headerEncoded);
    }
  //base64 encoded body
    String bodyEncoded = EncodingUtil.base64Encode(attch[0].body);
    //base64 encoded footer
    String footerEncoded = EncodingUtil.base64Encode(Blob.valueOf(footer));
    
    Blob bodyBlob =null;
    //last encoded body bytes
    String last4Bytes = bodyEncoded.substring(bodyEncoded.length()-4,bodyEncoded.length());
    //if the last 4 bytes encoded base64 ends with the padding character (= or ==) then re-encode those bytes with the footer
    //to ensure the padding is added only at the end of the body
    if(last4Bytes.endsWith('='))
    {
    Blob decoded4Bytes = EncodingUtil.base64Decode(last4Bytes);
    HttpRequest tmp =new HttpRequest();
    tmp.setBodyAsBlob(decoded4Bytes);
    String last4BytesFooter = tmp.getBody()+footer;
    bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded.substring(0,bodyEncoded.length()-4)+EncodingUtil.base64Encode(Blob.valueOf(last4BytesFooter)));
     system.debug('Body request'+bodyBlob);   
    }
    else
    {
    bodyBlob = EncodingUtil.base64Decode(headerEncoded+bodyEncoded+footerEncoded);
        System.debug('Body request'+bodyBlob);
    }
    
    /*if(bodyBlob.size()>3000000)
    {
    //this a "public class CustomException extends Exception{}"
    throw newCustomException('File size limit is 3 MBytes');
    }*/
    String Endpointurl= 'testurl';  

    HttpRequest req =new HttpRequest();
    req.setHeader('Content-Type','multipart/form-data; boundary='+boundary);
    //req.setHeader('Content-Type','text/XML');    
    req.setMethod('POST');
    req.setEndpoint(Endpointurl);
    req.setBodyAsBlob(bodyBlob);
    req.setTimeout(120000);
    req.setHeader('Content-Length',String.valueof(req.getBodyAsBlob().size()));
    Http http =new Http();
    HTTPResponse res = http.send(req);
    return res;
    }


}

It's very urgent. Please suggest us. 
 
  • January 10, 2017
  • Like
  • 0
In an Opportunity record I have 5 attachments with different formats.
I want to send these attachments and Opportunity data to external system via REST API callouts by clicking a custom button.

Please advise on this.
  • October 13, 2016
  • Like
  • 0
Ho do we get all the approver id's from each aproval step in approval process ?

We have there are 250 active approval processes are in the system . we need to extract the all the approvers names or id's related to each step in for each approval process.  Is there any way to extract all the approvers list.  It priority..

Thanks in Advance!!!
  • December 08, 2015
  • Like
  • 0
Could you please explain me, how do we remove the  in-active users from  300 public groups at a time. Please explian the process step by step. It's very priority
  • November 30, 2015
  • Like
  • 0
Could you please explian me how to take the complete debug logs in salesforce. It's urgent.

Thanks in advance!
  • November 26, 2015
  • Like
  • 0
how to pull the custom setting records in to string 
  • November 21, 2015
  • Like
  • 0
We have there are 250 active approval processes are in the system . we need to extract the all the approvers names or id's related to each step in for each approval process.  Is there any way to extract all the approvers list.  It priority..

Thanks in Advance!!!
  • October 30, 2015
  • Like
  • 0
I want to extract the list of approvers are assigned in each step in Approval process. Can any body help me out .its urgent. In our business there are 250 approval process are created. we want to extract the list of approvers assigned in each step in a approval process...

Thanks in Advance!!!
  • October 30, 2015
  • Like
  • 0
public with sharing class EmailManager{

    public void sendMail(String address, String subject, String body) {
        Messaging.SingleEmailMessage mail = new Messaging.SingleEmailMessage();
        String[] toAddresses = new String[] {address};
        mail.setToAddresses(toAddresses);
        mail.setSubject(subject);
        mail.setPlainTextBody(body);
        Messaging.sendEmail(new Messaging.SingleEmailMessage[] { mail });
    }

}


  • October 14, 2015
  • Like
  • 0
Hi All,

Can you please provide me the Salesforce Integration meterials with examples. 

Thnaks in Advance!
  • October 13, 2015
  • Like
  • 0
Trigger:
trigger RestrictContactByName on Contact (before insert, before update) {
    
    //check contacts prior to insert or update for invalid data
    For (Contact c : Trigger.New) {
        if(c.LastName == 'INVALIDNAME') {    //invalidname is invalid
            c.AddError('The Last Name "'+c.LastName+'" is not allowed for DML');
        }

    }
}

Test class:

@istest
public class TestRestrictContactByName {
    
    public static testmethod void testcontact1(){
        list<contact> cont=new list<contact>();
        contact con =new contact(lastname='testttt');
        cont.add(con);
        try{
        insert con;
        }
        catch(System.DmlException e){
             
        system.assert(e.getmessage().contains('The lastname testttt is not allow for DML'));
        }
    }
    
    public static testmethod void testcontact2(){
        list<contact> conn=new list<contact>();
        contact con =new contact(lastname='testtttt');
        conn.add(con);
        try{
        insert conn;
        }
        catch(System.DmlException e){
             
        //system.assert(e.getmessage().contains('The lastname testtttt is not allow for DML'));
        }
        
        conn.get(0).lastname='Invaliddata';
    
    try{
        update conn;
    }
    catch(System.DmlException e){
        system.assert(e.getmessage().contains('The lastname Invaliddata is not allow for DML'));
        
    }
}
}

 
  • October 01, 2015
  • Like
  • 0
how to add opportunity extension object field in opportunity list view
  • January 23, 2015
  • Like
  • 0
how to prevent the duplicate account while converting a lead. after preventing if lead is not converted ,how to send an email to that lead
  • October 20, 2014
  • Like
  • 0
ischatbotsession filed not visible in chat transcript  in test class .How to make ischatbotsession as true
  • August 06, 2020
  • Like
  • 0
how to cover the casemilestone records in test class 
  • September 28, 2018
  • Like
  • 0
can we write a trigger on AccountTeamMember ?Please help do we need to do any settings to write  a trigger on AccountTeamMember
  • July 27, 2018
  • Like
  • 0
I want to parse the below json and return the Value from DailyApiRequests Max into a Integer.

"ConcurrentSyncReportRuns":{"Max":20,"Remaining":20},
        "DailyAnalyticsDataflowJobExecutions":{"Max":40,"Remaining":40},
        "DailyApiRequests":{"Max":16124600,"Remaining":16123983}

Please helep me .Urgent!!!!
  • July 26, 2018
  • Like
  • 0
I want to Parse the below JSON and results should be displayed in VF Page as Accounts with related contacts.

JSON:
{"totalSize":1,"done":true,"records":[{"attributes":{"type":"Account","url":"/services/data/v39.0/sobjects/Account/00190000016V11FAAS"},"Id":"00190000016V11FAAS","Name":"birlasoft","Contacts":{"totalSize":6,"done":true,"records":[{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYh46AAD"},"Id":"0039000002MYh46AAD","Name":"Krishna K"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYgxfAAD"},"Id":"0039000002MYgxfAAD","Name":"Krishna K"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYgXrAAL"},"Id":"0039000002MYgXrAAL","Name":"Riaz Test"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYhF4AAL"},"Id":"0039000002MYhF4AAL","Name":"Deepika HR"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000002MYhHoAAL"},"Id":"0039000002MYhHoAAL","Name":"Romit Shilpe"},{"attributes":{"type":"Contact","url":"/services/data/v39.0/sobjects/Contact/0039000001AlZ2XAAV"},"Id":"0039000001AlZ2XAAV","Name":"Riazgood boy"}]}}]}

Thanks in Advance!
  • February 22, 2018
  • Like
  • 0
Hi All,

how to get Accounts with related contacts using Rest API callout and display in VF page .

Please help me ASAP.

Thanks .
  • February 22, 2018
  • Like
  • 0