• RohiniH
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 5
    Replies
Hello,
What is the best method to receive 5- 10 files of 5 MB each from an External System. These file will be attched to Opportunity record, which is already existing in the Salesforce system.
The external system will not send more than 50 Opportunities per day.

Following is the limitation from Salesforce
Maximum size of callout request or response (HTTP request or Web services call) in SFDC is 6 MB for synchronous Apex or 12 MB for asynchronous Apex ,

or
Should the external system use our OOTB REST API 
/services/data/v48.0/sobjects/Opportunity/<ID>
For Attachment
/services/data/v48.0/sobjects/Attachment/<ID>
For Files
/services/data/v48.0/sobjects/ContentVersion/<ID>

We are using files, so ContentVersion looks very close to it, than Attachment

What would be best way without encountering any limitation. 

Kind Regards,
Rohini H
Hi,
Based off new GDPR rules in EU, we need to anonymise the contact and Lead personal details. Salesforce provides obfuscateUser() to anonymize the User data.
Is there an equivalent process available to anonymise th Contact and Lead personal details. Or should we implement a custom logic for the same.
Will Shield Platform Encryption, encrypt [anonymise] the data for all users in Salesforce and for third party.
Also what would be the impact of enabling the 'Data Protection and Privacy', from Setup =>Search.

Kind regards,
Rohini
Hi,
I am doing a HTTP Callout to get PDF file. In HTTP Response I see the content of file starting with %PDF-1.4 and has   '<</Length 6778/Filter/FlateDecode>>stream' mentioned followed by PDF details[encoded]. I want to download this as PDF file. Do I need to convert it to base64 encoded string and then download, then how do I go about that

User-added image
Kind Regards,
Rohini
Hi,
I followed the steps mentioned in https://www.youtube.com/watch?v=CSv7BRpqT5c&t=1309s , and I was able to successfully login.
When I click logout, the system also navigates to Logout page, but the issue is when I login again , the system does not ask for any credentials, and directly logs me in.
What are the steps to be followed so that, when user clicks Logout on Salesforce application, the user is completely logged out of Salesforce as well as ADFS.
Hi, 
I have configured Single Single Sign On in Salesforce for Microsoft ADFS.
I am able to login using company domain credentials using SSO, It also logs out to the page mentioned in SAML SSO setting in Salesforce. 
But when the user clicks on the SSO Login button, it does not ask for credential again, and directly logs in that user.
I even tried to set claim rule for logout in ADFS, even after this, it does not log out completely, rather just redirects the user to the page mentioned in logout url
Is there any specific setup required in ADFS, or any workaround for this issue
Kind regards,
​Rohini.
 
Hi,

The Custom Button which is displayed on the Feed Section of Service Console on a Converted Case Feed Layout is not working . Nothing happens after clicking the Custom Button.
If a Page Layout is created which Feed-Based Layout' enabled, custom button on the Feed Section of Service Console works fine.

Is there any basic difference between creating a new layout with 'Feed-Based Layout' enabled and converting the layout to case feed layout?

Kind regards
Ruhi.
 
Hello,
I cannot send Solution via 'Send Email' button on Related List on Case, even though Email template has {!Case.Solution_Description}.

Am i missing any setting...

Kind regards,
Ruhi.
Hi,
Whenever the debug log exceeds 2mb limit, salesforce skip the debug log statements, and prints the trailing debug log statements in the debug file.Is there any way where we can capture all the system.debug statements  if the debug log file exceeds 2mb limit.
 say in developer console following 2 for loop snippets are executed separately
for(Integer i=0;i<100;i++){
    System.debug('hello  : '+i);
}

