• Jacky Lee
  • NEWBIE
  • 25 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 4
    Replies
We have an older Visualforce page that is failing to load scripts and resources for a single user, with the error message "Failed to load resource:net::ERR_CONNECTION_RESET". This is only affecting a single user in the entire org and affects all browsers she uses.

User-added image

The only way she can get the page to load properly is if she opens the element inspector and refreshes the page several times, but must do this constantly.

On the VF page we are using Jquery and Bootstrap via CDN and also some static resource JS files, which works flawlessly for the rest of our users.

Things I've tried based on the assumption it's related to her device:
- Checked firewall, antivirus, windows security - nothing active or different from mine
- Checked browsers - Happens on Chrome, Edge, Firefox. Only works when refreshing several times, but stops working when tab closed.
- Opening in incognito mode - No change
- Checked plugins - Nothing related
- Cleared cache and cookies - No change
- Logging in as user - Page works as intended, I cannot reproduce console errors on my end
- No VPNs active
- Her internet connection is stable

I'm out of ideas, I don't suspect hosting files via static resource will change things as she has no issues viewing the content in the CDN link, but I will try. Is there anything device-specific that might cause this anomaly?

Thanks.

I have a batch class with Database.AllowsCallouts that upon execute will invoke a helper method that makes an HTTP Request using Named Credentials. The issue I am facing is that the response returns 200 OK in my sandbox, but 409 Conflict in production (Dropbox API). My remote site settings and named credential configs are exactly the same between sandbox and production.

The funny thing is if I call the helper function in apex anonymous, it works fine. I've tried isolating the problem and I'm sure it's something strange going on with running in Batch context.

Here's my stack trace in sandbox:

And in production:
 

I'm looking to pull in a Salesforce Calendar (the default one) and display it on the Home Page. I understand there is a Component there already, but I would like the full week view to show on the Home Page and also make it interactive, instead of having to click a bunch of times.

The Calendar link itself is formatted similar to this: https://ap4.salesforce.com/00U/c?cType=2&md2=28&md0=2019

I am thinking I should somehow pull this page into a Visualforce Page (apex:detail?), or to somehow display it using the HTML option (iframe?), but neither option have allowed me to pull the Calendar "record" in.

For Feed Items posted from external sources like Zapier, there is a little signature below each post indicating the source: 
User-added image

I am wondering where this information is stored on the FeedItem object. I'd like this information so I can filter them in a trigger, rather than using the post body.

I have tried querying every field under the FeedItem but nothing shows it.

Thanks!

 
When displaying URLs in Visual Flow, it seems that a string without spaces or linebreaks will push out of the flow screen. Here is an example:

User-added image

I would just like to format it so it will auto-linebreak after a certain width is reached (or auto-fit it to a div). I have tried changing the HTML within the display box, played around with formulas to insert linebreaks at certain locations, but none have yielded my desired result.
Hi,

I'm trying to figure out why my iframe is not refreshing after a DML update even when explicitly calling a reload function.

