• Thomas Monson
  • NEWBIE
  • 30 Points
  • Member since 2015


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
I am stuck on a challenge about creating an account with a related contact. Do I have to make the contact for another account first and then relate it to a different account? I am lost
I am using apex:selectList to display a multiselect list as a dropdown.  It works fine until i set multiselect to true then i get the error Insert failed. First exception on row 0; first error: INVALID_OR_NULL_FOR_RESTRICTED_PICKLIST,  when i try to save.  any suggestions?

<apex:selectList value="{!singleCon.DDMS__c}" styleClass="form-control" multiselect="true">
                                                                    <apex:selectOption itemValue="1" itemLabel="3"/>
                                                                    <apex:selectOption itemValue="2" itemLabel="2"/>
                                                                </apex:selectList>
I have the following page that is a js contact lookup.  It works find when showheader="true" but wont work when set to false.  alsot the image disappears. 

<apex:page showHeader="false">
    
     <input type="hidden" name="testlookup_lkid" id="testlookup_lkid" value="000000000000000" />
<input type="hidden" name="testlookup_lkold" id="testlookup_lkold" value="" />
<input type="hidden" name="testlookup_lktp" id="testlookup_lktp" value="003" />   
<input type="hidden" name="testlookup_lspf" id="testlookup_lspf" value="1" />               
<input type="hidden" name="testlookup_lspfsub" id="testlookup_lspfsub" value="0" />  
<input type="hidden" name="testlookup_mod" id="testlookup_mod" value="0" />   
<span class="lookupInput"> 
<input autocomplete="off" id="testlookup" maxlength="255" name="testlookup" onchange="getElementByIdCS('testlookup_lkid').value='';getElementByIdCS('testlookup_mod').value='1';" size="20" tabindex="4" type="text" value="a" /> 
<a href="javascript:%20openLookup%28%27%2F_ui%2Fcommon%2Fdata%2FLookupPage%3Flkfm%3DeditPage%26lknm%3Dtestlookup%26lktp%3D%27%20%2B%20getElementByIdCS%28%27testlookup_lktp%27%29.value%2C670%2C%271%27%2C%27%26lksrch%3D%27%20%2B%20escapeUTF%28getElementByIdCS%28%27testlookup%27%29.value.substring%280%2C%2080%29%29%29"
   id="con4_lkwgt" onclick="setLastMousePosition(event)" tabindex="4" title="Customer Name Lookup (New Window)">     look
<img src="/s.gif" alt="Customer Name Lookup (New Window)" class="lookupIcon" onblur="this.className = 'lookupIcon';" onfocus="this.className = 'lookupIconOn';" 
     onmouseout="this.className = 'lookupIcon';this.className = 'lookupIcon';" onmouseover="this.className = 'lookupIconOn';this.className = 'lookupIconOn';" 
     title="Customer Name Lookup (New Window)" />
</a>
    </span>
  
    </apex:page>
I have a command link that opens a popup window to create a related record from the opportunity.  How can I pass the opportunity into the lookup field on the related item

this is the command button to open the popup

<apex:commandlink styleClass="btn" style="text-decoration:none;padding:4px;" onclick="javascript:void window.open('https://c.na35.visual.force.com/apex/createTest','1478265075053','width=700,height=500,toolbar=0,menubar=0,location=0,status=1,scrollbars=1,resizable=1,left=0,top=0');return false;">New Buying Center</apex:commandLink>

Here is the visualforce page to create the related record

<apex:page standardController="Buying_Center__c" showHeader="false" sidebar="false">
    <apex:form >
   <script language="JavaScript" type="text/javascript">
function CloseAndRefresh(){
window.opener.location.href="/{!$CurrentPage.parameters.id}";
      window.top.close();
      
  }
</script>

        <apex:pageBlock >
        <apex:pageBlockButtons location="bottom">
        <apex:commandButton action="{!save}" Value="Save" oncomplete="javascript&colon;CloseAndRefresh()" />
        </apex:pageBlockButtons>
     
            <apex:pageBlockSection title="Create New Buying Center">
                <apex:inputField value="{!Buying_Center__c.opportunity__C}"/>   
                <apex:inputField value="{!Buying_Center__c.Influence__c}"/>
                <apex:inputField value="{!Buying_Center__c.Urgency__c}"/>
                                         
            </apex:pageBlockSection>
        </apex:pageblock>
    </apex:form>
</apex:page>
I have a visualforce page that has too many columns to they stretch off the side.   How can i make 2 rows pre record