for(Integer i=0;i<10000;i++){
    System.debug('hello  : '+i);
}
For the later ..
33.0 APEX_CODE,DEBUG;APEX_PROFILING,INFO;CALLOUT,INFO;DB,INFO;SYSTEM,DEBUG;VALIDATION,INFO;VISUALFORCE,INFO;WORKFLOW,INFO
17:02:22.017 (17905870)|EXECUTION_STARTED
17:02:22.017 (17915505)|CODE_UNIT_STARTED|[EXTERNAL]|execute_anonymous_apex
*** Skipped 1399744 bytes of detailed log
17:02:22.176 (176450640)|SYSTEM_METHOD_ENTRY|[2]|System.debug(ANY)
17:02:22.176 (176460570)|USER_DEBUG|[2]|DEBUG|Hello count4176
17:02:22.176 (176464556)|SYSTEM_METHOD_EXIT|[2]|System.debug(ANY)
17:02:22.176 (176478193)|SYSTEM_METHOD_ENTRY|[2]|String.valueOf(Object)
17:02:22.176 (176490390)|SYSTEM_METHOD_EXIT|[2]|String.valueOf(Object)
17:02:22.176 (176497639)|SYSTEM_METHOD_ENTRY|[2]|System.debug(ANY)
.....

Kind regards,
Ruhi.
Hello,
Following code is for logout, which is sent to the sitelogin page specified in Salesforce
<apex:outputLink value="{!$Site.Prefix}/secur/logout.jsp" >{!$Label.Logout}</apex:outputLink>

We would like to change the language of the page based on the user's chosen language when he had logged in the application.
   <apex:outputLink value="{!$Site.Prefix}/secur/logout.jsp?language=ru" >{!$Label.Logout}</apex:outputLink> 
Also, just a note that, when he logged in the application, from another url,  language was passed in as parameter
say,

Is it possible to change the language of the page he is sent , once he logs out of the application.

Kind regards,
Ruhi.
 
Hello,

What is the limit of updates per day.

We are building a huge application which will involve many applicants whose details will be updated in the system individually via the web appln  page etc. 
What is the limit on calling update function per day., rather how many times can we call update() function in a day, say 10000, 50000 etc

Kind regards,
Ruhi
Hello,

Is it ok to send XML data fragments within CDATA.
Will the contents of CDATA be retrieved/parsed properly using XMLStreamReader?
I am getting error when retrieving the value of UID, TRANGTHAI for XML content as follows in the testcase only. It seems to be failing when getting UID
Strangely In the application the code seems to parse the xml obtained properly.

HttpResponse res = new HttpResponse();
        res.setHeader('Content-Type', 'text/xml; charset=utf-8');
        res.setBody('<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">' +'\n'+
                    '<soap:Body>' +'\n'+
                    '<GET_E1_Response xmlns="http://tempuri.org/">' +'\n'+
                    '<GET_E1_Result>'+
                    '<![CDATA[00#POD#Successful#<P_Id>S1109641</P_Id><UID>69744944</UID><NewDataSet>'+'\n'+
                    '<Table>'+'\n'+
                    '<TRANGTHAI>I</TRANGTHAI>'+'\n'+
                    '<NGAYNHAN>20131021</NGAYNHAN>'+'\n'+
                    '<GIONHAN>1000</GIONHAN>'+'\n'+
                    '</Table>'+'\n'+
                    '</NewDataSet>]]></GET_E1_Result>'+'\n'+
                 
                    '</GET_E1_Response>' +'\n'+
                    '</soap:Body>' +'\n'+
                    '</soap:Envelope>'
                    );


             
        res.setStatusCode(200);

///////////////////////////////////
XmlStreamReader reader = res.getXmlStreamReader();

