• rbohn
  • 0 Points
  • Member since 2013

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 6

I need a custom button who's logic is conditional based upon the STAGE field on the opportunity object.

Here is an actual example from Salesforce's help documentation.   It's basically a conditional test of country and then invokes several different URLs.

{!  IF(Sample.BillingCountry = "US", "http://maps.google.com/maps?q="&Sample.BillingStreet& "+"&Sample.BillingCity&"+"&Sample.BillingState&"+"&Sample.BillingCountry, (IF(Sample.BillingCountry = "UK", "http://maps.google.co.uk/maps?q="&Sample.BillingStreet &"+"&Sample.BillingCity&"+"&Sample.BillingCountry, "http://maps.google.com"))) }

For test purposes I've simplified the above example to the following:

IF( ISPICKVAL (Opportunity.StageName, "Approved"), 
"http://maps.google.com" ) 

This button code, which is just a simplification of the Salesforce example, gives a "URL DOES NOT EXIST ERROR" and results in the following URL when invoked.

Can anyone provide pointers on how to implement a customer button that can invoke both external URLs and Visualforce pages? 
  • March 16, 2013
  • Like
  • 0

I am trying to write a formula field to count the number of Contacts under an Account so that it could be used for reporting.  Can someone point me in the right direction for how to accomplish this?

I have a Task record type  "Log  Task" and a Event record type "Event Call"  on Event. (Task , Event belongs to Acivity Object)


I have created 2 fields on contact page , (i.e Annuity Field , Forecare Field)


1 . Annuity Field - this field should need to pull the most recent task record  Date of  "Annuity Task" Record type.(we have 2 other record types on Task).


2. Forecare Field - this field should need to pull the most recent event record Date of  "Event Call" Record type.(we have 2 other record types on Event).


While creating this field Annuity , Forecare   what  formulae should i need to write for this in formulae field criteria..


Fot More Understanding To Get Most Recent Activity Records, i Have written fromulae in formulae field  is    "LastActivityDate"  for a field Last Activity.



like that can any one suggest formulaes for this fields to get Last Task Records of  specific  Record Types. (because we have 2 other record types. )


  • September 12, 2013
  • Like
  • 0

I am trying to do a concatenate merging two text fields.  Occasioanlly the concatenated field may contain a duplicate value. I am looking for a way to delete the duplicate value so only the value only appears once. 


IE: Field 1: 123567,88595

      Field 2: 987987,88595


Concatenate Field Result: 123567,88595, 987987,88595


Desired Result: 123567,987987,88595


Can anyone suggest a way to do this? 

  • September 05, 2013
  • Like
  • 0

Hi Everyone ,


Nice to come with the wonderful doubt to the board.


I have written a trigger which is perform the rollup operation in lookup relation between 2 objects , I mean only counts the child records . 


I could have gone with the rollup summary field here but because of requirements , I wrote the trigger , the things here is like , we need to count the accounts which are all associated to single opportunity . 


Here is trigger i came up with  :


trigger OpportunityRollup on Account (after insert, after update, 
                                        before delete, after undelete) {

Set<Id>oppids=new Set<Id>();
List<Opportunity> oplist=new List<Opportunity>();
List<Opportunity> oppo=new List<Opportunity>();
    For(Account acc: Trigger.New)
    if(acc.RecordTypeId=='012R0000000D9iF' && acc.Opportunity__c!=null)
    oppo =[select Actual_Student_Accounts__c from Opportunity where Id IN: oppids];
    For(Opportunity oo:oppo)
    update oplist;




The trigger will fine , it bulkified by making query and dml outside of loop .


My quuestion here is :

Whenever a account is inserted , it will increament the count field in opportunity to which it is associated, 

so 2 accounts which are associated to 2 different accounts will increament the counter field in the opportunity to which it is associated respectively ,


But if 2 accounts which are associated to same accounts , since set is used to hold the opportunity id of the account , it increaments the counter field once . I tried with the List instead of Set . 


What should we do to make it work perfectly ?


Thanks in advance

Hi,  this is the first portion of my formula that updates a sales region field based on states and distribution channel.  When I run it, it updates all of the commercial channel accounts with the first IF statement value of "Commercial Central/West"  I can't figure out why it isn't reading or looking at the other if statements.  I didn't get any limitation or syntax errors when I created it.


IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "AK:AZ:CA:CO:HI:ID:MT:NV:NM:OR:UT:WA:WY")), "Commercial Central/West",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "ND:SD:MN:WI:MO")), "Commercial North Central",
IF(ISPICKVAL(Channel__c, "Commercial") && NOT(CONTAINS(ShippingState, "TX,AR,LA,OK")), "Commercial TALO",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "NE:KY:KS:MI:IA:IL:IN:OH")), "Commercial Midwest",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "ME:CT:DE:FL:MD:MA:WV:NH:NJ:NY:PA:RI:VT:VA:DC")), "Commercial East",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "NC:SC")), "Commercial NC/SC",
IF (ISPICKVAL(Channel__c , "Commercial") && NOT(CONTAINS ( ShippingState , "TN:GA:AL:MS")), "Commercial South East",
IF(ISPICKVAL(Channel__c, "Forensics") && NOT(CONTAINS(ShippingState,

Trying to lock editing on Opptys if they have one of two picklist values selected. Also need to except Admins from the rule.


My current attempt:


NOT($Profile.Id = "00e80000000zMnI") 


Thanks in advance!