• @taani.ax1426
  • NEWBIE
  • 35 Points
  • Member since 2012

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

I have rendered a vf page as pdf. I am unable to change the fon-family to arial.

 

I have used

<style type=text/css>

p

{

font-family:"Arial Unicode MS";

font-size:14pt;

}

span

{

font-family:"Arial Unicode MS";

font-size:8pt;

}

h1

{

font-family:"Arial Unicode MS";

font-size:9pt;

}

</style>

<p>some text1</p>

<span>some text2</span>

<h1>some text3</h1>

--- - --  - - -- -  -

- - - - - - - --

But the problem here is am getting a new line everytime I use <p> and <h1> tag.

I dno't want this new line to occur.

Also I tried using <h2>,<h3>,.. , <pre>, <b> and

display:inline;

 

 

How to get the font family as arial without a new line. Also how to make the text bold?

I have tried <b> tag and

font-family:"Arial Unicode MS Bold";

 

Its not working.

 

 

Pls help.

 

 

HI, 

 

I am using this formula field to map the value of picklist from Account to Lead. Formula is saved, however value is not coming. Please help

 

IF( INCLUDES( Account__r.HAS_Account_Vertical__c , "LV-D"), "LV-D; ","")+

IF( INCLUDES(Account__r.HAS_Account_Vertical__c , "LV-G"), "LV-G; ", "")+
IF( INCLUDES(Account__r.HAS_Account_Vertical__c , "On-Hwy"), "On-Hwy; ", "")+

IF( INCLUDES(Account__r.HAS_Account_Vertical__c , "Off-Hwy"), "Off-Hwy; ", "")

 

Regards

Hi,

 

I want Lead Title should be mapped to Opportunity Name on conversion of lead. Please help me with some piece of code.

 

Eg:

Lead title is "XYZ", when I convert that lead, new opp should be created with the Opp Name: XYZ

 

Regards,

Taani

HI,

 

Can anyone help me by answerwing, how to save the uploaded file in visualforce page to some "TEST" folder in documents. Please check teh code below:

 

VF page:

<apex:page standardController="Account" extensions="AttachmentUploadExtension">
<apex:form enctype="multipart/form-data">

  <apex:pageMessages />
<apex:pageBlock >
<apex:pageBlockSection title="Attachment for Survey Monkey File" columns="2"/>
<apex:pageBlockSection >
 
        <apex:pageBlockSectionItem >
          <apex:outputLabel value="File Name" for="fileName"/>
          <apex:inputFile value="{!document.body}" filename="{!document.name}" id="fileName"/>
</apex:pageBlockSectionItem>
</apex:pageBlockSection>

<apex:pageBlockButtons >
                <apex:commandButton action="{!upload}" value="Save"/>
            </apex:pageBlockButtons>


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

 

 

 

Controller:

public class AttachmentUploadExtension{

  public AttachmentUploadExtension() {}
  public ID folderid{get;set;}

 
  public Attachment attachment {
  get {
      if (attachment == null)
        attachment = new Attachment();
      return attachment;
    }
  set;
  }
  public AttachmentUploadExtension(ApexPages.StandardController controller) {
            }

 
  public PageReference upload() {
 
    attachment.OwnerId = UserInfo.getUserId();
     
              attachment.IsPrivate = true;
               
        try {
      insert attachment;
    } catch (DMLException e) {
      ApexPages.addMessage(new ApexPages.message(ApexPages.severity.ERROR,'Error uploading attachment'));
      return null;
    } finally {
      attachment = new Attachment();
    }
 
    ApexPages.addMessage(new ApexPages.message(ApexPages.severity.INFO,'Attachment uploaded successfully'));
    return null;
  }
 
}

 

 

Thanks,

taani

Hi,

 

I made one VF page, code given below. My requirement is when user select any record from look up(Site_Address__c), the value of some field from Site address should map to some fields in Contact, as "Street"which is in Street Adress, should populate in "Mailing Street" of contacts. I dont want this when user save the record(as it can be done by trigger), I want as soon user chose any record, correspond to that record value should populate.(By onchange).

 

Can any one provide me soln for this with sample code?

 

<apex:page standardController="Contact" >

    <apex:form >
        <apex:pageBlock >

                    <apex:pageBlockSection title="Address Information" columns="2">
                    <apex:outputPanel layout="block"> 
                    <label for="checkbox">Select address from existing address </label> 
                    <input id="checkbox" type="checkbox"/> 
                    </apex:outputPanel>
                     <apex:inputField value="{!contact.Site_Address__c}" />                   

                     

                               
                <apex:inputField value="{!Contact.MailingStreet}"/>
                <apex:inputField value="{!Contact.MailingCity}"/>
                <apex:inputfield value="{!Contact.MailingState}"/>
                <apex:inputfield value="{!Contact.MailingPostalCode}"/>
                <apex:inputfield value="{!Contact.MailingCountry}"/>
               
                                             


                            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