String trangthai = ''; //status
        Boolean tFound = false;
              
        String UID = ''; 
        Boolean uFound = false;


        while(reader.hasNext()){
            reader.next();
          
            if (reader.getEventType() == XmlTag.START_ELEMENT && reader.getLocalName() == 'GET_E1_Result'){

                reader.Next();
                String txt = reader.getText();
                System.debug('one ' + txt );//pod
              
               if( !txt.startsWith('00')){

                   break;
                }
              
                if(txt.contains('00#POD#Picking up')){
                    trangthai ='Picking Up';
              
                    while (reader.hasNext()) {
                        reader.nextTag();
                          if (reader.getEventType() == XmlTag.START_ELEMENT && 'P_Id' == reader.getLocalName()) {
                                reader.next();
                                txt = reader.getText();
                                System.debug('PSPT ' + txt );//pod
                            }
                            if (reader.getEventType() == XmlTag.START_ELEMENT && 'UID' == reader.getLocalName()) {
                                reader.next();
                                txt = reader.getText();
                                UID = txt;
                                System.debug('UID ' + txt );//pod
                                break;
                            }
                      
                    }//while
                    break;
                }
              
              
                tFound = false;
                uFound = false;
              
                while(txt != '/NewDataSet'){
                    //System.debug('Loop value  '+a);//>

                    if(txt =='UID' ){
                        uFound = true;
                    }
                  
                    if(uFound == true){
                        if(reader.getText() == '/UID'){
                          
                            uFound = false;
                        }else{
                            System.debug('quackkk UID '+reader.getText());//>
                            if(reader.getText() != null && reader.getText() != '' && reader.getText() != '<'){
                                UID = reader.getText();
                                System.debug('UID IS ' + UID);//>
                            }
                        }
                    }




                    reader.Next();
                    txt = reader.getText();
                }//while
              
              
            }
        }

      System.debug('So the trangthai is '+trangthai);
      System.debug('So the UID is '+ UID);

But the code seems to work for following HTTP response where the CDATA does not have XML fragments


res.setBody('<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">' +
                    '<soap:Body>' +
                    '<GET_E1_Response xmlns="http://tempuri.org/">' +
                    '<GET_E1_Result>00#POD#Picking up#<P_Id>B2210417</P_Id><UID>70979231</UID></GET_E1_Result>'+
                 
                    '</GET_E1_Response>' +
                    '</soap:Body>' +
                    '</soap:Envelope>'
                    );

Kind regards,
Ruhi
Hello,

I am trying to parse XML content obtained via HTTP Response, It works fine when in application, but when the same XML string is parsed in testcase or say in developer console, then it fails as the CDATA's content which has XML fragment is not processed properly

Basically the CDATA has XML fragment within.

Following is the code...

HttpResponse res = new HttpResponse();
        res.setHeader('Content-Type', 'text/xml; charset=utf-8');
        res.setBody('<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">' +'\n'+
                    '<soap:Body>' +'\n'+
                    '<GET_E1_Response xmlns="http://tempuri.org/">' +'\n'+
                    '<GET_E1_Result>'+
                    '<![CDATA[00#POD#Successful#<P_Id>S1109641</P_Id><UID>69744944</UID><NewDataSet>'+'\n'+
                    '<Table>'+'\n'+
                    '<TRANGTHAI>I</TRANGTHAI>'+'\n'+
                    '<NGAYNHAN>20131021</NGAYNHAN>'+'\n'+
                    '<GIONHAN>1000</GIONHAN>'+'\n'+
                    '</Table>'+'\n'+
                    '</NewDataSet>]]></GET_E1_Result>'+'\n'+
                  
                    '</GET_E1_Response>' +'\n'+
                    '</soap:Body>' +'\n'+
                    '</soap:Envelope>'
                    );


              
        res.setStatusCode(200);
  XmlStreamReader reader = res.getXmlStreamReader();

