• Amit Bangad
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 13
    Replies
Hi All,

I have been fighting this problem from the past 8 hours now :( .I have created an Email Template(Visualforce) and generated an email attachment PDF using an apex:component something like :

<messaging:emailTemplate subject="Invoice {!relatedTo.Inv__c}" recipientType="Contact" relatedToType="kognoz1__Invoice2__c" replyTo="noreply@abc.com">
<messaging:htmlEmailBody >  
    <html>
        <body>
            <c:StandardInvoiceTemplate/>
        </body>
        <BR/><BR/>
    </html>
</messaging:htmlEmailBody>
<messaging:attachment renderAs="PDF" filename="Invoice {!relatedTo.Inv__c}"> 
<c:StandardInvoiceTemplate/>
</messaging:attachment>   
<messaging:plainTextEmailBody >
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

SO you can see both body and attachment are same for testing purpose, my plan is to clear the body later.

In the component I have applied style for a table and its <tr> like :

.pageBlockCss {
        border-collapse:collapse;
        border-width: 1px;
        border-color: black;
        border-style:solid;
    }
    .pageBlockCss tr{
        border-width: 1px;
        border-color: black;
        border-style:solid;
        
    }

Issue is : when I send I preview it, in the browser preview the borders appear just fine but in the PDF ands email body that comes to me, the borders just wipe out.

When I remove border-collapse:collapse; table borders are restored but the tr borders still dont appear.

I found couple of post to include style tag in head tag. I tried all but in vain !!

What is that I am missing here?

thanks,
Amit
Hi,

When converting a lead how do I change the default from 'Create New Project' as Account Name to creating a new opportunity?
Hi All,

I have been fighting this problem from the past 8 hours now :( .I have created an Email Template(Visualforce) and generated an email attachment PDF using an apex:component something like :

<messaging:emailTemplate subject="Invoice {!relatedTo.Inv__c}" recipientType="Contact" relatedToType="kognoz1__Invoice2__c" replyTo="noreply@abc.com">
<messaging:htmlEmailBody >  
    <html>
        <body>
            <c:StandardInvoiceTemplate/>
        </body>
        <BR/><BR/>
    </html>
</messaging:htmlEmailBody>
<messaging:attachment renderAs="PDF" filename="Invoice {!relatedTo.Inv__c}"> 
<c:StandardInvoiceTemplate/>
</messaging:attachment>   
<messaging:plainTextEmailBody >
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

SO you can see both body and attachment are same for testing purpose, my plan is to clear the body later.

In the component I have applied style for a table and its <tr> like :

.pageBlockCss {
        border-collapse:collapse;
        border-width: 1px;
        border-color: black;
        border-style:solid;
    }
    .pageBlockCss tr{
        border-width: 1px;
        border-color: black;
        border-style:solid;
        
    }

Issue is : when I send I preview it, in the browser preview the borders appear just fine but in the PDF ands email body that comes to me, the borders just wipe out.

When I remove border-collapse:collapse; table borders are restored but the tr borders still dont appear.

I found couple of post to include style tag in head tag. I tried all but in vain !!

What is that I am missing here?

thanks,
Amit
Hi,
I am trying to pass Account id through param to the controller , but controller is not recieving that value from my visualforce page.
Please Help me out and give me the reason .
I tried with all javascript , jsquery and param too, so if you find anything extra please ignore as i am trying to do by any method that might work.
Here is the code

Visualforce Page :-

<apex:page controller="AccountListController" docType="html-5.0" id="pg">
    <style>
        .requiredLoaderBG{
        background-color: rgb(71,71,71);
        opacity:0.7;
        filter:alpha(opacity=70);
        background-image:url('{!$Resource.ajaxLoadGif}');
        background-position: center center;
        background-repeat: no-repeat;
        height: 100%;
        left: 0;
        position: fixed;
        text-align: center;
        top: 0;
        width: 100%;
        z-index: 1;
    }
    </style>
    <script>
    function setaccvalue(accountid){
        alert(accountid);
        alert(document.getElementByid("pg\:frm\:PagBlck\:AccIdcheck").value);
        document.getElementByClassName('AccClass')[0].value = accountid;
        alert(document.getElementByClassName('AccClass')[0].value);
    }
   
    </script>
   
          <apex:form id="frm">
          <apex:pageBlock id="PagBlck">
          <apex:commandButton value="Create Account" action="{!save}" reRender="frm" status="actStatus"/>
          <apex:actionFunction action="{!save}"  status="actStatus" name="actfunct" reRender="frm,fields"/>
          <apex:actionFunction name="accparam" reRender="AccIdcheck">
              <apex:param name="p1" value="" assignTo="{!Acid}" />
          </apex:actionFunction>
          <apex:actionStatus startStyleClass="requiredLoaderBG" id="actStatus"></apex:actionStatus>
          <Div align="right">
              <apex:inputText value="{!Acid}" styleClass="AccClass" id="AccIdcheck"/>
              <apex:inputHidden value="{!Acid}" id="myHiddenField"/>
              <apex:inputText value="{!num}" style="width:45px"/>
              <apex:commandButton value="Add rows" action="{!add_rows}" reRender="tblop" status="actStatus"/>
          </Div>
          <apex:outputPanel rendered="{!val}" id="tblop">
              <apex:pageBlockTable value="{!AccoList}" var="Alst"  id="tbl">
                  <apex:column value="{!Alst.name}" rendered="{!if(Alst.name != null , true ,false)}"/>
                  <apex:column >
                      <apex:inputField value="{!Alst.name}" rendered="{!if(Alst.name != null ,false,true)}"/>
                  </apex:column>
                 
                  <apex:column >
                      <!--<input type="button"  value="Create" onclick="actfun"> <!-- onclick="actfunct();" - ->
                              <apex:param value="{!Alst.id}" name="Acntid" assignTo="{!Acid}"/>
                      </input> -->
                      <apex:commandLink value="Create"   action="{!Save}"> <!-- action="{!Save}" -->
                          <apex:param value="{!Alst.id}" assignTo="{!Accid}"/>
                      </apex:commandLink>
                  </apex:column>
              </apex:pageBlockTable>
          </apex:outputPanel>
         
          <apex:pageBlockSection id="fields" rendered="{!Not(val)}">
              <input type = "button" value = "Save" onclick = "CrtCont();" />
              <apex:actionFunction action="{!SaveContact}" status="actStatus" name="CrtCont" />
                      <apex:inputField value="{!Con.firstname}"/>
                      <apex:inputField value="{!Con.lastname}"/>
          </apex:pageBlockSection>
         <!-- apex:pageBlockSection rendered="{!Not(val)}">
              <apex:inputField value="{!Acc.name}"/>
              <apex:inputField value="{!Acc.Phone}"/>
              <apex:inputField value="{!Acc.type}"/>
              <!--<apex:selectRadio value="{!Acc.Rating}">
                    <apex:selectoptions value="{!types}"></apex:selectoptions>
              </apex:selectRadio> - ->
              <c:PicklistValue />
          </apex:pageBlockSection> -->
         </apex:pageBlock>
      </apex:form>
    
</apex:page>

Apex :-

Public Class AccountListController{
    Public List<Account> AccoList {get; set;}
    Public Contact Con {get; set;}
    Public Account Acc {get; set;}
    Public Boolean val {get; set;}
    Public String Acid {get; set;}
    public integer num {get; set;}
    Public String Accid{get; set;}
   
    Public AccountListController(){
        Con = new Contact();
        Acc = new Account();
        val = true;
        AccoList = [Select id, name from Account limit 1000];
    }
    /**Public List<Account> getAcco(){
        AccoList = [Select id, name from Account limit 1000];
        return AccoList;
    }**/
    Public PageReference Save(){
        val = false;
       // Acid = apexpages.currentpage().getparameters().get('Acntid');
        System.debug('++++++Acid+++++'+Acid);
        //Con.Accountid = Acid ;
        upsert AccoList;
        return null;
    }
    Public PageReference SaveContact(){
        //Accid = Apexpages.currentpage().getparameters().get('p1');
        System.debug('++++++Acid+++++'+ Accid);
        Con.Accountid = Accid ;
        insert Con;
        if(Acc.name != null)
        insert Acc;
        return null;
    }
     Public PageReference add_rows() {
        for(integer i=0;i<num ;i++)
            {
            System.debug('======Entering===='+i);
              AccoList.add(new Account());   
            }
            return null;
     }
    Public PageReference SaveAccount(){
        return null;
    }
    Public List<SelectOption> getTypes(){
        Schema.sObjectType sobject_type = Account.getSObjectType();
        Schema.DescribeSObjectResult sobject_describe = sobject_type.getDescribe();
        Map<String, Schema.SObjectField> field_map = sobject_describe.fields.getMap();
        List<Schema.PicklistEntry> pick_list_values = field_map.get('Rating').getDescribe().getPickListValues();
        List<selectOption> options = new List<selectOption>();
        for (Schema.PicklistEntry a : pick_list_values) {
             options.add(new selectOption(a.getLabel(), a.getValue()));
          }
        return options;
    }
}
Good Morning:

I have the following piece of code that I am having some issues with.

What I am trying to do is to pull all Billing_Account__c records where Billing_Account__c.Zip_Code__c = MTU_Location__c.Zip_Code__c and Billing_Account__c.Address_1__c CONTAINS MTU_Location__c.Street_Address__c. After doing so, I want to update Billing_Account__c.MTU_Location__c with MTU_Location__c.ID.

The query should return multiple records to update, which it does, but that is causing my trigger to erorr out - I am getting the SOQL returned multiple rows for assignment error.

How to I re-write this so that it pulls multiple records but allows me to update multiple records?

Thanks,

Matt

for(MTU_Location__c mtuRecord : addMTUList){
            Billing_Account__c mtuUpdate = [Select ID, Address_1__c, Zip_Code__c, MTU_Location__c from Billing_Account__c where Zip_Code__c = :mtuRecord.Zip_Code__c];
                if(mtuUpdate.Address_1__c.CONTAINS(mtuRecord.Street_Address__c)){
                    mtuUpdate.MTU_Location__c = mtuRecord.ID;}


           
            updateBillingAccountList.add(mtuUpdate);
           
        }
        update updateBillingAccountList;
Hi,

we have a Enterprize WSDL which method need to call to create a case and how can we call it.
If you have any document  please share it.
can any one explain me about locking statements.

when the record is locked.
when the record is released.
Hi All

Can any one help me , 
without disturbing standard functionality of account team related list , need on inline vf as I need to show 3 more fields on inline 

example:  team member : data user, team role : Accouunt Manager - this is standard related  list 

but for me need to add two more fields which from user oobject say user email and user id  on the same related list 

so can any one help me on this VF code?


  • April 04, 2014
  • Like
  • 0
Hi Experts,

Hope u all are doing good !

I am running a batch class however I see that after processing some batches the batch class execution ends with the error "Batchable instance is too big:". I tried executing the batch class by passing the smaller batch size (like 10,50, etc..) and also not implementing database,stateful, still facing the same issue. 

Looking for any help. Thanks in advance !!

Thanks,

Prashant
I have a requirement where i have to get the all the object records (Entity_Name__c is a text field which contains object name in Policy_Type__c object ) and update those records in object Audit_Trail__c.
1> we need to query Policy_Type__c from which we will query all records of object(whichever is defined like account,contact etc) in Entity_Name__c
2> Condition__c is a text field where we define the condition on which SOQL will run .
3>After we get all records of object from Entity_Name__c we need to update these records in another object Audit_Trail__c

I'm getting Error : Constructor not Defined : Btach class when i'm trying to execute it in Developer console

Batch Class :-

global class POLICY implements Database.Batchable<sObject>, Database.Stateful{
    Policy_Store__c myVariable = new Policy_Store__c();
    String objectname = myVariable.Entity_Name__c;
    String Condition = myVariable.Condition__c;
     String query1;
      String query2;
           
     //Constructor
      global POLICY(String query2){
     
     query1 = 'Select Id, Name From '+objectname+' Limit 10000';
      List<sObject> L = database.query(query1);


   query2 = 'Select Id, Name,Policy_Type__c,Entity_Name__c,('+query1+') From Policy_Store__c where Policy_Type__c = "SOQL" and '+String.valueOf(Condition)+'';
   List<sObject> L2 = database.query(query2);

         }
      // Start Method
   global Database.QueryLocator start(Database.BatchableContext BC){
      return Database.getQueryLocator(query2);
   }
   // Execute Mehod
   global void execute(
                Database.BatchableContext BC,
                List<Policy_Store__c> scope){
      //for(sObject s : scope){
               //Summary = s.get('Policy_Store__c.Object_Name__c');
      //}
      Audit_Trail__c[] AudT = new List<Audit_Trail__c>();
       for (Audit_Trail__c Au : AudT) {
             Au.Entity_Name__c = myVariable.Entity_Name__c;
            
             AudT.add(Au);


       }
        if(AudT.size()>0){
    insert AudT;

}


       }

  

global void finish(Database.BatchableContext BC){
   }
}
  • April 04, 2014
  • Like
  • 0