I'm displaying an iframe of a chatter:feed component on my visualforce page. Then, I'm grabbing an input text field from the page, passing it to Apex to DML update the chatter:feed component by inserting a comment (I'm doing this instead of just posting a comment within the iframe so I can do some text sanitizing).
 
function startUpdate(d) {
        var comment = document.getElementById("comment").value;        //get comment input field
        insertComment(comment);        //Insert the comment into the chatter feed through Apex
        document.getElementById("comment").value = '';        //clearing comment field

        refreshIframe();        //Refresh the iframe
    }

After updating the feed element with the comment, I'm trying to refresh the iframe using a javascript function:
function refreshIframe() {
        var iframe = document.getElementById('iframe');
        
        iframe.contentDocument.location.href = iframe.src;
    }

The issue I'm encountering is that the refreshIframe() function does not fetch the newly inserted comment. There is definitely a 'reloading' animation, but the DML update doesn't appear.
However, when I call the refreshIframe() function from an onclick button, it successfully fetches the feed with the comment:
<button id="saveButton" type="button" class="btn btn-primary" onclick="refreshIframe();">Refresh</button>

I am confused as to why calling the refreshIframe function from within another function does not grab the updated comment, but when invoking from an onclick, it works perfectly fine. In both instances, both functions are called according to the logs.
I am suspecting that onclick does something that I am unaware of, or there is some differences with clearing the cache. Any suggestions are much appreciated.

Thanks


 
Hi guys,


I'm wondering if the chatter:feed component in VF can show a single feed item in that feed rather than the whole feed. That is, a single post that has the All Updates > This Update marker at the top.

The component does use the entityId attribute so it makes sense that it shows the record's entire feed. But it looks like the url for a feedItem takes in two parameters: salesforce.com/a0V6F00000ZOer8?fId=0D55D000003SNb0, one for the record and one for the feedItem. 

For context, the use for this on my page is that I have a list of records, each row having a button. The button uses jquery to open a popup window with an iframe of that record's chatter feed (which is just another VF page with chatter:feed). I'm displaying the whole feed, but I only need a single post that has a particular topic. Should also be able to post/comment.

Any suggestions on other ways I can display the filtered feedItem are very welcome :)

Thanks!

 
Hi,

I'm trying to pass some string (called "greeting") that is inputted through a VF page to a VF Email Template. Right now the string goes to a controller, which goes to a component (with the html email body), which is used in the email template. The hiccup is when I'm calling a sendEmail method (which uses the templateId of the VF email template), I'm unsure how to pass that same string variable in, such that I can achieve something like this:

VF Email Template:
<messaging:emailTemplate subject="Invoice Request" recipientType="Contact" relatedToType="Account">
    <messaging:htmlEmailBody >
        <c:InvoiceRequestEmailComponent greet="{!greeting}"/>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>

Where I can get the "greetings" variable from the controller and use it in the email.  When I add the component to my VF page:
<c:InvoiceRequestEmailComponent greet="{!greeting}"/>
It shows me the email body WITH the string I just entered, which makes sense as it is within that page instance. But when I send an email I can't figure out how to access the variable within my particular instance.

I think I might need to initialize a PageReference and somehow refer to that in the component, or pass in the variable in my email method. It is clear that the email template cannot access the "greetings" variable when it doesn't know what instance it's looking at, but I'm not sure how. I have also looked into the component's relatedTo and email's whatId but it seems they address sObjects field parameters, or I just can't figure out how to use them with user-inputted strings.

Thanks in advance, I can post all my code if required.


 
Hi guys,

I have a Visualforce table that I'd like to dynamically filter through a VF picklist. The filter is a string, which is "Currency". So by default it is on USD and will show all records that are in USD, but I'd like to pick 'CAD' from a dropdown on the page and it will rerender the table with only CAD records.

I have borrowed some code from this discussion, but the button is so far unresponsive and doesn't rerender. I've attached my code below with only the relevant parts:

VISUALFORCE CODE
<apex:page controller="InvoicesReadyToPayV4">
    <apex:form>
    	<apex:pageBlock title="Test Report">
            <apex:pageBlockSection columns="1">
            	Select Currency:
                <apex:selectList size="1" value="{!currencyPickvalue}">
                	<apex:commandButton value="Go" action="{!getCurrency}" reRender="table1"/>
                	<apex:selectOption itemLabel="USD" itemValue="USD"></apex:selectOption>
                    <apex:selectOption itemLabel="CAD" itemValue="CAD"></apex:selectOption>
                    <apex:selectOption itemLabel="AUD" itemValue="AUD"></apex:selectOption>
                </apex:selectList>
            </apex:pageBlockSection>
            
              <!-- More code to create tables -->

        </apex:pageBlock>
    </apex:form>
</apex:page>

