Hot answers tagged

12

If you are comfortable with javascript, the best way to achieve this use case is to use AJAX API. After you have fixed view state error, it will hit apex heap limit of 6MB. But using AJAX API you can upload files of size up to 25MB, which is the maximum size limit of attachments in salesforce. You just need to pass the parent Id and the image file. For ...


8

Various Apex limits will get in the way of trying to push the data from Salesforce. Instead, one approach is to signal to the third-party application that the file is ready to be moved via a HTTPS call (that supplies the URL) and have that third-party application pull the data from Salesforce. Or if the third-party application can't be programmed to do that,...


6

This is very simple. You can try this code. I tested, it is working: You need to use apex:repeat tag to get count <apex:page standardController="Account"> <apex:variable var="count" value="{!0}"/> <apex:repeat value="{!Account.contacts}"> <apex:variable var="count" value="{!count + 1}"/> </apex:repeat> ...


4

The only hard limit we have hit is the "characters of Apex Code" one where some orgs have a 3 million character limit set. Salesforce support have upped that limit for us when we have asked. SFDX scratch orgs default to a 10 million character limit. I'm also interested to know if there are hard limits: we haven't hit any others, though our managed packages ...


3

You can get your own width by putting an empty div somewhere in your component: <div aura:id="measurement" /> var width = component.find("measurement").getBoundingClientRect().width; Note that this won't work in "init" because rendering hasn't occurred yet, but you can do so immediately afterwards using setTimeout: setTimeout( $A.getCallback( ...


3

If this code is in a test class than it makes sense. At least as long as you do not use the annotation: @isTest(SeeAllData=true) In the test classes without this annotation you are just able to access/query the data that you create in your specific test method. The default value for this annotation is false.


3

Limits are different now, 30k from API 47. See below: You can deploy or retrieve up to 10,000 files at once. AppExchange packages use different limits. In API version 43.0 and 44.0, AppExchange packages can contain up to 12,500 files. In API version 45.0, AppExchange packages can contain up to 17,500 files. In API version 46.0, AppExchange packages can ...


3

We have finally hit the limit - so now I know how huge managed package could be as for now, i.e. checked in practice and confirmed by SF support. 10,000 files - limit for non-certified managed packages, i.e. without passing security review. 12,500 files - for certified managed packages, i.e. for those which have passed security review. Pay attention, ...


3

I ran in the same problem and I solved it with this: <input id="picture_info" type="file" accept="image/*" capture="camera" onchange="" /> <apex:form enctype="multipart/form-data"> <apex:actionRegion > <apex:actionfunction name="af_submitFile" action="{!post_image}" rerender="myHiddenField" oncomplete="...


3

I don't think you need anything transient in this case. Looking at your code, most of the confusion/problems is coming from try/catch blocks, the way exceptions are handled and the fact that your were nullifying some variables. I've lightly simplified the page/code and it now loads pictures of up to 10MB without a problem. VF: <apex:page ...


3

You have this bit in your code: } catch(Exception e) { return null; } So ostensibly there is a try block around all of the rest of that code, although this is not shown. The problem to me seems to be that if you do exceed the file size your catch block swallows any error that might be surfaced in Apex. The other problem is that you don't give us ...


3

Assuming you are using window.open, set the width and height window.open("http://www.w3schools.com", "_blank", "width=400, height=400"); http://www.w3schools.com/jsref/met_win_open.asp <!DOCTYPE html> <html> <body> <a href="#" onclick="window.open('http://www.w3schools.com/', 'newwindow', 'width=300, height=250'); return false;"> ...


2

When referencing a list in visualforce you can directly access the size using the syntax: {!myList.size} You could then create a boolean statement in Visualforce with rendered="{!myList.size > 0}". Note that size is a property and not a function in Visualforce.


2

You can directly check the size in your visualforce page as follows <apex:page controller="MyConnectivityCasesSales"> <apex:form> <apex:outputpanel rendered="{!CasesInApproval.size!=0}"> <!-- Show only if size is greater than 0 --> </apex:outputpanel> </apex:form </apex:page>


2

There's no queue size for Triggered Sends in SFMC. Emails will queue and send (first-in, first-out) indefinitely as long as the trigger is not paused.


2

I'm pretty sure that ultimately, you'd be bound by the Metadata Limits, which states there's a limit of 10,000 components and a maximum compressed size of 39 MB. The documentation does not call this out explicitly, but it seems reasonable to presume that they use the same API internally as they do externally. Other than that, there's a few other limits that ...


1

Page style attributes result in invalid (negative) page size. It means you are defining the page size which is not acceptable for rendering a page as pdf. It expects at least size:25.5mm 25.5mm!important; or greater than that. Here, the first parameter is the width of the page and the second one is the height of the page. The page will look like this:...


1

You can check event.target.files[0].size to determine the file's size: function checkIfEmpty(event){ alert(event.target.files[0].size); } Note that in Visualforce, id attributes are "mangled" to be universally unique within the page. This is why your document.getElementById call fails to find the element. Also, the onchange handler should match the ...


1

Here are my changes to the JS to make this work. Apex is irrellevant here, if I am touching the Controller (submitting) then the file potentially has already made it to the server, whcih is the thing I am trying to avoid. If I want the value in my controller, I would need to send it to the controller outside of the Submit. Here is my new JS function ...


1

You can use lightning:layoutItem and lightning:layout to configure your component structure. As per docs:- A lightning:layoutItem is the basic element within lightning:layout. You can arrange one or more layout items inside lightning:layout. The attributes of lightning:layoutItem enable you to configure the size of the layout item, and change how ...


1

There are 2 possible cases: Integer prev = 0; prev = Limits.getHeapSize(); // we are doing it after allocating memory on Integer String toCheck = '😁1a'; Integer curr = Limits.getHeapSize(); // we are doing it right in time of Integer initialization to ensure we have the heap size right after allocating space for String system.debug(curr - prev); // 4 ...


1

Everything @glls said is correct. This is to just help point out the areas where you might consider some changes... <div style="width:200px;"> //This makes the max width of everything inside 200px. <div class="slds-grid slds-grid_pull-padded-medium"> <div class="slds-col slds-p-horizontal_medium"> <lightning:layout ...


1

You basically are putting your button in a box within another box that is in a bigger box, then you are telling your button to expand to its fullest within the smallest box. Either take your button out of the smallest box, aka div and or change the display property value, property values can be found here


1

What you've done is fine. for(MC_Cycle_Plan_vod__c mccp : [Select Id,Lock_vod__c,Goal_Edit_Status_vod__c from MC_Cycle_Plan_vod__c where Cycle_vod__c in : Lock_Ids]){ The above query creates one list of records which you add to MCCPupd. The below query creates an entirely different list which you also add to it: for(MC_Cycle_Plan_vod__c mccp : [Select ...


1

You cannot use OR operator in apex to perform a logical OR operation. You will have to use the double pipe || for that (and its already being used in your code (oldOpp.CloseDate.month() != o.CloseDate.month() || oldOpp.CloseDate.year() != o.CloseDate.year())). YOu can check it out here for more details ; You can use OR in formulas and in SOQL queries.


1

Because You have mentioned that your page is simply coming back to its previous stage without parent record ID when trying to upload a file, there is a possibility that you check if you have hit the limit --Maximum View State Limit Exceeded. Below are few docs which could help you. Let me know if it helps! https://developer.salesforce.com/page/...


1

Here's a nasty workaround that works in later API versions. It works by coercing the related items to a string and measuring the length. (Note that standard controller related items are not just SObject lists... so treat as black box) Note mysteries of VisualForceArrayList Note reassigning variables in apex:repeat is officially unsupported


Only top voted, non community-wiki answers of a minimum length are eligible