• sf.azzola.01
  • NEWBIE
  • 0 Points
  • Member since 2011

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

We have a public form which allows certain guest users to compile a custom object. When the form is submitted, the custom object is committed (create), and a PDF summary is sent to the customer. The form is a Visual Force page, the PDF summary is another Visual Force page with 'renderAs=PDF' enabled. We use the PageReference class from VF->A to obtain the PDF from VF->B. It works fine in our Sandbox environment, but when the code is deployed to Production, at the same conditions, it throws the error "java.net.NoRouteToHostException: No route to host".

 

We tried forcing the host with internal URLs (....c.na1.visual.force.com...) but it doesn't work. We added the Site URL to the allowed remote sites with no success, we also tried various configuration with setRedirect enabled and not... any suggestion?

I have two global classes. In the CreateAndModify class i have an execute functions which has a for loop which calls a processRecord method of my other class i.e CreateAndModifyProcessor. The problem is that there is a collection of list declared in my first class which i cannot access in the second class. Is there any way to do it and is it even a good ides to do it this way ?..

 

global class CreateAndModify implements
Database.Batchable<sObject>, Database.Stateful{

global void execute(
        Database.BatchableContext BC,

        List<sObject> listObj){


            list <Account__c> inAcc = new list<Account__c>();
                 
            for (sObject lo : listObj){
                processor.processRecord(lo);
                }

               insert inAcc; // The list object which i am modifying in the processRecord function has to be added to the database. So, is it

                                      // a good idea to add/populate the list in other function of other class
            }

 

global class CreateAndModifyProcessor {
    global void processRecord(sObject listObj){
        Unprocessed_Agreement__c temp = (Unprocessed_Agreement__c)listObj;
        
        Account__c tempAcc = new Account__c();
    
        inAcc.add(tempAcc); // This line throws an error
}
}