CONTROLLER
 
public class InvoicesReadyToPayV4 {
    public List<GEOinvoice__c> geoInvoices {get;set;}
    public List<Account> localPartners {get;set;}
    public Set<Id> localPartnerIds = new Set<Id>();
    public Map<Account, Decimal> LocalPartnerSum {get;set;}
    public Map<Account, String> LocalPartnerReady {get;set;}
    
    public String currencyPickvalue {get;set;}
    public String selectedCurrency {get;set;}
    //selectedCurrency = 'USD';	//Default
        
    public void getCurrency() {
        selectedCurrency = currencyPickvalue;
        System.debug('Selected Currency: ' + selectedCurrency);
        //Do I have to re-run the below method?
	}
    
    //Find all invoices to be shown in report
    public InvoicesReadyToPayV4() {
       
        geoInvoices = [SELECT Id, Name
                                    FROM GEOInvoice__c
                                   WHERE LP_invoice_currency__c = :selectedCurrency];

        //More code related to the tables
   }
}

I think what I'm trying to do is Click "Go", it passes the selected value to the "getCurrency" method, which initializes a string value for the currency in Apex so I can bind it in the SOQL query. Then the getCurrency method will run the main method again to re-render the page.

It looks like there's a few bumps I can't seem to figure out, and I've been racking my brains on this for ages!

Thanks in advance! 


 
Hi,

I have obtained the results of a report using apex. I'd like to retrieve the summary amounts for every record, but unsure how to find out the size, (i.e. count of groups in the report) in order to loop through the report.

According to the guide:
List<Report> reportList = [SELECT Id, DeveloperName FROM Report WHERE Id = 'report ID here'];

String reportId = (String)reportList.get(0).get('Id');
        
Reports.reportResults results = Reports.ReportManager.runReport(reportID, true);
        	
Reports.Dimension dim = results.getGroupingsDown();
Reports.GroupingValue groupingVal = dim.getGroupings()[0];
System.debug('Key: ' + groupingVal.getKey());		
System.debug('Label: ' + groupingVal.getLabel());

How can I find the size() of dim?

Thanks
Hi,

Within a visual flow, I'm wondering if I can populate a collection variable using semi-colon separated values (;) in a single input text box. For the use case, I'd like to append an ad-hoc Taskray Checklist to a Taskray Task using only the flow interface, but as the items are ad-hoc, I can't use a template for it.

For example, if I input this in ONE long text field:
Apples;
Bananas;
Carrots;


Can I pass it into a collection variable using a loop so it is [Apples, Bananas, Carrots]?

I have simulated this by using LEFT({!Checklist}, FIND(";", {!Checklist}) - 1) to get the first row and adding it to the collection variable, trimming it from {!Checklist} and doing it again for the second row, etc. This creates the collection var as long as I stick to the number of assignments I've used.

But the problem is I can't figure out how to build it into a loop to handle variable number of items. Is there any way to do this using only flow tools?

Thanks in advance :)




 
Hi,

Within a visual flow, I'm wondering if I can populate a collection variable using semi-colon separated values (;) in a single input text box. For the use case, I'd like to append an ad-hoc Taskray Checklist to a Taskray Task using only the flow interface, but as the items are ad-hoc, I can't use a template for it.

For example, if I input this in ONE long text field:
Apples;
Bananas;
Carrots;


Can I pass it into a collection variable using a loop so it is [Apples, Bananas, Carrots]?

I have simulated this by using LEFT({!Checklist}, FIND(";", {!Checklist}) - 1) to get the first row and adding it to the collection variable, trimming it from {!Checklist} and doing it again for the second row, etc. This creates the collection var as long as I stick to the number of assignments I've used.

But the problem is I can't figure out how to build it into a loop to handle variable number of items. Is there any way to do this using only flow tools?

Thanks in advance :)




 