Thanks

Hi All,

 

I have a requirement, there is two object, one standard(Account), one custom(Deal), and look up relation is there.

I made one VF page on Account, and there is lookup for Deal name, what my requirement is:

 

On the selection of particular deal name thru lookup ,few field from "Deal" should be auto populated in some field of "Account".

 

Eg:

There is Phone number in deal object, when user choose Deal1, then phone number associate with deal1 should populate in Phone number field in Account object.

 

Please help in this, and provide sample code.

 

Regards,

Taani

 

 

Hi,

 

I want to add one checkbox on Account thru VF page, I want existing page just with that check box. And also, if that checkbox is checked one field should be enable.

 

Pls help me with code ASAP...

 

Thanks,

Taani!

HI,

 

I want to set default value for Required field of standard object. Before insert trigger is not working on that. Help me.

 

Eg: There is Last name in Lead, which is required field, what my business requirement is when i click on save without entering the field value in "Last Name",trigger would update "XYZ" value in that standard field.

 

Hope my requirement is clear. any help would be appreciated.

 

regards,

Taani

Hi,

 

I am having a custom object called "Deal", my requirement is when I clicked on deal tab, there should be one Search option should come on the top of the record,as there are 100+records in Deal, so when i enter any word in text box called "search records", related to specific word, record should come from database. for example if I type Chevrolet, then all information related to Account "Chevrolet" should come.

 

please help.

 

regards,

Taani

HI,

 

