• Sameer Tyagi
  • NEWBIE
  • 10 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 3
    Replies
Hi I need to show  spaces between rightside and left side of title attribute 


<apex:page >
    <apex:pageBlock title="leftside of title               <Need extra spaces here  >                                                                    rightside of title">

    </apex:pageBlock>
</apex:page>

Regards
Sameer

HI, I need help. 

I copied pregenerated html pages from web to lead and web to case and merge it... 
but I able to create only lead with this code. 
I am trying to change it with a picklist 



<html>
<body onload="onloadmethod();">


<script type="text/javascript">
function myFunction(optype )
{
     console.log('test');

   if(optype == "4"){
     document.getElementById('lead').style.visibility='visible';  
     document.getElementById('case').style.visibility='hidden';
     document.getElementById('Theform').action = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
      
   }
    else {
document.getElementById('lead').style.visibility='hidden';
        document.getElementById('case').style.visibility='visible';
document.getElementById('Theform').action= 'https://www.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8';


   }
}

     function onloadmethod(){
  document.getElementById('lead').style.visibility='hidden';
 
     }
</script>

<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">

<form id = "Theform" action="" method="POST">

<input type=hidden name="oid" value="00D90000000jaBs">
<input type=hidden name="retURL" value="http://">

</br>

<center><label >Type of Request</label>&nbsp;&nbsp;

<select  onchange = "myFunction(this.value);">

  <option value="2">Message</option>
  <option value="3">I will miss a lesson</option>
  <option value="4">New Student Enquiry/Registration Request</option>
  <option value="5">I want to be in the band</option>
  <option value="6">Transfer/New Time Request</option>
  <option value="7">Cancel/Drop Lesson</option>
</select></br></br></center>

<div id = "lead">
<label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

<label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>

<label for="email">Email</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br>

<label for="company">Company</label><input  id="company" maxlength="40" name="company" size="20" type="text" /><br>

<label for="city">City</label><input  id="city" maxlength="40" name="city" size="20" type="text" /><br>

<label for="state">State/Province</label><input  id="state" maxlength="20" name="state" size="20" type="text" /><br>

<input type="submit" name="submit">
</div>


<div id = "case">

<label for="name">Contact Name</label><input  id="name" maxlength="80" name="name" size="20" type="text" /><br>

<label for="email">Email</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br>

<label for="phone">Phone</label><input  id="phone" maxlength="40" name="phone" size="20" type="text" /><br>

<label for="subject">Subject</label><input  id="subject" maxlength="80" name="subject" size="20" type="text" /><br>

<label for="description">Description</label><textarea name="description"></textarea><br>

<input type="submit" name="submit">

</div>



</form

</body>
</html>

==========

Your help would be appricated. 

HI 

I want to show dependent picklist on vf page and the value of controlling field I am setting on constructor of controller.
So my controlling picklist should be hidden and dependent picklist should be shown on vf page.
I have two picklist on object srobject__c
controller  organisation  picklist = abc,xyz
dependent picklist  : department  -- abc ={123,234.456}
xyz = 678,789,901



My code is :
public class sample{
public srobject__c newser {get;set}
public sample(){
}
newsr = new srobject__c();
            newsr.organization__c = 'abc';    //value of controlling picklist

}

===============page================
<apex:page  controller="sample">

<apex:inputField value="{!srvar.department__c}" />
</apex:page>
=================

please suggest me the code , your help would be appriciated.
Regards,
Sameer Tyagi

I have two datetime variable

datetime dt1 = obj.lastdate__c;
datetime dt2 = system.now();


I need to calculate  dt1 - dt2  in days hours minutes

Please suggest a sample code. Your help would be appricated.

I have a .doc type  attachment  , Attachment contains some images and text . I want to show all content of this attachment on vf page. 

I am able to show pdf, images type attachment preview on vf page , issue is only with (.doc, docx, .ppt ) file. it downloads the attachment instead of showing in new tab.

If attachment is 'attach' which is document file and it may contain images and text.
If I convert body to string like this  and show string on vf page in outputtext
string attachbody =  attach.body.tostring();
I am getting error not UTF-8 type string,

if I use this code show string on vf page in outputtext
string attachbody =  base64Encode(attach.body);
I am getting exceed 135 kb error

Your help would be appriciated. Please send me sample code. 
OR javascript jquery code if required. 

Hi, 

1) I am saving incoming Email body content in html attachment.  
with this code
Attachment attach = new Attachment(Name = newEmail.Name + '.html', Body = Blob.valueOf(email.htmlBody),
                        ContentType = '.html', ParentId = newEmail.id); 
                insert attach;

2) now I am using the body of attachment like this ..

string attachBody=attach.Body.toString();

3)  I am using string 'attachBody' on vf page like this
<apex:outputText escape="false" value="{!attachBody}">

Now issue is that..  I am unable to see few images on vf page. 

As I see in debug logs, I found 

1. if  string 'attachBody'  contains this <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAacAAAD7CAIAAABBtsz  ... that is visible to me on vf page.
2. if  string 'attachbody' contains this <img src="cid:3442459202_25472939  ...  I see broken image 

Your help would be appricaited.  

Sameer Tyagi


 

 

my vf page is

<apex:page  controller="showAttach" renderAs="">
<apex:form >
<apex:pageBlock mode="maindetail">

<apex:outputLabel escape="false" value = "{!attachBody}"></apex:outputLabel>
</apex:pageBlock>
</apex:form>
</apex:page>

controller is

