• kevinvw
  • NEWBIE
  • 25 Points
  • Member since 2009

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

I have a custom child table that displays as a Master/Detail related list under Opportunities.

 

I would like to display the Opportunity Record Type Name as a formula in the related list.

 

But the formula editor only lets me add RecordType.Id.

 

I tried $RecordType.Name, but that only works if the Record Type is part of the current object.

My custom object doesn't have Record Types, but the Parent (Opportunity) does have Record types.

 

I can't come up with a formula that works.

 

I am thinking I may have to use a trigger.

 

Thanks,

 

Kevin.

 

 

Hi,  I have a visual force page that updates a contact record.

After saving the visual force page I need to fire off some javascript.  

The javascript is ajax that creates a session connection and updates the Account object.

 

I have to use ajax because I am calling sforce.connection.assignmentRuleHeader to update the Account territory based on information coming from the page that is being saved.  You cannot do this with a trigger or with apex code.

 

My question is, should i fire the javascript on the window.unload of the page or is their a better way?

Or should I call a 2nd vf page after saving 1st vf page and pass account id to 2nd vf page which contains javascript ajax calls?

 

Also  the javascript has to know the account id.  

How can I reference the account id of the current contact  being displayed in the vf page?

 

Thanks, Kevin.

 

 

I'm pretty new to this and I see other people have struggled with custom date pickers...

 

I have a custom VF task page.  I am trying to mimic the reminder section of the standard task screen.

 

I am usting an outputPanel so I can have a checkbox, input field (for date) and select field (for time).

 

The fields display fine and the datepicker lets me pick a date, but when I save, I am not able to get the selected date value back into my controller class.  The !ReminderDate comes back empty.

The !ReminderTime comes back fine.  

Neither field is bound to an SObject.

 

Is there another way?

 

Thanks,  Kevin.

 

 

             <apex:pageBlockSection title="Reminder" collapsible="false" rendered="true">                
                <apex:pageBlockSectionItem >
                    <apex:outputLabel id="taskAddReminderLabel" for="taskAddReminder" value="Add Reminder" />                    
                    <apex:outputPanel id="taskAddReminderOutputPanel" >
                    <apex:inputCheckbox id="taskAddReminder" value="{!AddReminder}">
                        <!-- <apex:actionSupport event="onchange" rerender="taskInformation" action="{!Refresh}"/> -->
                    </apex:inputCheckbox>                                        
                    <span id="dateSpan" class="dateInput dateOnlyInput"><input id="taskReminderDate2" name="taskReminderDate2" value="{!ReminderDate}" onfocus="DatePicker.pickDate(true, 'taskReminderDate2', false);" size="12" type="text" /><span class="dateFormat"></span></span>                    
                    <apex:selectList id="taskAddReminderSelectList" value="{!ReminderTime}" multiselect="false" size="1">
                        <apex:selectOptions value="{!TaskReminderList}"/>
                    </apex:selectList>                 
                    </apex:outputPanel>                                    
                </apex:pageBlockSectionItem>            
            </apex:pageBlockSection>   

 

 

I would like to have the Log a Call page come up with the Schedule follow up task, but I don't want it to say "Log a Call" in the upper left.  I just want it to say "Log a Task"

It seems that the &followup=1 is hard-coded to the Log a Call action.

I have a custom child table that displays as a Master/Detail related list under Opportunities.

 

I would like to display the Opportunity Record Type Name as a formula in the related list.

 

But the formula editor only lets me add RecordType.Id.

 

I tried $RecordType.Name, but that only works if the Record Type is part of the current object.

My custom object doesn't have Record Types, but the Parent (Opportunity) does have Record types.

 

I can't come up with a formula that works.

 

I am thinking I may have to use a trigger.

 

Thanks,

 

Kevin.

 

 

I'm pretty new to this and I see other people have struggled with custom date pickers...

 

I have a custom VF task page.  I am trying to mimic the reminder section of the standard task screen.

 