<apex:page standardController="Opportunity" extensions="WCSRelated">
    <style>
        .fewerMore{Display: none;}
    </style>

    <apex:form >
        <apex:pageBlock id="WCS" Title="WCS Deal One Pager">
            <apex:pageBlockButtons location="Top">
                <apex:commandButton value="Save" action="{!save}"  />
                <apex:commandButton value="Send Email" action="{!send}" />
            </apex:pageBlockButtons> 
            <apex:datatable value="{!BCs}" Var="o" Cellpadding="10" border="0" styleClass="list" rows="2">
                <apex:column >
                    <apex:outputlink target="_Blank" value="/{!o.Contact__c}">{!o.Display_name__c}</apex:outputlink>
                </apex:column>
                <apex:column headerValue="Role">
                    <Apex:inputfield value="{!o.Role__c}"/>
                </apex:column>
                <apex:column headerValue="Influence">
                    <apex:inputfield value="{!o.Influence__c}"/>
                </Apex:column>
                <apex:column headerValue="Urgency">
                    <Apex:inputfield value="{!o.Urgency__c}"/>
                </apex:column>
                
                <apex:column headerValue="Opinion" >
                    <apex:inputfield value="{!o.Opinion__c}"/>
                </apex:column>
                
                <apex:column headerValue="Business Goals">
                    <apex:inputField value="{!o.Business_Goals__c}"/>
                </Apex:column>
              
                <apex:column headerValue="Personal Goals">
                    <apex:inputfield value="{!o.Personal_Goals__c}"/>
                </apex:column>
                             
                <apex:column headervalue="Decision Critera">
                    <apex:inputfield value="{!o.Decision_Criteria__c}"/>
                </apex:column>
                
               
                 <apex:column HeaderValue="Business">
                    <apex:inputfield value="{!o.Synthesis_of_Business_Goals__c}"/>
                    </apex:column>
                    
                     <apex:column HeaderValue="Business">
                    <apex:inputfield value="{!o.Key_Decision_Criteria__c}"/>
                    </apex:column>
                    
                     <apex:column HeaderValue="Business">
                    <apex:inputfield value="{!o.Solution_Description__c}"/>
                    </apex:column>
                   
                     <apex:column HeaderValue="Business">
                    <apex:inputfield value="{!o.Benefits_of_Solution__c}"/>
                    </apex:column>
                     <apex:column HeaderValue="Business">
                    <apex:inputfield value="{!o.Differentiators__c}"/>
                    </apex:column>
                    <apex:column headerValue="Check to Send Value Proposition">
                        <apex:inputfield value="{!o.Send_Value_Proposition__c}"/>
                    </apex:column>
                  
               </apex:datatable>
              
         
        </Apex:pageblock>

    </apex:form>
</apex:page>
Hi,

I am trying to create a pushtopic  in the developer console and I am getting an error Line: 5, Column: 1
Field is not writeable: PushTopic.NotifyForOperations

Here is my code

PushTopic pushTopic = new pushTopic();
pushTopic.Name ='RefreshAccounts';
pushTopic.Query='Select ID, Name FROM Account';
pushTopic.ApiVersion = 31.0;
pushTopic.NotifyForOperations ='edit';
pushTopic.NotifyForFields='Referenced';
    Insert pushTopic;
I am stuck on a challenge about creating an account with a related contact. Do I have to make the contact for another account first and then relate it to a different account? I am lost
Hi Team, 

I have the following code which is bringing me headaches :) 

public with sharing class ApexClassHomeWork 
{
    public List<Account> accs {get; set;}
    
    // retrieves the list of accounts backing the page
    public ApexClassHomeWork()
    {
        accs=[select id, Name, BillingStreet, BillingCity, BillingPostalCode FROM Account  WHERE Name LIKE 'Test%' LIMIT 10];
    }
    
    public void createContact(Id acctId)
    {
        for(Integer i=0; i<500; i++)
        {
            Contact c = new Contact(AccountId=acctId);
            insert c;
        }
    }
}


When calling the method "create contact", I get these errors  messages:

1. "LastName is required" - What do I need to update to resolve this issue?

2. "Too Many DML Statements 151"

3.  "Too many query rows: 500001"

Please help !!
 
Hi There,

I am trying to write one trigger.

Like suppose we post some comments on the chatter of lead. While converting that lead the chatter comment(feedItem) is automatically being populated on the chatter of account, contact, and opportunity.

Thanks in Advance
 
Is there any way by which set of user  automatically assigned on the Opportunity Team based on which India state that the account belongs to. If instead they are assigned on the Account team based on the India State that the account is in, can the opportunity team inherit that from the account team?