• Atomic1
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies

We are trying to create an email form in VF that contains cross object fields.  We have everything working using the {!relatedTo:   }.  However, we cannot get it to work on any custom fields.  Is there a special way to input that in this test? {!relatedTo:account.name}  would be an example of a standard field.  {!relatedTo:account.customer_number__c} would be a custom field??  That errors out.

 

 

We are creating our first VF email template and are having issues with bringing in the customer billing address.  We've followed all the rules that work with other fields but the address just won't come through.

 

We've tried:

 

!account.billing.address

!account.billingaddress

!account.address

!opportunity.account.billing.address

etc.

 

Can anyone help?

 

 

Hi, I need some help created a validation rule in which only 3 user profiles that I define can edit an opportunity after it is closed one.  It would probably use the ISCHANGED command.
 
 I had created an S-control that over rode the edit button but inline editing conflicts with that and we want to use inline editing.
 
Thanks in advance for any help.   
I'm trying to create a formula field that looks at the billing state and country fields and the industry (K-12) and then populates the field with either East, West or Other.  I keep getting "Syntex Error".  Here's the formula.  Any ideas?
 

IF (LEN (BillingState)=0, "None",

IF(AND(CONTAINS("BC:AB:SK:YT:NT:NU:HI:AK:WA:OR:CA:ID:NV:MT:UT:AZ:WY:CO:NM", BillingState),CONTAINS("USA:Canada",BillingCountry),CONTAINS("K12", Industry)),"West",

IF(AND(CONTAINS("TX:MN:IA:MO:ND:SD:WI:NE:IL:KS:OK",BillingState),CONTAINS(“USA:Canada",BillingCountry)CONTAINS("K12", Industry)),"West",

IF(AND(

CONTAINS("MI:IN:OH:PA:NY:MD:DE:NJ:CT:RI:MA:VT:NH:ME:DC:ON:QC:NB:NS:PE:NL:MB", BillingState),CONTAINS("USA:Canada",BillingCountry)CONTAINS("K12", Industry)),"East",

IF(AND(

CONTAINS("KY:WV:VA:TN:NC:AR:LA:MS:AL:GA:SC:FL", BillingState),CONTAINS("USA:Canada",BillingCountry)CONTAINS("K12", Industry)),"East", "International")))))

  • September 26, 2007
  • Like
  • 0
We are restructuring our company and are looking at both team selling and territory management.  I have two questions:  1. Are there any negatives of either that anyone is aware of? and 2. If I request territory management turned on in my sandbox and then don't want to move forward with it, will a refresh eliminate it?
  • September 11, 2007
  • Like
  • 0

We are creating our first VF email template and are having issues with bringing in the customer billing address.  We've followed all the rules that work with other fields but the address just won't come through.

 

We've tried:

 

!account.billing.address

!account.billingaddress

!account.address

!opportunity.account.billing.address

etc.

 

Can anyone help?

 

 

I'm trying to create a formula field that looks at the billing state and country fields and the industry (K-12) and then populates the field with either East, West or Other.  I keep getting "Syntex Error".  Here's the formula.  Any ideas?
 

IF (LEN (BillingState)=0, "None",

IF(AND(CONTAINS("BC:AB:SK:YT:NT:NU:HI:AK:WA:OR:CA:ID:NV:MT:UT:AZ:WY:CO:NM", BillingState),CONTAINS("USA:Canada",BillingCountry),CONTAINS("K12", Industry)),"West",

IF(AND(CONTAINS("TX:MN:IA:MO:ND:SD:WI:NE:IL:KS:OK",BillingState),CONTAINS(“USA:Canada",BillingCountry)CONTAINS("K12", Industry)),"West",

IF(AND(

CONTAINS("MI:IN:OH:PA:NY:MD:DE:NJ:CT:RI:MA:VT:NH:ME:DC:ON:QC:NB:NS:PE:NL:MB", BillingState),CONTAINS("USA:Canada",BillingCountry)CONTAINS("K12", Industry)),"East",

IF(AND(

CONTAINS("KY:WV:VA:TN:NC:AR:LA:MS:AL:GA:SC:FL", BillingState),CONTAINS("USA:Canada",BillingCountry)CONTAINS("K12", Industry)),"East", "International")))))

  • September 26, 2007
  • Like
  • 0
Hi:

Thank you for attending one of my hands-on sessions on  S-Controls.
I hope Dreamforce was a great experience for you.

I have set up this discussion for class members to post and answer questions you might have after Dreamforce.

Please add your question under this post and a class participant or myself will answer you.

I will monitor this post for 2 weeks after Dreamforce.

Thank you

Here is the source:

Code:
<html>
<head>
<!-- Answers this is the working scontrol for class -->
<!-- author Michael Fullmore Salesforce.com -->
<!-- version .1 8/21/2007 -->
<!-- version 1.0 8/28/2007 -->

 <!-- addes the salesforce.com css file (look and feel) -->
 <link href="/dCSS/Theme2/default/common.css" media="handheld,print,projection,screen,tty,tv" rel="stylesheet" type="text/css" />
 
 <!-- adding my own styles to this scontrol -->
 <style type="text/css">
  .edit{display:none;}
  p{width:70%}
 </style>
 
    <!-- these two script tags add the salesforce.com AJAX API and are required to "talk to salesforce" -->
    <script type="text/javascript" src="/js/functions.js"></script>
    <script src="/soap/ajax/10.0/connection.js"></script>
    
    <!-- this script tag starts our code, you can have as many script tags in your file as needed. we only need 1 for this demo -->
    <script type="text/javascript">
    
    //create the oppty object
    var opp = {id:"{!Opportunity.Id}", stage:"{!Opportunity.StageName}", nextStep:"{!Opportunity.NextStep}", description:"{!Opportunity.Description}"};
    
 //create an array of stages that we want to lock
    var lockedStages = ["Perception Analysis","Proposal/Price Quote","Negotiation/Review"," Closed Won","Closed Lost"];
    
    //checking to see if the user has access or not
    function doesUserHaveAccess(){
     //this is the first AJAX call, nice! Bonus points, what is it doing—
     var user = sforce.connection.getUserInfo();
     
     //get the profile name
     var profileNameQuery = sforce.connection.query("select Name from Profile where Id = '" + user.profileId + "'");
     var profileNameRecords = profileNameQuery.getArray("records");
     var profileName = profileNameRecords[0].Name;
     
     //next check if the user is locked out of oppty
     if(profileName == 'System Administrator'){ //adding TEST to the system administrator string to test with sys admin

      //using URLFOR to "skip over the override the second time around.
      window.parent.location.href = "{!URLFOR($Action.Opportunity.Edit, Opportunity.Id,[retURL=URLFOR($Action.Opportunity.View, Opportunity.Id)],true)}";
     }else{
           
      //if the user is not in the admin user group then we show the edit page for them. This page just gives us access to 3 fields on the opportunity
      showPage();
     }
    }
    
    function showPage(){
     document.getElementById('edit').style.display = 'block';
     document.getElementById('next').value = opp.nextStep;
     document.getElementById('des').value = opp.description;
    }
    
    //custom edit screen button actions
    function saveEdit(){
     //create an opportunity object
     var o = new sforce.SObject("Opportunity");
     
     //fill the opportunity SObject with data
      o.Id = opp.id;
      o.NextStep = document.getElementById('next').value;
      o.Description = document.getElementById('des').value;
      
     //save the SObject to salesforce, using the AJAX Tool Kit
     var saveO = sforce.connection.update([o]);
      if(saveO[0].getBoolean("success") == false){
       error(saveO[0]);
      }
     //go back to the opportunity
     window.parent.location.href = "/" + opp.id;
    }
    
    function cancelEdit(){
     window.parent.location.href = "/" + opp.id;
    }
    
    //help error function
    function error(e){
     alert("There is an error\n\n" + e);
    }
    
    //where the page starts it's loading
    function initPage(){
    
     var isLocked = false;
     //this function starts the process, every scontrol needs to start somewhere, and I like using initPage
     
     //first thing we need to do is check to see what stage the oppty is in.
     for(i=0; i<lockedStages.length; i++){
      if(opp.stage == lockedStages[i]){
       //if it's in a "locked" stage then we go and see if the user has access.
       isLocked = true;
       break;
      }
     }
     if(isLocked){
      doesUserHaveAccess();
     }else{
   //if the oppty is not is the "locked" stages then put up the normal edit page
      window.parent.location.href = "{!URLFOR($Action.Opportunity.Edit, Opportunity.Id,[retURL=URLFOR($Action.Opportunity.View, Opportunity.Id)],true)}";     
     }
    }
    
/****************************************************************************************************
**what's next–                      *
**Try adding a stage advancer, something that puts the opportunity in the next stage for the reps *
**Add your own fields                    *
**Display read only fields                   *
****************************************************************************************************/ 
    
    </script>
</head>
<body onload="initPage();" class="opportunity overviewPage">
 <div id="edit" class="edit">
  <div class=bPageTitle>
   <div class="ptBody secondaryPalette">
    <div class="content">
     <img class="pageTitleIcon" title="Opportunity" alt="Opportunity" src="/s.gif"/>
      <h1 class="pageType">Opportunity Edit (Custom)<span class="titleSeparatingColon">:</span></h1>
      <h2 class="pageDescription">{!Opportunity.Name}</h2>
      <br>
    </div>
   </div>
  </div>
  <div class="bPageBlock secondaryPalette">
   <div class="pbBody">
    <div class="pbSubsection">
     <p>This Opportunity is in a stage that is locked by your company. The only fields that you have access to are 
     Next Steps and Description. If you need to make edits to other fields please contact your Administrator. <br>Thank you.</p>
     <label for="next">Next Step:&nbsp;&nbsp;&nbsp;</label>
     <input type="text" id="next" size="80" />
     <br><br>
     <label for="des">Description:</label>
     <textarea id="des" cols="60" rows="5"></textarea>
     <br><br>
     <input type="button" id="btn1" value="Save" class="btn" onclick="saveEdit();" />
     <input type="button" id="btn2" value="Cancel" class="btn" onclick="cancelEdit();" />
    </div>
   </div>
  </div>
 </div>
</body>
</html>

 



Message Edited by mikef on 09-21-2007 11:59 AM

  • September 15, 2007
  • Like
  • 0
We are restructuring our company and are looking at both team selling and territory management.  I have two questions:  1. Are there any negatives of either that anyone is aware of? and 2. If I request territory management turned on in my sandbox and then don't want to move forward with it, will a refresh eliminate it?
  • September 11, 2007
  • Like
  • 0