String trangthai = ''; //status
        Boolean tFound = false;
               
        String UID = '';  
        Boolean uFound = false;


        while(reader.hasNext()){
            reader.next();
           
            if (reader.getEventType() == XmlTag.START_ELEMENT && reader.getLocalName() == 'GET_E1_Result'){

                reader.Next();
                String txt = reader.getText();
                System.debug('one ' + txt );//pod
               
               if( !txt.startsWith('00')){
//TODO UNCOMMENT required stmt
                   break;
                }
               
                if(txt.contains('00#POD#Picking up')){
                    trangthai ='Picking Up';
               
                    while (reader.hasNext()) {
                        reader.nextTag();
                          if (reader.getEventType() == XmlTag.START_ELEMENT && 'P_Id' == reader.getLocalName()) {
                                reader.next();
                                txt = reader.getText();
                                System.debug('PSPT ' + txt );//pod
                            }
                            if (reader.getEventType() == XmlTag.START_ELEMENT && 'UID' == reader.getLocalName()) {
                                reader.next();
                                txt = reader.getText();
                                UID = txt;
                                System.debug('UID ' + txt );//pod
                                break;
                            }
                       
                    }//while
                    break;
                }
               
               
                tFound = false;
                uFound = false;
               
                while(txt != '/NewDataSet'){
                    //System.debug('Loop value  '+a);//>

                    if(txt =='UID' ){
                        uFound = true;
                    }
                   
                    if(uFound == true){
                        if(reader.getText() == '/UID'){
                           
                            uFound = false;
                        }else{
                            System.debug('quackkk UID '+reader.getText());//>
                            if(reader.getText() != null && reader.getText() != '' && reader.getText() != '<'){
                                UID = reader.getText();
                                System.debug('UID IS ' + UID);//>
                            }
                        }
                    }




                    reader.Next();
                    txt = reader.getText();
                }//while
               
               
            }
        }
       
        System.debug('So the trangthai is '+trangthai);
        System.debug('So the UID is '+ UID);

But if the following response is send in the HTTP, it works fine with the above code, this response does not have CDATA,

res.setBody('<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">' +
                    '<soap:Body>' +
                    '<GET_E1_Response xmlns="http://tempuri.org/">' +
                    '<GET_E1_Result>00#POD#Picking up#<P_Id>B2210417</P_Id><UID>70979231</UID></GET_E1_Result>'+
                  
                    '</GET_E1_Response>' +
                    '</soap:Body>' +
                    '</soap:Envelope>'
                    ); 


Kind Regards,
Ruhi...

Hi All,

 

A third party sends notification data as parameters to our url , on verifying the data we either send HTTP status 200 OK on success or 500 Internal error otherwise.

 

How do we go about changing the HTTP status code when returning the pagereference in salesforce.

 

public PageReference initConfirmation(){

    respRES = System.currentPagereference().getParameters().get('RES');

    if( validate(respRES ) ){

         //send back HTTPSTATUS CODE 200

         //return null;

   }else{

       //Send back HTTP STATUS CODE 500 

      // PageReference pref = ApexPages.currentPage(); // do something

   }

}

 

Kind regards,

Rohini H

 

dom.XmlNode tempNode = hdr.addChildElement('Company Name', null, null);

tempNode.addTextNode('ABC & XYZ ');

tempNode = hdr.addChildElement('Company Address', null, null);

tempNode.addTextNode('ABC & XYZ, <former 123ABC> ');

 

The xml created by this gives incorrect output with &amp; &lt; etc

 

i cannot include characters like & and < in DOM.Document's dom.XmlNode

 

Avoiding XMLStreamWriter, as it easily reaches heap limit.

i am updating few records[5 records in a for loop], and ALL the records are saved with lastmodified date as 2011-11-02T15:43:56.000Z

 and later i need to print them querying the table in the order of ascending order of lastmodifieddate field.

But it does not print so... as.i need to sort on lastmodifieddate field, i need the timestamp based on milliseconds. How do i set milliseconds in the lastmodifieddate field

 

i explicitly  update each of these records inside a for loop, but it does not have fraction of second captured.

 

for(String seqnsdInput : sequencedInput ){

    doctrckr = mapInputSeqnDocTracks.get(seqnsdInput);

    update doctrckr;

}

Here the lastmodified date is same for all doctrckr object

Kind regards...

 

Hi,

I have installed SVN following the documentation http://blog.deadlypenguin.com/blog/2009/04/29/salesforcecom-and-subversion/.

 

But would like further tutorials/videos about managing it with branches for different developers for merge, checkout and checkin

 

Kind regards





<apex:pagecontroller="myyController" extensions="Confirmation" action="{initConfirmation}" showHeader="false"

 sidebar="false" standardStylesheets="false" renderAs="pdf" contentType="utf-8">

    <apex:outputText value="{!cLetter}" escape="false"/>

</apex:page>

 

