• CustomDataIntegrations
  • NEWBIE
  • 25 Points
  • Member since 2011

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 14
    Questions
  • 15
    Replies
The 2nd line below errors with the "Too many query rows 50001".  Is that because 50000 may have already been hit with the first query?    
 
List<Contact> lstContacts = [select id, MailingStreet, MailingCity, MailingState, MailingPostalCode, FirstName, LastName from contact LIMIT 50000];
        List<Lead> lstLeads = [select id, Street, City, State, PostalCode, FirstName, LastName from lead LIMIT 50000];
        List<Account> lstAccounts = [select id, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode from account LIMIT 50000];
How do I get the total record count from a table (i.e. Account, Lead, Contact)?  I have over 50,000 records in the Lead table.  When I run the query below in my code, it fails with the "Too many query rows: 50001" error.  

LeadRecordCount = [select Count() from lead];



I have these 3 queries in the opening of my first page:

        List<Contact> lstContacts = [select id, MailingStreet, MailingCity, MailingState, MailingPostalCode, FirstName, LastName from contact LIMIT 50000];
        List<Lead> lstLeads = [select id, Street, City, State, PostalCode, FirstName, LastName from lead LIMIT 50000];
        List<Account> lstAccounts = [select id, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode from account LIMIT 50000];

I  have a user that is getting the following error when they try to open the application: Too many query rows: 50001

How is this possible if I have a limit on each of my queries?

I got this back from the security review, how do I fix this?  The Salesforce app is executing a .NET WCF service and the WCF service needs either login info for each call or the Authentication Cookie.  How do I make this work?  I need to pass the Order Id so that I know what order to retrieve.

 

 

1) Access control on ticket id Vulnerability File

 