I am usting an outputPanel so I can have a checkbox, input field (for date) and select field (for time).

 

The fields display fine and the datepicker lets me pick a date, but when I save, I am not able to get the selected date value back into my controller class.  The !ReminderDate comes back empty.

The !ReminderTime comes back fine.  

Neither field is bound to an SObject.

 

Is there another way?

 

Thanks,  Kevin.

 

 

             <apex:pageBlockSection title="Reminder" collapsible="false" rendered="true">                
                <apex:pageBlockSectionItem >
                    <apex:outputLabel id="taskAddReminderLabel" for="taskAddReminder" value="Add Reminder" />                    
                    <apex:outputPanel id="taskAddReminderOutputPanel" >
                    <apex:inputCheckbox id="taskAddReminder" value="{!AddReminder}">
                        <!-- <apex:actionSupport event="onchange" rerender="taskInformation" action="{!Refresh}"/> -->
                    </apex:inputCheckbox>                                        
                    <span id="dateSpan" class="dateInput dateOnlyInput"><input id="taskReminderDate2" name="taskReminderDate2" value="{!ReminderDate}" onfocus="DatePicker.pickDate(true, 'taskReminderDate2', false);" size="12" type="text" /><span class="dateFormat"></span></span>                    
                    <apex:selectList id="taskAddReminderSelectList" value="{!ReminderTime}" multiselect="false" size="1">
                        <apex:selectOptions value="{!TaskReminderList}"/>
                    </apex:selectList>                 
                    </apex:outputPanel>                                    
                </apex:pageBlockSectionItem>            
            </apex:pageBlockSection>   

 

 

Hi,

I have a very odd problem indeed.  I am trying to build a nested Map of Contact details.  I need to loop through each Contact record, create a map with the values, Email, AccountId and ContactId and then add this to another map with a integer key.  All pretty straight forward, yet when I try and access the parent map and display the child entries I get the message 'Already Output' and when I loop through the Parent Map object values are all the same, yet when outputting the items in the map after insertion they show the expected values.

The reason I need to use a Map as opposed to a SELECT clause is that we already hold the items in memory and we're trying to limit the number of queries as we're at 11 already.

Code below:
Code:
 private static testMethod void testManualConvertLead()
 {
  Account[] createAccount = new Account[]
   {
    new Account(Name = 'TestLead1'),
    new Account(Name = 'TestLead1'),
    new Account(Name = 'TestLead1')
   };
   
  insert createAccount;

  Contact[] createContact = new Contact[]
   {
    new Contact(FirstName = 'Test', LastName = 'Last 1', Email = 'test1@bob.com', AccountId = createAccount[0].Id),
    new Contact(FirstName = 'Test', LastName = 'Last 2', Email = 'test2@bob.com', AccountId = createAccount[1].Id),
    new Contact(FirstName = 'Test', LastName = 'Last 3', Email = 'test3@bob.com', AccountId = createAccount[2].Id)
   };
   
  insert createContact; 

  Map<Integer,Map<String,String>> contactDetails = new Map<Integer,Map<String,String>>();
  Map<String,String> contactDetail = new Map<String,String>();
  system.debug(createContact.size()); 
  for(integer n = 0; n < createContact.size() ; n++)
  {
   system.debug('-');
   system.debug(createContact[n].Id);
   system.debug(createContact[n].AccountId);
   system.debug(createContact[n].Email);
   
   contactDetail.put('ContactId',createContact[n].Id);
   contactDetail.put('AccountId',createContact[n].AccountId);
   contactDetail.put('Email',createContact[n].Email);
   
   system.debug(contactDetail);   
   system.debug(n);
   
   contactDetails.put(n,contactDetail);
   system.debug(contactDetails.get(n));
   system.debug('-');
  }
  
  system.debug(contactDetails);
  
  for(integer p = 0 ; p < contactDetails.size() ; p++)
  {
   system.debug(contactDetails.get(p));
  }
 }