Can anyone describe me Standard and custom controller with a real time example..:(..Not able to analyze the diff yet. This would be fake if I continue working without knowing this.

 

Regards,

Taani

HI,

 

I read lots of things about standard list controller, but still coudn't understand logic behind that. Just understood one line from chapter VI, "Standard list controllers allow you to create Visualforce pages that can display or act on a set of records.".Couldn't find that whats the need and where it to be used.

 

Help me to understand.

 

Thanks,

taani

HI,

 

Need to convert blobs in byte, as file to be send to sharepoint.

 

thanks

Hi All,

I  am unable to search user in Lightning version though I am able to search user in Classic version. I am assigned to profile which has very limited access to tab and Apps.

But why it is searchable in Classic and not in lightning. I see People option in Classic only.

Kindly suggest me if I need to change setting in Lightning.

Classic




User-added image

Regards,
Vinay

 

Hello Everyone,
I would like to know about creating popup/modal through lightning component.
Thanks
Regards

 
Hi,

I want to send an email alert to task owner if they have any open task which due date is already passed.
I want to send it 1 day after due date and 1 week after due date.
Please suggest how I can achieve it because through workflow it is not achievable.

Regards
Emily
I'm doing the simple lightning components challenge and have hit this problem in my existing trailhead org and a brand new dev org that I've just created:

Challenge not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: QVWBQHAG

Error:Apex trigger UpdateOpptIndirect caused an unexpected exception, contact your administrator: UpdateOpptIndirect: execution of AfterUpdate caused by: System.EmailException: SendEmail failed. First exception on row 0; first error: INVALID_FIELD_WHEN_USING_TEMPLATE, When a template is specified the plain text body, html body, subject and charset may not be specified : []: Class.AP_OpportunityUpdate.NotifyOpportunityOwner: line 74, column 1

 

CLASS :-

 

public class AP_OpportunityUpdate
{
public static boolean blnflag=false;  
public static void upDateOpt(list<Opportunity> lstOpt,Map<id,Opportunity> mpoldvalues)
{
map<id,id> mapOpportunityOwnerId=new map<id,id>();
Set<id> stAccountId=new set<id>();

list<UserRole> userRoleMap=new list<UserRole>([select Id from UserRole where name='indirect']);
blnflag=false;
for(Opportunity opt: lstOpt)
{
    if(opt.ownerid==userinfo.getuserid() && userinfo.getUserRoleId()!=userRoleMap[0].id && opt.StageName!=mpoldvalues.get(opt.id).stageName && opt.StageName=='Closed Won'  )
    {
        mapOpportunityOwnerId.put(opt.id,opt.ownerid);
        stAccountId.add(opt.accountid);
    }
}


set<id> stEmail=new set<id>();
list<Opportunity> lstOpprtunityToUpdate=new list<Opportunity>();
for(Opportunity varOpts:[SELECT AccountId,Owner.name,Owner.email,owner.userRole.Name FROM Opportunity  where AccountId In :stAccountId AND owner.userRole.Name='Indirect'])
{
//stEmail.add(varOpts.Owner.Email);
stEmail.add(varOpts.Ownerid);
  varOpts.StageName='Closed Lost';
    varOpts.Won_Lost_Reason__c='Won by Current Channel';
    lstOpprtunityToUpdate.add(varOpts);

}
update lstOpprtunityToUpdate;
NotifyOpportunityOwner(lstOpprtunityToUpdate);
//NotifyOpportunityOwner(stid);
blnflag=true;
}
public static void NotifyOpportunityOwner(list<opportunity> lstOpprtunityToUpdate)
{
/*list<id> lstmail=new list<id>();
lstmail.addall(stmail);*/

list<Messaging.singleEmailMessage> lstMailmail = new list<Messaging.singleEmailMessage>();

for(opportunity varOpt: lstOpprtunityToUpdate)

{
Messaging.singleEmailMessage mail = new Messaging.singleEmailMessage();
 
//list<string> lstmails =new list<string>();
//lstmail.addall(stmail);
//string strusr1='';
/*for(integer i=0; i<lstmail.size(); i++ )
{
if(i==0)
{
strusr1=lstmail[i];
}
lstmail.remove(strusr1);*/
//mail.setToAddresses(lstmail);

 // The email template ID used for the email
   mail.setTemplateId('00XK0000000DjTU');
 mail.setTargetObjectId(varOpt.ownerid);

  mail.whatid=varOpt.id;
  mail.saveAsActivity = false;
    //mail.whatid='001K000000MqbEp';
 
 lstMailmail.add(mail);  
system.debug('---------------->'+lstMailmail.size()); 
system.debug('---------------->'+lstMailmail); 
if(!lstMailmail.isEmpty())
{   
Messaging.sendEmail(lstMailmail);
}
}
}
}

Trigger :-

 

trigger UpdateOpptIndirect on Opportunity (After update) 
{
if(AP_OpportunityUpdate.blnflag==false)
{
AP_OpportunityUpdate.upDateOpt(trigger.new,Trigger.oldmap);

}




}

i have written a class which i'm calling through trigger .

 

I have a account say TEST :-

TEST account has several opportunities in its related list i.e both DIRECT and INDIRECT.

and opportunity are of 2 types direct and indirect based on user's role and record type i.e if user role is indirect then its an indirect opportunities.

 

So,

I want ..If the account owner has an existing opportunity  of his own and it’s marked closed/won then all the Indirect opportunity stage  related to account TEST should change to as closed/lost with a reason of “won by current channel”

Hi,

 

I want Lead Title should be mapped to Opportunity Name on conversion of lead. Please help me with some piece of code.

 

Eg:

Lead title is "XYZ", when I convert that lead, new opp should be created with the Opp Name: XYZ

 

Regards,

Taani

Hi,

 

I made one VF page, code given below. My requirement is when user select any record from look up(Site_Address__c), the value of some field from Site address should map to some fields in Contact, as "Street"which is in Street Adress, should populate in "Mailing Street" of contacts. I dont want this when user save the record(as it can be done by trigger), I want as soon user chose any record, correspond to that record value should populate.(By onchange).

 

Can any one provide me soln for this with sample code?

 

<apex:page standardController="Contact" >

    <apex:form >
        <apex:pageBlock >

                    <apex:pageBlockSection title="Address Information" columns="2">
                    <apex:outputPanel layout="block"> 
                    <label for="checkbox">Select address from existing address </label> 
                    <input id="checkbox" type="checkbox"/> 
                    </apex:outputPanel>
                     <apex:inputField value="{!contact.Site_Address__c}" />                   

                     

                               
                <apex:inputField value="{!Contact.MailingStreet}"/>
                <apex:inputField value="{!Contact.MailingCity}"/>
                <apex:inputfield value="{!Contact.MailingState}"/>
                <apex:inputfield value="{!Contact.MailingPostalCode}"/>
                <apex:inputfield value="{!Contact.MailingCountry}"/>
               
                                             


                            </apex:pageBlockSection>
            <apex:pageBlockButtons >
                <apex:commandButton action="{!save}" value="Save"/>
            </apex:pageBlockButtons>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

Thanks

Hi,

 

I want to add one checkbox on Account thru VF page, I want existing page just with that check box. And also, if that checkbox is checked one field should be enable.

 

Pls help me with code ASAP...

 

Thanks,

Taani!

HI,

 

I want to set default value for Required field of standard object. Before insert trigger is not working on that. Help me.

 

Eg: There is Last name in Lead, which is required field, what my business requirement is when i click on save without entering the field value in "Last Name",trigger would update "XYZ" value in that standard field.

 

Hope my requirement is clear. any help would be appreciated.

 

regards,

Taani

I have a multi-select picklist on the Account Object.  We want to see(reference) that field on the Opportunity object. 

 

Is there a workaround to do this since the multi-select can't be used in a formula field?

 

Thanks in advance for any help!!!!