• Denver Greene
  • NEWBIE
  • 0 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 6
    Questions
  • 1
    Replies

When I refresh a sandbox the org id changes. This causes links with external systems to break and so they need to be updated. Is there any way for developers to get the org ID automatically, without having to log in to the sandbox? Ideally this would happen in the sandbox post refresh apex class that runs automatically.

I was initially going to try sending an email, but in the post refresh you can only send system emails. I could log in and change the email deliverability settings, but then it can't happen as part of the refresh which is kind of the whole point.

Validating something with ISBLANK formula doesn't work in a visualflow. Why not? I know several work arounds. I want to know why this hasn't been fixed yet when it's been known for 5 years per this idea. https://success.salesforce.com/ideaView?id=08730000000hpR4AAI
I am using the Public Knowledge Base. When people submit a case from there, the name, email, and subject are all bundeled together in the Description field in the Case. Is there a way to map those inputs into the appropriate fields instead? This works fine when I use a web-to-case that I embed on my website, but not the one through the PKB site.
I am calling a flow within a flow. The master flow runs perfeclty fine up until the subflow runs. The detail flow runs perfectly fine, the very last thing in it is a screen letting me know the values. Then it get brought to a completely different screen that says "An internal server error has occurred". With the Error ID: 1553215959-66751 (1132121848).

The subflow really just takes a string input from a multi-select choice field and turns it into a collection variable (for looping). Ater a bit of testing it seems that I cannot pass a collection variable from the subflow to the master flow. Is this broken, or is this how it is supposed to be? Is there any way to do this?

In my visual workflow my first screen has a multi-select checkbox when we record which subjects our customers are interested in. I want to add these choices to a Collection Variable so that I can use them in a loop. But nothing I have tried seems to work.

It's strange because the {!subjecInterest} variable is all of the checked subjects concatonated.
Currently I am using an Assigment to add all the subjects directly (not the variables), and then looping through those and seeing if {!subjectInterest} contains the subject string.

There has to be a better way. Unfortunately dynamic choice only searches records, not fields. 

I have a opportunity in a master-detail relationship with a custom object (related list). I need a field in the opportunity that takes a value from the MOST RECENT related custom object.

Opportunity = textbook adoption
Custom object (Class Size) = number of  students in class.

Every year there is a new class size, so we need to be able to see the sum (rollup, which I have) and we need to see the current class size. Various other formula fields run off of value.

I haven't found a way to do this using regular formulas, so I fear I need to use Apex.

When I refresh a sandbox the org id changes. This causes links with external systems to break and so they need to be updated. Is there any way for developers to get the org ID automatically, without having to log in to the sandbox? Ideally this would happen in the sandbox post refresh apex class that runs automatically.

I was initially going to try sending an email, but in the post refresh you can only send system emails. I could log in and change the email deliverability settings, but then it can't happen as part of the refresh which is kind of the whole point.

I am new to apex, I have created a button to call the apex class through the visual force page. 

Here is my visual force page code. 
<apex:page standardController="Opportunity"
 extensions="myclass"
 action="{!autoRun}">
</apex:page>
Here is my apex class.
public class myclass {
    private final Opportunity o;
    String tmp;
   public myclass(ApexPages.StandardController stdController) {
        this.o = (Opportunity)stdController.getRecord();
    }
    public PageReference autoRun() {
        String theId = ApexPages.currentPage().getParameters().get('id');
 
        for (Opportunity o:[select id, name, AccountId,  from Opportunity where id =:theId]) {
 
                 //Create the Order
                    Order odr = new Order( 
                    OpportunityId=o.id
                    ,AccountId = o.AccountId
                    ,Name = o.Name
                    ,EffectiveDate=Date.today()
                    ,Status='Draft'
                    );
                insert odr;
                tmp=odr.id;            
              }                 
        PageReference pageRef = new PageReference('/' + tmp); 
        pageRef.setRedirect(true);
        return pageRef;
      }
}
I want to create test class. I don't know how to refer PageReference autoRun() method from test class. Guys need help if some one can tell me about test class of this apex class.