Code

 public String GetOrderStatus(String OrderTicketId,String CurrentAuthCookie,String Environment) {
            CDITECService.GetOrderStatus_element request_x = new CDITECService.GetOrderStatus_element();
            CDITECService.GetOrderStatusResponse_element response_x;
            request_x.OrderTicketId = OrderTicketId;
            request_x.CurrentAuthCookie = CurrentAuthCookie;
            request_x.Environment = Environment;

Notes

The order ID coming from the user parameter is directly sent to the web service.  The web service authenticates the user based on who they say they are. 

How do I go about showing a generic "An Error Happened" page and still get the error to be thrown so that I still recieve an email about the error and what happened?

I have the following code that has a CSRF Vulnerability and has improper use of user credentials being passed back to the page.  How can I automatically submit a form with the following info and still pass the Salesforce Security checks?

 

 

<apex:page showHeader="false" sidebar="false" standardstylesheets="false" controller="PageController">
<html>
<body onLoad='javascript&colon; document.forms[0].submit();'>
<form action='https://www.somesite/Incoming.aspx' method='POST'>

<input type='hidden' name='destinationpage' value='../summary.aspx'/>
<input type='hidden' name='useraction' value='transfer'/>
<input type='hidden' name='username' value='{!inpLoginValue }'/>
<input type='hidden' name='password' value='{!inpPasswordValue }'/>
<input type='hidden' name='subclientname' value=''/>
<input type='hidden' name='userdatabaseid' value='8d5e1c5f-9a8b-473e-a608-012be1c665d8'/>
<input type='hidden' name='channelid' value='03fccd9b-6d40-4cf8-b10e-20e65bb778ea'/>
<input type='hidden' name='productid' value='b51e6d12-6fbc-4e08-bcb1-a0ac528a94f3'/>

</form>
</body>
</html>
</apex:page>

 

I am trying to do a statement similar that would be written like this for SQL Server:

 

select case when Field1 = 'A' then 'B' else 'C' end as NewField from Accounts

 

How do I do this for Salesforce?  Basically, I want to make sure that a field that I am returning is not null, if it is, then I want to return an empty string.

I have an external .NET WCF Service that I am trying to invoke from outside the Salesforce sandbox.  One of the arguments in the .NET WCF Service function call is a byte array.  What is the appropriate conversion in APEX so that I can pass data to this function?

 

WSDL element:

<xs:elementminOccurs="0"name="FileContents"nillable="true"type="xs:base64Binary" />

 

 

Call to this:

String filecontents = BuildFile();
inputfile.FileName = 'SalesForceAddressFile.txt';
inputfile.FileContents = EncodingUtil.base64Encode(Blob.valueOf(filecontents));

 

When I look at the DataContract that was pulled in, the property is a String, but defined to the service as base64Binary.

 

Here is the DataContract code that was generated from the WSDL:

    public class FileObject {
        public String FileContents;
        public String FileName;
        private String[] FileContents_type_info = new String[]{'FileContents','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','true'};
        private String[] FileName_type_info = new String[]{'FileName','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://schemas.datacontract.org/2004/07/CDITecServices','true','false'};
        private String[] field_order_type_info = new String[]{'FileContents','FileName'};
    }

 

 

 

 

But when I invoke the webservice, there is an error thrown and I have narrowed it down to this property.  What am I doing wrong?  I have UnitTests setup in an external program that test the web service outside of the call from SalesForce, so I know that the webservice functions properly.  If I set inputfile.FileContents to null, I can get from SalesForce to the web service and execute the web service method.  When I keep the code as above, and send a String using the EncodingUtil, it errors on the invoking of the web service method.

I have an external .NET WCF Service that I am trying to invoke from outside the Salesforce sandbox.  One of the arguments in the .NET WCF Service function call is a byte array.  What is the appropriate conversion in APEX so that I can pass data to this function?

 

WSDL element:

<xs:elementminOccurs="0"name="FileContents"nillable="true"type="xs:base64Binary" />

 

 

Call to this:

String filecontents = BuildFile();
inputfile.FileName = 'SalesForceAddressFile.txt';
inputfile.FileContents = EncodingUtil.base64Encode(Blob.valueOf(filecontents));

 

When I look at the DataContract that was pulled in, the property is a String, but defined to the service as base64Binary.

 

Here is the DataContract code that was generated from the WSDL:

    public class FileObject {
        public String FileContents;
        public String FileName;
        private String[] FileContents_type_info = new String[]{'FileContents','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','true'};
        private String[] FileName_type_info = new String[]{'FileName','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://schemas.datacontract.org/2004/07/CDITecServices','true','false'};
        private String[] field_order_type_info = new String[]{'FileContents','FileName'};
    }

 

 

 

 

But when I invoke the webservice, there is an error thrown and I have narrowed it down to this property.  What am I doing wrong?  I have UnitTests setup in an external program that test the web service outside of the call from SalesForce, so I know that the webservice functions properly.  If I set inputfile.FileContents to null, I can get from SalesForce to the web service and execute the web service method.  When I keep the code as above, and send a String using the EncodingUtil, it errors on the invoking of the web service method.

I have this code on my VF page inside a repeater...

<apex:commandButton value="Get Files Only" action="{!DownloadPreviousOrderFiles}" disabled="{!CanExecuteJob}">
      <apex:param name="anOrderTicket" value="{!prevorder.OrderTicket}" assignTo="{!OrderTicketId}"/>
</apex:commandButton>

 

When I click on the button and enter the DownloadPreviousOrderFiles, the OrderTicketId controller property is null.  What am I missing?

 

 

How do I go about sending my batches to the Bulk API?  Can someone give me an example or point me to one? 

I am developing an application in SalesForce.  At one point, I make a call out to an outside webservice which returns some that I load to a file.  I load this into a Document and save it to the user documents, but there is also some data that is returned that I want to use to update records with.  I have been reading about the Bulk API, but I do not quite understand how I would call this from my controller.  I understand the limits and batches and that in my case, I will have to batch my updates.  

 

I am developing an application in SalesForce.  At one point, I make a call out to an outside webservice which returns some that I load to a file.  I load this into a Document and save it to the user documents, but there is also some data that is returned that I want to use to update records with.  I have been reading about the Bulk API, but I do not quite understand how I would call this from my controller.  I understand the limits and batches and that in my case, I will have to batch my updates.  

 

How do I go about sending my batches to the Bulk API?  Can someone give me an example or point me to one? 

 

Thanks!

I am trying to create a hyperlink to a document saved to a User Folder.  The Document is an .html file that has been saved there.  The file contains some html like....

 

<html>
<body onLoad="javascript&colon; document.forms[0].submit();">
<form action="http://www.mysite/mypage.aspx" method="POST">
..... input tags with values....

 

If I can create this same functonality in another way, I would be open to that as well.  Basically I need to serve up this html that would submit the page right away.

I have an external .NET WCF Service that I am trying to invoke from outside the Salesforce sandbox.  One of the arguments in the .NET WCF Service function call is a byte array.  What is the appropriate conversion in APEX so that I can pass data to this function?

 

WSDL element:

<xs:elementminOccurs="0"name="FileContents"nillable="true"type="xs:base64Binary" />

 

 

Call to this:

String filecontents = BuildFile();
inputfile.FileName = 'SalesForceAddressFile.txt';
inputfile.FileContents = EncodingUtil.base64Encode(Blob.valueOf(filecontents));

 

When I look at the DataContract that was pulled in, the property is a String, but defined to the service as base64Binary.

 

 

But when I invoke the webservice, there is an error thrown and I have narrowed it down to this property.  What am I doing wrong?

I have these 3 queries in the opening of my first page:

        List<Contact> lstContacts = [select id, MailingStreet, MailingCity, MailingState, MailingPostalCode, FirstName, LastName from contact LIMIT 50000];
        List<Lead> lstLeads = [select id, Street, City, State, PostalCode, FirstName, LastName from lead LIMIT 50000];
        List<Account> lstAccounts = [select id, ShippingStreet, ShippingCity, ShippingState, ShippingPostalCode from account LIMIT 50000];

I  have a user that is getting the following error when they try to open the application: Too many query rows: 50001

How is this possible if I have a limit on each of my queries?

How do I go about showing a generic "An Error Happened" page and still get the error to be thrown so that I still recieve an email about the error and what happened?

I have the following code that has a CSRF Vulnerability and has improper use of user credentials being passed back to the page.  How can I automatically submit a form with the following info and still pass the Salesforce Security checks?

 

 

<apex:page showHeader="false" sidebar="false" standardstylesheets="false" controller="PageController">
<html>
<body onLoad='javascript&colon; document.forms[0].submit();'>
<form action='https://www.somesite/Incoming.aspx' method='POST'>

<input type='hidden' name='destinationpage' value='../summary.aspx'/>
<input type='hidden' name='useraction' value='transfer'/>
<input type='hidden' name='username' value='{!inpLoginValue }'/>
<input type='hidden' name='password' value='{!inpPasswordValue }'/>
<input type='hidden' name='subclientname' value=''/>
<input type='hidden' name='userdatabaseid' value='8d5e1c5f-9a8b-473e-a608-012be1c665d8'/>
<input type='hidden' name='channelid' value='03fccd9b-6d40-4cf8-b10e-20e65bb778ea'/>
<input type='hidden' name='productid' value='b51e6d12-6fbc-4e08-bcb1-a0ac528a94f3'/>

</form>
</body>
</html>
</apex:page>

 

I have an external .NET WCF Service that I am trying to invoke from outside the Salesforce sandbox.  One of the arguments in the .NET WCF Service function call is a byte array.  What is the appropriate conversion in APEX so that I can pass data to this function?

 

WSDL element:

<xs:elementminOccurs="0"name="FileContents"nillable="true"type="xs:base64Binary" />

 

 

Call to this:

String filecontents = BuildFile();
inputfile.FileName = 'SalesForceAddressFile.txt';
inputfile.FileContents = EncodingUtil.base64Encode(Blob.valueOf(filecontents));

 

When I look at the DataContract that was pulled in, the property is a String, but defined to the service as base64Binary.

 

Here is the DataContract code that was generated from the WSDL:

    public class FileObject {
        public String FileContents;
        public String FileName;
        private String[] FileContents_type_info = new String[]{'FileContents','http://www.w3.org/2001/XMLSchema','base64Binary','0','1','true'};
        private String[] FileName_type_info = new String[]{'FileName','http://www.w3.org/2001/XMLSchema','string','0','1','true'};
        private String[] apex_schema_type_info = new String[]{'http://schemas.datacontract.org/2004/07/CDITecServices','true','false'};
        private String[] field_order_type_info = new String[]{'FileContents','FileName'};
    }

 

 

 

 

But when I invoke the webservice, there is an error thrown and I have narrowed it down to this property.  What am I doing wrong?  I have UnitTests setup in an external program that test the web service outside of the call from SalesForce, so I know that the webservice functions properly.  If I set inputfile.FileContents to null, I can get from SalesForce to the web service and execute the web service method.  When I keep the code as above, and send a String using the EncodingUtil, it errors on the invoking of the web service method.

I have this code on my VF page inside a repeater...

<apex:commandButton value="Get Files Only" action="{!DownloadPreviousOrderFiles}" disabled="{!CanExecuteJob}">
      <apex:param name="anOrderTicket" value="{!prevorder.OrderTicket}" assignTo="{!OrderTicketId}"/>
</apex:commandButton>

 

When I click on the button and enter the DownloadPreviousOrderFiles, the OrderTicketId controller property is null.  What am I missing?

 

 

I am trying to create a hyperlink to a document saved to a User Folder.  The Document is an .html file that has been saved there.  The file contains some html like....

 

<html>
<body onLoad="javascript&colon; document.forms[0].submit();">
<form action="http://www.mysite/mypage.aspx" method="POST">
..... input tags with values....

 

If I can create this same functonality in another way, I would be open to that as well.  Basically I need to serve up this html that would submit the page right away.