• Robert Robinson 17
  • 0 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 3
  • 1
Java Script issue - referencing record type
I am following up after a consultant that used JavaScript to direct users to 1 of 2 record types from an Account Related List. I have added a 3rd record type, and am trying to create a button that references the JavaScript. Here is the code that I am working with:

var opportunity = new sforce.SObject('Opportunity'); 

opportunity.Name = 'Do Not Delete'; 
opportunity.AccountId = '{!Account.Id}'; 
opportunity.RecordTypeId = '{!$Setup.Opportunity_Record_Type_Ids__c.Record_Type_3__c}';
opportunity.StageName = 'Quote in Progress'; 

var closeDate = new Date('{!TODAY()}'); 
opportunity.CloseDate = closeDate; 

var result = sforce.connection.create([opportunity]); 

if(result[0].success == 'true'){ 
var serverPrefix = '{!$Setup.Server_Prefix__c.Server_Prefix__c}'; 
var oppId = result[0].id; 
parent.window.location.href = 'https://' + serverPrefix + '.salesforce.com/' + oppId; 

alert('Record creation failed - please notify system administrator'); 

The bold, italicized area is where the error is. The error message is:
<span class="errorStyle">Error: Field Record_Type_3__c does not exist. Check spelling.</span>

Record Type 3 does exist, and the spelling is correct. Is there someplace else that I need to define the "Record_Type_3" field? Thanks.
I am in the process of creating an unmanaged package to move metadata from one sandbox to another in a different org. I have read the ISVforce Guide section on unmanaged package components; what I would like to verify is, while Standard Objects (e.g. Accounts) cannot be added to an unmanaged package, Custom Fields on Standard Objects can? Thanks.
I accepted the case from the widget and left it open on the console. Am receiving this error, though all steps performed.
Earlier this year I asked about placing multiple markers on a Google map. The resulting map earned raves. Now the next step is providing different colored markers based on different criteria. The test group is 4 colors I know that I will need to use If-else logic something like
If (portfoilio1 = value 1), marker 1
else if (portfoilio2 = value 2), marker 2
else if (portfoilio3 = value 3), marker 3
else (portfoilio4 = value 4), marker 4
Hovever, I am not placing the statement correctly, as I am seeing errors like "If statement cannot be used inside <apex:map> in the markup". I am wordering if the If-else statement needs to be placed outside of the <apex:map> section.
The Visualforce page (that works for 1 color) is shown below (stanza that identifies the markers in bold):

<apex:page sidebar="false" showHeader="false" standardController="Market__c" extensions="MSAProperty" >
   <!-- This page must be accessed with an Market Id in the URL. For example:  
       https://cs41.salesforce.com/apex/rrmultipropmap?id=a1255000002hr4G -->
  <apex:pageBlock >
    <apex:pageBlockSection Title="Properties in {!Market__c.Name} MSA {!Market__c.MSA_Code__c}">  
  <!-- Section for MSA list -->     
      <apex:pageBlockTable value="{!mprops}" var="mp">
       <apex:column headerValue="Property Name">
              <apex:outputLink value="/{!mp['Id']}" title="{!mp['Name']}" target="_top">{!mp['Name']}</apex:outputLink>
       <apex:column value="{!mp['Portfolio__c']}"/>
       <apex:column value="{!mp['Address__c']}"/>
       <apex:column value="{!mp['City__c']}"/>
       <apex:column value="{!mp['State__c']}"/>
       <apex:column value="{!mp['Zip__c']}"/>
 <!-- Section for map features -->
   <apex:map width="600px" height="400px" mapType="hybrid"
     <!-- Add markers for Properties within MSA -->    
     <apex:repeat value="{!mprops}" var="mp">
      <apex:mapMarker title="{! mp.Name }"
       icon="{!URLFOR($Resource.HCNMarker4) }">

      <!-- Add info window with Property details -->    
      <apex:mapInfoWindow >
            <apex:outputPanel layout="block" style="font-weight: bold;">
              <apex:outputText >{! mp.Name }</apex:outputText>
            <apex:outputPanel layout="block">
              <apex:outputText >{! mp.Portfolio__c }</apex:outputText>
             <apex:outputPanel layout="block">
              <apex:outputText >{! mp.Address__c }</apex:outputText>
            <apex:outputPanel layout="block">
              <apex:outputText >{! mp.City__c }, {! mp.State__c }</apex:outputText>

I am likely missing something basic; if someone could point out what, I would be grateful. Thanks.