public class showAttach{
   public transient String attachBody{get; set;}
   
    public showAttach() {
        String str =ApexPages.currentPage().getParameters().get('id');
       
        Attachment att =[SELECT Name,Id,Body FROM Attachment where Id = :str LIMIT 1];
        transient blob b = att.body;
           
        attachBody= EncodingUtil.base64Encode(b);
       
        insert d;
        }
}

my vf page is

<apex:page  controller="showAttach" renderAs="">
<apex:form >
<apex:pageBlock mode="maindetail">

<apex:outputLabel escape="false" value = "{!attachBody}"></apex:outputLabel>
</apex:pageBlock>
</apex:form>
</apex:page>

controller is

public class showAttach{
   public transient String attachBody{get; set;}
   
    public showAttach() {
        String str =ApexPages.currentPage().getParameters().get('id');
       
        Attachment att =[SELECT Name,Id,Body FROM Attachment where Id = :str LIMIT 1];
        transient blob b = att.body;
           
        attachBody= EncodingUtil.base64Encode(b);
       
        insert d;
        }
}

HI, I need help. 

I copied pregenerated html pages from web to lead and web to case and merge it... 
but I able to create only lead with this code. 
I am trying to change it with a picklist 



<html>
<body onload="onloadmethod();">


<script type="text/javascript">
function myFunction(optype )
{
     console.log('test');

   if(optype == "4"){
     document.getElementById('lead').style.visibility='visible';  
     document.getElementById('case').style.visibility='hidden';
     document.getElementById('Theform').action = 'https://www.salesforce.com/servlet/servlet.WebToLead?encoding=UTF-8';
      
   }
    else {
document.getElementById('lead').style.visibility='hidden';
        document.getElementById('case').style.visibility='visible';
document.getElementById('Theform').action= 'https://www.salesforce.com/servlet/servlet.WebToCase?encoding=UTF-8';


   }
}

     function onloadmethod(){
  document.getElementById('lead').style.visibility='hidden';
 
     }
</script>

<META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8">

<form id = "Theform" action="" method="POST">

<input type=hidden name="oid" value="00D90000000jaBs">
<input type=hidden name="retURL" value="http://">

</br>

<center><label >Type of Request</label>&nbsp;&nbsp;

<select  onchange = "myFunction(this.value);">

  <option value="2">Message</option>
  <option value="3">I will miss a lesson</option>
  <option value="4">New Student Enquiry/Registration Request</option>
  <option value="5">I want to be in the band</option>
  <option value="6">Transfer/New Time Request</option>
  <option value="7">Cancel/Drop Lesson</option>
</select></br></br></center>

<div id = "lead">
<label for="first_name">First Name</label><input  id="first_name" maxlength="40" name="first_name" size="20" type="text" /><br>

<label for="last_name">Last Name</label><input  id="last_name" maxlength="80" name="last_name" size="20" type="text" /><br>

<label for="email">Email</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br>

<label for="company">Company</label><input  id="company" maxlength="40" name="company" size="20" type="text" /><br>

<label for="city">City</label><input  id="city" maxlength="40" name="city" size="20" type="text" /><br>

<label for="state">State/Province</label><input  id="state" maxlength="20" name="state" size="20" type="text" /><br>

<input type="submit" name="submit">
</div>


<div id = "case">

<label for="name">Contact Name</label><input  id="name" maxlength="80" name="name" size="20" type="text" /><br>

<label for="email">Email</label><input  id="email" maxlength="80" name="email" size="20" type="text" /><br>

<label for="phone">Phone</label><input  id="phone" maxlength="40" name="phone" size="20" type="text" /><br>

<label for="subject">Subject</label><input  id="subject" maxlength="80" name="subject" size="20" type="text" /><br>

<label for="description">Description</label><textarea name="description"></textarea><br>

<input type="submit" name="submit">

</div>



</form

</body>
</html>

==========

Your help would be appricated. 

HI 

I want to show dependent picklist on vf page and the value of controlling field I am setting on constructor of controller.
So my controlling picklist should be hidden and dependent picklist should be shown on vf page.
I have two picklist on object srobject__c
controller  organisation  picklist = abc,xyz
dependent picklist  : department  -- abc ={123,234.456}
xyz = 678,789,901



My code is :
public class sample{
public srobject__c newser {get;set}
public sample(){
}
newsr = new srobject__c();
            newsr.organization__c = 'abc';    //value of controlling picklist

}

===============page================
<apex:page  controller="sample">

<apex:inputField value="{!srvar.department__c}" />
</apex:page>
=================

please suggest me the code , your help would be appriciated.
Regards,
Sameer Tyagi

Hi, 

1) I am saving incoming Email body content in html attachment.  
with this code
Attachment attach = new Attachment(Name = newEmail.Name + '.html', Body = Blob.valueOf(email.htmlBody),
                        ContentType = '.html', ParentId = newEmail.id); 
                insert attach;

2) now I am using the body of attachment like this ..

string attachBody=attach.Body.toString();

3)  I am using string 'attachBody' on vf page like this
<apex:outputText escape="false" value="{!attachBody}">

Now issue is that..  I am unable to see few images on vf page. 

As I see in debug logs, I found 

1. if  string 'attachBody'  contains this <img src="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAacAAAD7CAIAAABBtsz  ... that is visible to me on vf page.
2. if  string 'attachbody' contains this <img src="cid:3442459202_25472939  ...  I see broken image 

Your help would be appricaited.  

Sameer Tyagi