• srilakshmi1.387861669756762E12
  • NEWBIE
  • 35 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 13
    Questions
  • 32
    Replies
Hai friends, if any one want this criteria go thuough it .

trigger UpdateAccount on Opportunity (after insert,after delete, after update ) {
   
    if(Trigger.isInsert) {
  
    List<Account> acc=new List<Account>();
    List<Id> listIds = new List<Id>();
  
    for (opportunity childObj : Trigger.new) {
        listIds.add(childObj.AccountId);
    }
   
    Map<id,Account> mapAccounts=new Map<id,Account>([SELECT Id,TotalCount__c FROM Account where Id IN :listIds]);
         
    for (Opportunity opp :trigger.new){
        account a=mapAccounts.get(opp.AccountId);
        if(a!=null) {
            if(a.TotalCount__c == null) a.TotalCount__c =100;
            if(opp.Count__c != null) {
                a.TotalCount__c -= opp.Count__c;
                acc.add(a);
            }    
        }
        for(integer i=0;i<acc.size();i++)
        {
            update acc;
        }
    } 
    }
    
          
    if(trigger.isDelete) {
   
    List<Account> acc=new List<Account>();
    List<Id> listIds = new List<Id>();
  
        for (opportunity childObj : Trigger.old) {
            listIds.add(childObj.AccountId);
        }
        Map<id,Account> mapAccounts=new Map<id,Account>([select id, TotalCount__C from Account where id=:listIds]);
        for (opportunity childObj : Trigger.old) {
            if(childObj.AccountId != null) {       
                account ac=mapAccounts.get(childObj.AccountId);
                ac.TotalCount__c -= childObj.Count__c;
                acc.add(ac);
            }
        }
        for(integer i=0;i<acc.size();i++)
        {
              update acc;
        }
     }

   
    if(trigger.isUpdate)
    {
    List<Account> acc=new List<Account>();
    List<Id> listIds = new List<Id>();
    List<opportunity> newopp=new List<opportunity>();
   
        for (opportunity childObj : Trigger.new) {
            listIds.add(childObj.AccountId);
            newopp.add(childObj);
        }
         
        Map<id,Account> mapAccounts=new Map<id,Account>([select id, TotalCount__C from Account where id IN :listIds]);
          
        for (opportunity childObj : Trigger.New) {
            account ac=mapAccounts.get(childObj.AccountId);
            Opportunity oldOp = Trigger.oldMap.get(childObj.ID);
           
                if(ac.TotalCount__C == null) ac.TotalCount__C = 100;
               
                if(childObj.Count__c !=oldOp.count__c)
                {
                    if(oldOp.count__c>childObj.count__c)
                    {
                        Decimal i=oldOp.count__c-childObj.count__c;
                        ac.TotalCount__C =ac.TotalCount__C+i;
                        acc.add(ac);
                     }
                     else if(oldOp.count__c<childObj.count__c)
                     {
                         Decimal i=childObj.count__c-oldOp.count__c;
                         ac.TotalCount__C =ac.TotalCount__C-i;
                         acc.add(ac);
                     }
                    update acc;
               
                }
            }
        }       
}


hai friends

i created a webservices class,for that i genarated wsdl file from this file i created .jar file ok fine.
now i want to give this jar file to another user he can use what ever the class,method that are in .jar file ,any one guide me please urgent
Hai friends in my controller program i have list of integers ,now i want to display it in my visual force page can any one help me
in controller:

public with sharing class list_test {
public list<integer> i { get; set; }
public list_test()
{
i=new List<integer>();
i.add(5);
i.add(10);
i.add(15);
i.add(20);
system.debug('111111111111'+i);
}

}
hi firends ,may be  this will help for you

<apex:page  renderAs="pdf">

<head>
<style type="text/css">

div.header {position: running(header)}
div.footer {position: running(footer)}
@page{
         @top-center {content: element(header)}
         @bottom-center {content: element(footer)}
     }   
