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

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 4
    Replies

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 :)