• employAstar 5
  • NEWBIE
  • 0 Points
  • Member since 2018

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 4
    Replies
Sent file as URL to Indeed to be indexed but now they want the URL to be
We cannot use the URL provided as it requires another step to download the file.
 
Please provide a URL where the XML data can be retrieved directly, or we can set up a FTP account for you where you can upload the file to.
 
constructor:
public GSTOrginal(){appointment1 = new SCSCHAMPS__Appointment__c();appde= new SCSCHAMPS__Appointment__c();
invBill=new Invoice__c();
invfp = new Invoice__c();
totall = 0;
contactList  = new List<ContactWrapper>();
 cb=false;
 flag='false';
 AppList = new List<AppWrap>();
 addMore();
 selectedRowIndex = '0';
 inv = [SELECT id,Name,Invoice_Date__c  FROM Invoice__c ORDER BY Name DESC LIMIT 1];
  String s1= inv.Name;
  invNo = (Long)Long.valueOf( s1.substring(3));
return page method:
 ref.getParameters().put('flag1',String.valueOf(flag));
            ref.getParameters().put('ids',strids);
            ref.getParameters().put('ep1',ep);
            ref.getParameters().put('toi1',toi);
            ref.getParameters().put('stax1',stax);
            ref.getParameters().put('scurr1',scurr);
            ref.getParameters().put('pos',pos);
            ref.getParameters().put('sop1',sop);
            ref.getParameters().put('accId',appointment.SCSCHAMPS__Employer__c);
            ref.getParameters().put('startDate',string.valueOf(bc.Invoicing_Start_Date__c));
            system.debug('bc.Invoicing_Start_Date__c'+bc.Invoicing_Start_Date__c);
            ref.getParameters().put('endDate',string.valueOf(bc.Invoicing_End_Date__c));
            system.debug('bc.Invoicing_End_Date__c'+bc.Invoicing_End_Date__c);
            
            //GST Implementation
            ref.getParameters().put('taxa1',taxa);
            ref.getParameters().put('addG1',addG);
            ref.getParameters().put('gst1',gst);
          
            if(edate!=null)
             ref.getParameters().put('edt',string.valueOf(edate));
            else 
             ref.getParameters().put('edt',string.valueOf(Date.Today()));
             if(bdate!=null)
             ref.getParameters().put('bdt',string.valueOf(bdate));
            else 
             ref.getParameters().put('bdt',string.valueOf(Date.Today()));  
            ref.setRedirect(false); 
            english_number();
            this.myList =myList ; 
                 List<Invoice__c>  inm2= [SELECT id,Name,Invoice_Date__c  FROM Invoice__c Where Id =: inv.id LIMIT 1];
            AppList[0].Invp=inm2[0];    } 
     attachPdfToAccount( invBill.Billing_Calendar__c, appointment.SCSCHAMPS__Employer__c,inv.id);      
       flag = 'attach';          
        return ref;                
}
attacgment method
public void attachPdfToAccount(String  invBillCalendar, String appointmentEmployer, String invId){  
Attachment myAttach1 = new Attachment();
                flag = 'attach';
                myAttach1.ParentId = invId;
                inm1= database.query('SELECT id,Name,Invoice_Date__c  FROM Invoice__c Where Id =: invId'); 
                myAttach1.name =inm1.name +'.pdf';
               //ref = page.Consolidated_Special_Invoice;

         if(appointment1.SCSCHAMPS__Employer__c=='0016F00001tJirW')
            {
            ref=page.Tesco_Special_Invoice_GST;
            }
            else if( (appointment1.SCSCHAMPS__Employer__c=='0016F00001tJirY') )
            {
            ref=page.Wipro_Special_Invoice_GST;
             system.debug('wipro special invoice');
            }
            else if( (appointment1.SCSCHAMPS__Employer__c=='0016F00001tJira') )
            {
            ref=page.IBM_Special_Invoice_GST;
             
            }
          
            else if (appointment1.SCSCHAMPS__Employer__c=='0016F00001tJPRC')
            {
          //  ref=page.First_American_Special_Invoice_GST;
         ref=page.FAGSTVFPORGINAL;
            }
            else if (appointment1.SCSCHAMPS__Employer__c=='0016F00001tJirS')
            {
            ref=page.SAP_Labs_Special_Invoice_GST;
            }
            else if (appointment1.SCSCHAMPS__Employer__c=='0016F00001tJPLG')
            {
            ref=page.BNP_Paribas_Special_Invoice_GST;
            }
            else if (appointment1.SCSCHAMPS__Employer__c=='0016F00001tJPKh')
            {
            ref=page.Amdocs_Special_Invoice_GST;
            }
            else if (appointment1.SCSCHAMPS__Employer__c=='0016F00001tJirU')
            {
            ref=page.True_Blue_Special_Invoice_GST;
            }
            else if( (appointment1.SCSCHAMPS__Employer__c=='0016F00001tJPSe') )
            {
            ref=page.GenpactSpecialInvoiceGST;             
            }
             else if( (appointment1.SCSCHAMPS__Employer__c=='0016F00001sbvvM') )
            {
            ref=page.Special_Invoice_GSTAccenture_updated;             
            }
            else if( (appointment1.SCSCHAMPS__Employer__c=='0016F00001yyxQS') )
            {
            ref=page.Experis_IT_Special_invoice;             
            }
            else if( (appointment1.SCSCHAMPS__Employer__c=='0016F00002Ca81c') )
            {
            ref=page.SAP_Premium_special_invoice_GST;             
            }
            else if( (appointment1.SCSCHAMPS__Employer__c=='0016F00002HFdk7') )
            {
            ref=page.SAP_education_special_invoice_gst;             
            }
            else
            {
            ref = page.Consolidated_Special_Invoice_GST;}
               
               ref.getParameters().put('inm1',String.ValueOf(inm1.Name));
                ref.getParameters().put('accId',acc.Id);
                ref.getParameters().put('flag1',String.valueOf(flag));
                ref.getParameters().put('ep1',ep);
                ref.getParameters().put('toi1',toi);
                ref.getParameters().put('stax1',stax);
                ref.getParameters().put('scurr1',scurr);
                ref.getParameters().put('pos',pos);
                ref.getParameters().put('sop1',sop);
                ref.getParameters().put('ids',strids);
                
                //GST Implementation
                ref.getParameters().put('taxa1',taxa);
                ref.getParameters().put('addG1',addG);
                ref.getParameters().put('gst1',gst);
            
                ref.getParameters().put('startDate',string.valueOf(bc.Invoicing_Start_Date__c));
                ref.getParameters().put('endDate',string.valueOf(bc.Invoicing_End_Date__c));
                
                if(edate!=null)
                ref.getParameters().put('edt',string.valueOf(edate));
                else 
                ref.getParameters().put('edt',string.valueOf(Date.Today())); 
                if(bdate!=null)
             ref.getParameters().put('bdt',string.valueOf(bdate));
            else 
             ref.getParameters().put('bdt',string.valueOf(Date.Today())); 
               ref.setRedirect(false);
                //myAttach1.body = ref.getContentAsPDF();    
               
               //ref.getParameters().put('flag1','print');
               Blob body;
               
                try {

          // returns the output of the page as a PDF
             body = ref.getContent();
             

            // need to pass unit test -- current bug    
             } catch (VisualforceException e) {
            body = Blob.valueOf('Some Text');
         }
          myAttach1.body=body;
          myAttach1.IsPrivate = false;
         insert myAttach1;
         
            }
         
}
page to input  invoice values
page to output for relevant account
 