</style>
</head>



<div class="header">
    <apex:image value="{!$Resource.tvarana_logo}" width="120" height="50"/>
</div>
<div class="footer" align="right">
    Date:<apex:outputText value="{!NOW()}"/>
</div>
<h1>
Editor's Note: Leonardo DiCaprio makes another Oscar-maybe move, James Franco responds to Of Mice and Men critics, and more in our pre-weekend roundup.

After getting beat down in one Oscar tourney after another (perhaps because he's too cool), Leonardo seems to be betting it all on "The Revenant," the new Alejandro González Iñárritu film based on Michael Punke's novel. As the Vanity Fair piece notes, this director's films have vaulted stars like Naomi Watts and Javier Bardem to the nomination list, and hopefully the sixth time's the charm.

The Broadway revival "Of Mice and Men" has been getting mixed-but-by-no-means-stinkaroo reviews (here's a favorable one in Variety). Star James Franco allowed himself to be wounded deeply enough by The New York Times' opinions that he cussed out reviewer Ben Brantley on Instagram. The comment has since been deleted, but just like Steinbeck's 1937 tale of friendship and humanity, the internet is forever.

To help you celebrate Easter this weekend, the AV Club has rounded up seventeen of the most terrifying bunnies in pop culture, from literary diehards like Bunnicula to angsty indie creatures like Frank from "Donnie Darko." I'm a "Night of the Lepus" fan from way back, so it's a sure bet that on Sunday morning I'll be eating Russell Stover marshmallow-filled eggs and watching gigantic mutated rabbits getting electrocuted on the train tracks. Joyous tidings!

The early creature design for 1987's "Predator" was nothing like you'd expect -- and it wasn't anything like Jean Claude Van Damme expected either. In the video below, you'll discover why the original costume was scrapped, and why The Muscles from Brussels decided not to play the now-iconic monster. I bet he's kicking himself now! (And since it's JCVD, he can actually do that.)
Editor's Note: Leonardo DiCaprio makes another Oscar-maybe move, James Franco responds to Of Mice and Men critics, and more in our pre-weekend roundup.

After getting beat down in one Oscar tourney after another (perhaps because he's too cool), Leonardo seems to be betting it all on "The Revenant," the new Alejandro González Iñárritu film based on Michael Punke's novel. As the Vanity Fair piece notes, this director's films have vaulted stars like Naomi Watts and Javier Bardem to the nomination list, and hopefully the sixth time's the charm.

The Broadway revival "Of Mice and Men" has been getting mixed-but-by-no-means-stinkaroo reviews (here's a favorable one in Variety). Star James Franco allowed himself to be wounded deeply enough by The New York Times' opinions that he cussed out reviewer Ben Brantley on Instagram. The comment has since been deleted, but just like Steinbeck's 1937 tale of friendship and humanity, the internet is forever.

To help you celebrate Easter this weekend, the AV Club has rounded up seventeen of the most terrifying bunnies in pop culture, from literary diehards like Bunnicula to angsty indie creatures like Frank from "Donnie Darko." I'm a "Night of the Lepus" fan from way back, so it's a sure bet that on Sunday morning I'll be eating Russell Stover marshmallow-filled eggs and watching gigantic mutated rabbits getting electrocuted on the train tracks. Joyous tidings!

The early creature design for 1987's "Predator" was nothing like you'd expect -- and it wasn't anything like Jean Claude Van Damme expected either. In the video below, you'll discover why the original costume was scrapped, and why The Muscles from Brussels decided not to play the now-iconic monster. I bet he's kicking himself now! (And since it's JCVD, he can actually do that.)
After getting beat down in one Oscar tourney after another (perhaps because he's too cool), Leonardo seems to be betting it all on "The Revenant," the new Alejandro González Iñárritu film based on Michael Punke's novel. As the Vanity Fair piece notes, this director's films have vaulted stars like Naomi Watts and Javier Bardem to the nomination list, and hopefully the sixth time's the charm.

The Broadway revival "Of Mice and Men" has been getting mixed-but-by-no-means-stinkaroo reviews (here's a favorable one in Variety). Star James Franco allowed himself to be wounded deeply enough by The New York Times' opinions that he cussed out reviewer Ben Brantley on Instagram. The comment has since been deleted, but just like Steinbeck's 1937 tale of friendship and humanity, the internet is forever.

To help you celebrate Easter this weekend, the AV Club has rounded up seventeen of the most terrifying bunnies in pop culture, from literary diehards like Bunnicula to angsty indie creatures like Frank from "Donnie Darko." I'm a "Night of the Lepus" fan from way back, so it's a sure bet that on Sunday morning I'll be eating Russell Stover marshmallow-filled eggs and watching gigantic mutated rabbits getting electrocuted on the train tracks. Joyous tidings!

The early creature design for 1987's "Predator" was nothing like you'd expect </h1>

</apex:page>
hai in my visual force page three buttons are there pdf,word,excel.when ever click on pdf the page is render as pdf,click on word that same page will be download as word file,click on excel excel file will be downloaded for that i wrote a code like this 


<apex:page standardController="account" recordSetVar="account" renderAs="{!if($CurrentPage.parameters.isPdf == null, null, 'pdf')}" contentType="{!if($CurrentPage.parameters.isWord== null, null,'application/x-excel#FileName.doc')}" extensions="pwe">
<apex:form >
<apex:pageBlock >
<apex:pageblockButtons >
<apex:commandButton value="pdf" action="/apex/automatic_insert?isPdf=true"/>
<apex:commandButton value="word" action="/apex/automatic_insert?isWord=ture"/>
<apex:commandButton value="excel" action="{/apex/automatic_insert?isExcel=ture"/>
</apex:pageblockbuttons>
<apex:pageBlockTable value="{!account}" var="a">
  <apex:column value="{!a.name}"/>
  <apex:commandButton action="{!save}" value="save"/>
  </apex:pageBlockTable>
  </apex:pageBlock>
</apex:form>
</apex:page>
 

but i am getting confusion with contentType.in <apex:page> we can place any one contentType.when how can i get excel with this code please help me ony one
Hi,
i wrote a code like this in html area but it is not working ,i think any setting problem .please help me process to execute the below code.
<script>  Sfdc.onReady(function() {    var keyPrefix = 'a7m';    var toRemove = document.getElementsByName('new');    if(document.location.href.indexOf('/' + keyPrefix + '/o') != -1 && toRemove && toRemove.length) {      toRemove[0].style.display = 'none';    }  });</script>
and also emable the Show Custom Sidebar Components on All Pages check box but it is not working
i think in Manage Users->users->Locale Settings->Locale is the current location of sales force user can ant one suggest is it corret or not please
firstly i prevented duplicates on email field.so when ever i insert new record if email field value match with previous values then it throug an error at that time i want to update any number field to increnent by 1(any field of previous recod) of lead that alredy contains this email id.please help me for this.
please explain the process for  creating a new account record ,for updating exciting record quickly 
means i wrote a trigger to send a mail .After sending mail for first time the status of that trigger is inactive(fires only onces).
means for example (.jpg)  extention takes images,(.txt) extention takes text files ,but i want an extention that takes both(image,text files).
Hai friends, if any one want this criteria go thuough it .

trigger UpdateAccount on Opportunity (after insert,after delete, after update ) {
   
    if(Trigger.isInsert) {
  
    List<Account> acc=new List<Account>();
    List<Id> listIds = new List<Id>();
  
    for (opportunity childObj : Trigger.new) {
        listIds.add(childObj.AccountId);
    }
   
    Map<id,Account> mapAccounts=new Map<id,Account>([SELECT Id,TotalCount__c FROM Account where Id IN :listIds]);
         
    for (Opportunity opp :trigger.new){
        account a=mapAccounts.get(opp.AccountId);
        if(a!=null) {
            if(a.TotalCount__c == null) a.TotalCount__c =100;
            if(opp.Count__c != null) {
                a.TotalCount__c -= opp.Count__c;
                acc.add(a);
            }    
        }
        for(integer i=0;i<acc.size();i++)
        {
            update acc;
        }
    } 
    }
    
          
    if(trigger.isDelete) {
   
    List<Account> acc=new List<Account>();
    List<Id> listIds = new List<Id>();
  
        for (opportunity childObj : Trigger.old) {
            listIds.add(childObj.AccountId);
        }
        Map<id,Account> mapAccounts=new Map<id,Account>([select id, TotalCount__C from Account where id=:listIds]);
        for (opportunity childObj : Trigger.old) {
            if(childObj.AccountId != null) {       
                account ac=mapAccounts.get(childObj.AccountId);
                ac.TotalCount__c -= childObj.Count__c;
                acc.add(ac);
            }
        }
        for(integer i=0;i<acc.size();i++)
        {
              update acc;
        }
     }

   
    if(trigger.isUpdate)
    {
    List<Account> acc=new List<Account>();
    List<Id> listIds = new List<Id>();
    List<opportunity> newopp=new List<opportunity>();
   
        for (opportunity childObj : Trigger.new) {
            listIds.add(childObj.AccountId);
            newopp.add(childObj);
        }
         
        Map<id,Account> mapAccounts=new Map<id,Account>([select id, TotalCount__C from Account where id IN :listIds]);
          
        for (opportunity childObj : Trigger.New) {
            account ac=mapAccounts.get(childObj.AccountId);
            Opportunity oldOp = Trigger.oldMap.get(childObj.ID);
           
                if(ac.TotalCount__C == null) ac.TotalCount__C = 100;
               
                if(childObj.Count__c !=oldOp.count__c)
                {
                    if(oldOp.count__c>childObj.count__c)
                    {
                        Decimal i=oldOp.count__c-childObj.count__c;
                        ac.TotalCount__C =ac.TotalCount__C+i;
                        acc.add(ac);
                     }
                     else if(oldOp.count__c<childObj.count__c)
                     {
                         Decimal i=childObj.count__c-oldOp.count__c;
                         ac.TotalCount__C =ac.TotalCount__C-i;
                         acc.add(ac);
                     }
                    update acc;
               
                }
            }
        }       
}


hai friends

i created a webservices class,for that i genarated wsdl file from this file i created .jar file ok fine.
now i want to give this jar file to another user he can use what ever the class,method that are in .jar file ,any one guide me please urgent
Hello All,

When i try to append a div tag which contains a component, Javascript is not working.
I am trying to display components as header and footer over a div.

I have pasted my code and please check it and tell me what is the issue.

 
mydiv = $('<div id="somediv" class="somediv"></div>');
             mydiv1 = $('<br/>');
             alert('1');
             footerdiv = $('<div id="somediv2" class="header1"><c:Template_Header /></div>');
            alert('3');
            headerdiv = $('<div id="header_next" class="footer1"><c:Template_Header /></div>');     
            alert('2');
             
            alert('4');
            mydiv1.appendTo('body');
            headerdiv.droppable().appendTo('body');
            mydiv.droppable().appendTo('body');
            footerdiv.droppable().appendTo('body');
Sometimes, footerdiv is working and it is not executing after headerdiv.

Thanks in Advance,

Regards,
Ganesh.B
hai in my visual force page three buttons are there pdf,word,excel.when ever click on pdf the page is render as pdf,click on word that same page will be download as word file,click on excel excel file will be downloaded for that i wrote a code like this 


<apex:page standardController="account" recordSetVar="account" renderAs="{!if($CurrentPage.parameters.isPdf == null, null, 'pdf')}" contentType="{!if($CurrentPage.parameters.isWord== null, null,'application/x-excel#FileName.doc')}" extensions="pwe">
<apex:form >
<apex:pageBlock >
<apex:pageblockButtons >
<apex:commandButton value="pdf" action="/apex/automatic_insert?isPdf=true"/>
<apex:commandButton value="word" action="/apex/automatic_insert?isWord=ture"/>
<apex:commandButton value="excel" action="{/apex/automatic_insert?isExcel=ture"/>
</apex:pageblockbuttons>
<apex:pageBlockTable value="{!account}" var="a">
  <apex:column value="{!a.name}"/>
  <apex:commandButton action="{!save}" value="save"/>
  </apex:pageBlockTable>
  </apex:pageBlock>
</apex:form>
</apex:page>
 

but i am getting confusion with contentType.in <apex:page> we can place any one contentType.when how can i get excel with this code please help me ony one
Hi,
i wrote a code like this in html area but it is not working ,i think any setting problem .please help me process to execute the below code.
<script>  Sfdc.onReady(function() {    var keyPrefix = 'a7m';    var toRemove = document.getElementsByName('new');    if(document.location.href.indexOf('/' + keyPrefix + '/o') != -1 && toRemove && toRemove.length) {      toRemove[0].style.display = 'none';    }  });</script>
and also emable the Show Custom Sidebar Components on All Pages check box but it is not working
i think in Manage Users->users->Locale Settings->Locale is the current location of sales force user can ant one suggest is it corret or not please

HI All,

 

I m trying to dispaly a multipicklist as checkboxes in vf page but not succeeding.

 

How can I display the picklists in below showed style.

 

Name of the field : testpick__c

values : a, b, c, d, e

Object name: test__c

 

Expected Output:

                                A                     B                        C                       D                      E

 

Testpick                   X                      X                        X                      X                        X 

 

 

Thanks in advance..........

 

I have a list of type String which contains objects of Salesforce like Contact, Account, Opportunity,quote,case etc.

I want to convert the list of string in sObject to use the following line.

 

List<String> a=new List<String>();a.add(sObject.valueOf('Account'));

a.add('Contact');

a.add('opportunity');

a.add('Quote');

a.add('Account');

 

for(String x:a)

{

Map<String,sObjectField> fmap=Schema.sObjectType.x.fields.getMap();

}

// but it  showing error. How i convert a string into Sobject.

 

the red color X is will be string from a list.....

 





  • June 23, 2011
  • Like
  • 0

Hi,

 

  I want to display the account and related contacts in the same visual force page. Actually i am achieved this like,

i am displayed the account names in first page block and am kept the command link for that account names if we click on that command link that will displayed the contacts related to that particular account in another pageblock. But, Now i want to display the account name first and all related contacts line by line. like that  i want to displat the contacts for all accounts. please any one help me how to solve this...

 

 

example

Maple Lawn Office III
8161 Maple Lawn Blvd
Fulton, MD 20759

Contact: Lydia Chandlee
G & R Management
840 First Street, NE
Washington, DC 20002

Phone: 301-807-0271
Fax: 202-898-0053
Email: 

Contract: No
Inspection Date: 4/6/2010
Inspection Type: Annual
5 Year Test: 2012
Reg/Serial #: HO1863
Service Company: Kone
Equipment Type: Passenger Hydraulic
Annual Price (per unit): $180
Semi-Annual Prince (per unit): $80

Maple Lawn Office III
8161 Maple Lawn Blvd
Fulton, MD 20759

Contact: Lydia Chandlee
G & R Management
840 First Street, NE
Washington, DC 20002

Phone: 301-807-0271
Fax: 202-898-0053
Email: 

Contract: Yes
Inspection Date: 4/6/2010
Inspection Type: Annual
5 Year Test: 2012
Reg/Serial #: HO1863
Service Company: Kone
Equipment Type: Passenger Hydraulic
Annual Price (per unit): $180
Semi-Annual Prince (per unit): $80

 

 

 

thanks,

yamini

  • March 29, 2011
  • Like
  • 0