I have a batch class with Database.AllowsCallouts that upon execute will invoke a helper method that makes an HTTP Request using Named Credentials. The issue I am facing is that the response returns 200 OK in my sandbox, but 409 Conflict in production (Dropbox API). My remote site settings and named credential configs are exactly the same between sandbox and production.

The funny thing is if I call the helper function in apex anonymous, it works fine. I've tried isolating the problem and I'm sure it's something strange going on with running in Batch context.

Here's my stack trace in sandbox:

And in production:
 

Hi guys,

I have a Visualforce table that I'd like to dynamically filter through a VF picklist. The filter is a string, which is "Currency". So by default it is on USD and will show all records that are in USD, but I'd like to pick 'CAD' from a dropdown on the page and it will rerender the table with only CAD records.

I have borrowed some code from this discussion, but the button is so far unresponsive and doesn't rerender. I've attached my code below with only the relevant parts:

VISUALFORCE CODE
<apex:page controller="InvoicesReadyToPayV4">
    <apex:form>
    	<apex:pageBlock title="Test Report">
            <apex:pageBlockSection columns="1">
            	Select Currency:
                <apex:selectList size="1" value="{!currencyPickvalue}">
                	<apex:commandButton value="Go" action="{!getCurrency}" reRender="table1"/>
                	<apex:selectOption itemLabel="USD" itemValue="USD"></apex:selectOption>
                    <apex:selectOption itemLabel="CAD" itemValue="CAD"></apex:selectOption>
                    <apex:selectOption itemLabel="AUD" itemValue="AUD"></apex:selectOption>
                </apex:selectList>
            </apex:pageBlockSection>
            
              <!-- More code to create tables -->

        </apex:pageBlock>
    </apex:form>
</apex:page>

CONTROLLER
 
public class InvoicesReadyToPayV4 {
    public List<GEOinvoice__c> geoInvoices {get;set;}
    public List<Account> localPartners {get;set;}
    public Set<Id> localPartnerIds = new Set<Id>();
    public Map<Account, Decimal> LocalPartnerSum {get;set;}
    public Map<Account, String> LocalPartnerReady {get;set;}
    
    public String currencyPickvalue {get;set;}
    public String selectedCurrency {get;set;}
    //selectedCurrency = 'USD';	//Default
        
    public void getCurrency() {
        selectedCurrency = currencyPickvalue;
        System.debug('Selected Currency: ' + selectedCurrency);
        //Do I have to re-run the below method?
	}
    
    //Find all invoices to be shown in report
    public InvoicesReadyToPayV4() {
       
        geoInvoices = [SELECT Id, Name
                                    FROM GEOInvoice__c
                                   WHERE LP_invoice_currency__c = :selectedCurrency];

        //More code related to the tables
   }
}

I think what I'm trying to do is Click "Go", it passes the selected value to the "getCurrency" method, which initializes a string value for the currency in Apex so I can bind it in the SOQL query. Then the getCurrency method will run the main method again to re-render the page.

It looks like there's a few bumps I can't seem to figure out, and I've been racking my brains on this for ages!

Thanks in advance! 


 
Hi,

Within a visual flow, I'm wondering if I can populate a collection variable using semi-colon separated values (;) in a single input text box. For the use case, I'd like to append an ad-hoc Taskray Checklist to a Taskray Task using only the flow interface, but as the items are ad-hoc, I can't use a template for it.

For example, if I input this in ONE long text field:
Apples;
Bananas;
Carrots;


Can I pass it into a collection variable using a loop so it is [Apples, Bananas, Carrots]?

I have simulated this by using LEFT({!Checklist}, FIND(";", {!Checklist}) - 1) to get the first row and adding it to the collection variable, trimming it from {!Checklist} and doing it again for the second row, etc. This creates the collection var as long as I stick to the number of assignments I've used.

But the problem is I can't figure out how to build it into a loop to handle variable number of items. Is there any way to do this using only flow tools?

Thanks in advance :)