• sss ppp
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 7
    Questions
  • 1
    Replies
Hi 
I am newbie

I have custom object let say Object1 having self relationship(Lookup) and custom field cost
I want to roll up summary field let say Sum on object1 using trigger
Please help.
How to write test class for below 

public class WrapperExample {

    Public list<Wrapaccount> wrapaccountList {get;set;}
    Public list<account> SelectedAccounts {get;set;}
    
    Public WrapperExample()
    {

        wrapaccountList=new  list<Wrapaccount>();
        for(account a:[SELECT id,name,billingcity,phone from account LIMIT 10]){
             wrapaccountList.add(new Wrapaccount(a));
        }
    }
    //Selected account shown by this method
    Public void ProcessSelected()
    {
        SelectedAccounts=new List<account>();
        for(Wrapaccount wrapobj : wrapaccountList)
        {
            if(wrapobj.isSelected==true)
            {
                SelectedAccounts.add(wrapobj.accn);
            }
        }
    }
    
    //This is wrapper Class
    Public class Wrapaccount{
        public account accn {get;set;}
        public boolean isSelected {get;set;}
        public Wrapaccount(account a)
        {
            accn=a;
            isSelected=false;
        }
    }
    

}
i am new to salesforce,Can anyone explain what is inline edit support?why it is used and how?
  • September 23, 2016
  • Like
  • 0
Hello guys,

Can anyone explain me this code.

<apex:page standardController="Opportunity" recordSetVar="accounts">
   <apex:form>
       <apex:selectList value="{!filterid}" size="1">
           <apex:selectOptions value="{!listviewoptions}"/>
       </apex:selectList>
       <apex:commandButton value="Go" action="{!list}"/>
   </apex:form>
</apex:page>
  • September 15, 2016
  • Like
  • 0
I am too confused in trigger.new and trigger.old.I fyou could give scenario based trigger example.
  • September 09, 2016
  • Like
  • 0
I want to update price to 100 of all Invoice Number whose status is 'open'.
Please help me write code.
  • September 08, 2016
  • Like
  • 0

Hi, I am trying to make a forumla on the Contact which takes its accounts billing state and correctly sets it to the proper abbreviation. Here is my formula:

 

if(Account.BillingState <> null,
	UPPER(LEFT(Account.BillingState,1))+
	if(LEN(Account.BillingState) = 2,
		UPPER(RIGHT(Account.BillingState,1)),
	if(CONTAINS(Account.BillingState, ' '),
		UPPER(LEFT(RIGHT(Account.BillingState, FIND(' ', Account.BillingState)), 1)),
	if(BEGINS(UPPER(Account.BillingState), 'T')||UPPER(Account.BillingState) = 'NEVADA'||UPPER(Account.BillingState) = 'MISSISSIPPI'||UPPER(Account.BillingState) = 'MINNESOTA',
		UPPER(LEFT(RIGHT(Account.BillingState, 2), 1)),
	if(UPPER(Account.BillingState) = 'ARIZONA'||UPPER(Account.BillingState) = 'MONTANA',
		UPPER(LEFT(RIGHT(Account.BillingState, 3), 1)),
	if(UPPER(Account.BillingState) = 'ALASKA'||UPPER(Account.BillingState) = 'MISSOURI',
		UPPER(LEFT(RIGHT(Account.BillingState, 4),1)),
	if(BEGINS(UPPER(Account.BillingState),'W')||BEGINS(UPPER(Account.BillingState),'A')||BEGINS(UPPER(Account.BillingState),'N')||BEGINS(UPPER(Account.BillingState),'U')||BEGINS(UPPER(Account.BillingState),'O')||BEGINS(UPPER(Account.BillingState),'D')||BEGINS(UPPER(Account.BillingState),'F')||BEGINS(UPPER(Account.BillingState), 'ID')||BEGINS(UPPER(Account.BillingState), 'IN')||BEGINS(UPPER(Account.BillingState), 'IL'),
		UPPER(LEFT(RIGHT(Account.BillingState, 1), 1)),
	if(BEGINS(UPPER(Account.BillingState),'V')||BEGINS(UPPER(Account.BillingState),'P')||BEGINS(UPPER(Account.BillingState),'L')||BEGINS(UPPER(Account.BillingState),'K')||BEGINS(UPPER(Account.BillingState),'G')||BEGINS(UPPER(Account.BillingState),'H')||BEGINS(UPPER(Account.BillingState),'I'),
		UPPER(RIGHT(Account.BillingState, LEN(Account.BillingState)-1)),
	if(BEGINS(UPPER(Account.BillingState), 'C'),
		if(LEN(Account.BillingState) < 11,
			UPPER(LEFT(RIGHT(Account.BillingState, 1), 1)),
		UPPER(RIGHT(Account.BillingState, LEN(Account.BillingState)-1))),
	if(BEGINS(UPPER(Account.BillingState), 'MAI')||BEGINS(UPPER(Account.BillingState), 'MAR'),
		UPPER(RIGHT(Account.BillingState, LEN(Account.BillingState)-1)),
	UPPER(LEFT(RIGHT(Account.BillingState, 1), 1))))))))))),
'')

 The logic I used is a little weird because of the 5000 char limit, but if you see any issues with it let me know because it's not working correctly.

Thanks!