Now the 'cLetter' variable has a letter written in russian language, When the pdf file is opened, the russian characters are not displayed.

 

 

  • September 25, 2011
  • Like
  • 0

Parsing big xml file gives

'System.LimitException: Too many script statements: 200001'

 

The xml file has around 2000 data, say 2000 contacts where each contact has around 20 fields data

 

<?xml version="1.0" encoding="UTF-8"?>
<Manifest>
  <ContactDetail>
     <UID>287284447</UID>
     <ExpiryDate>Jun 10 2015 12:00AM</ExpiryDate>
     <DOB>Aug 28 1957 12:00AM</DOB>
         20 such data fields
  </ContactDetail>
...

   2000 contact details
...

  <ContactDetail>

      ... 

  </ContactDetail>
</Manifest>

 

 

 

  • September 04, 2011
  • Like
  • 0

I have a interface Z with two methods, Class A and class B implements that interface Z,

I have one more class C which instantiates objects of class A and class B

Also, in class A and B there is a future callout respectively

Now in trigger T, I create an object of class C and an instance of interface Z. where it calls a method of class C and also pass instance of interface Z as a parameter of that method.

 

Now when compiling all of them together, i get 'Dependent class is invalid and needs recompilation'. so in outbound change set,

 

I have to explicitly sequence them and deploy accordingly.

 

Like say, I created 4 outbound change set, one for Z,  other for A and B, another for C and another for Z, to avoid the above error

Is this the correct approach.

 

Is it that the dependant files need to go in different outbound change set, so that they can be compiled separately, and there is no dependency issue.

 

In the sandbox environment, the code works as expected.

Hi,
Based off new GDPR rules in EU, we need to anonymise the contact and Lead personal details. Salesforce provides obfuscateUser() to anonymize the User data.
Is there an equivalent process available to anonymise th Contact and Lead personal details. Or should we implement a custom logic for the same.
Will Shield Platform Encryption, encrypt [anonymise] the data for all users in Salesforce and for third party.
Also what would be the impact of enabling the 'Data Protection and Privacy', from Setup =>Search.

Kind regards,
Rohini
Hello,
What is the best method to receive 5- 10 files of 5 MB each from an External System. These file will be attched to Opportunity record, which is already existing in the Salesforce system.
The external system will not send more than 50 Opportunities per day.

Following is the limitation from Salesforce
Maximum size of callout request or response (HTTP request or Web services call) in SFDC is 6 MB for synchronous Apex or 12 MB for asynchronous Apex ,

or
Should the external system use our OOTB REST API 
/services/data/v48.0/sobjects/Opportunity/<ID>
For Attachment
/services/data/v48.0/sobjects/Attachment/<ID>
For Files
/services/data/v48.0/sobjects/ContentVersion/<ID>

We are using files, so ContentVersion looks very close to it, than Attachment

What would be best way without encountering any limitation. 

Kind Regards,
Rohini H
Hello,
I cannot send Solution via 'Send Email' button on Related List on Case, even though Email template has {!Case.Solution_Description}.

Am i missing any setting...

Kind regards,
Ruhi.
Hello,

What is the limit of updates per day.

We are building a huge application which will involve many applicants whose details will be updated in the system individually via the web appln  page etc. 
What is the limit on calling update function per day., rather how many times can we call update() function in a day, say 10000, 50000 etc

Kind regards,
Ruhi

I have a interface Z with two methods, Class A and class B implements that interface Z,

I have one more class C which instantiates objects of class A and class B

Also, in class A and B there is a future callout respectively

Now in trigger T, I create an object of class C and an instance of interface Z. where it calls a method of class C and also pass instance of interface Z as a parameter of that method.

 

Now when compiling all of them together, i get 'Dependent class is invalid and needs recompilation'. so in outbound change set,

 

I have to explicitly sequence them and deploy accordingly.

 

Like say, I created 4 outbound change set, one for Z,  other for A and B, another for C and another for Z, to avoid the above error

Is this the correct approach.

 

Is it that the dependant files need to go in different outbound change set, so that they can be compiled separately, and there is no dependency issue.

 

In the sandbox environment, the code works as expected.