Hello,

 

I am trying to code two VF pages that share one controller. The first page displays some data along with a selection table. The second page renders the output as a PDF page.

 

All works well except the display of the "selected items" table. After the user presses the "Generate RMA" button, I create a new list with all of the rows that were selected in the first page. Nothing displays for this table. All other data displays correctly.

 

I will upload the code for all three objects.

 

One observation: I have one field that I display on the second page that I don't display on the first (Claim__c.Claim_Company__c). Nothing would ever display on the second page for that field until I included it as a hidden input field on the first page. Then it worked perfectly. The table object that will not display is also a field that never appears on the first page. Could this be a similar issue?

 

An update:

I added these two lines in the ClaimRMAPDFTemplate:

{!selectedCDLIs[0].Claim_LI_Total_Claim_Quantity_Involved__c}
{!CDLIs[0].CDLI.Claim_LI_Total_Claim_Quantity_Involved__c}

 

The first returned no value, the second returned the quantity from the first row of the selection table.

 

This again seems to indicate that the selected-row-list (created in savePDF method, appears to be empty in the ClaimRMAPDFTemplate. I have system.debug statements that show that the list is definitely populated.

Why does the second page see no data in that list?

 

My whole purpose for the second list is to exclude the rows in the first list that were not selected. Is it possible to simply skip rows in the second VF page that are not selected? I was experimenting with the "rendered" attribute. I could make it work on the column component, but not on the datatable component.

 

Thanks.

 

Bryan Hunt