• Izay Irizarry
  • 0 Points
  • Member since 2013

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 3

Trying to write (my first) trigger to pull from a picklist field on the Contact to a duplicate picklist on a Task field.

Contact field info is 

Field Label: SOI

Object Name: Contact

Field Name: SOI

Data Type: Picklist

API Name: SOI__c


Task Field Info is

Field Label: Contact's SOI

Object Name: Activity

Field Name: Contacts_SOI

Data Type: Picklist

API Name: Contacts_SOI__c


I currently receive the error message:

Error: Compile Error: Incompatible key type Schema.SObjectField for MAP<Id,LIST<Task>> at line 6 column 20


The code that I am trying to use is:


Trigger TaskBefore on Task(before insert, before update){
Map<Id, List<Task>> whoIds = new Map<Id, List<Task>>{};
For (Task t : trigger.new)
If(t.WhoId != null){
List<Task> tasks = whoIds.get(task.WhoId);
If (tasks == null){
tasks = new List<Task>{};
whoIds.put(t.WhoId, tasks);
For(Contact con : [Select Id, Name,SOI__c from Contact where Id in :whoIds.keySet()])
For(Task t : whoIds.get(con.id))

t.contacts_SOI__c = con.SOI__c;}


Please help!





I have the following VF Page code which allows a user to toggle between 3 different images (red, yellow, green).  The toggle works, but now I need to assign a value to a custom number variable based upon the image that the user toggles to.  Does anyone know how I can accomplish this or where I might find some code to do it?  Thanks,


<apex:page standardController="Account_Plan__c" tabStyle="Account" ShowHeader="TRUE">

<apex:outputPanel id="msgs">
<apex:pageMessages />


<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jquery/1.9.1/jquery.min.js" />
<apex:includeScript value="//ajax.googleapis.com/ajax/libs/jqueryui/1.10.1/jquery-ui.min.js" />


<script type="text/javascript">

$(document).ready(function () {
$('.icon').click(function () {
var next = $(this).next();
if (next.length == 0)
next = $(this).parent().find('.icon').first();



<style type="text/css">
position: relative;

position: absolute;
left: 0px;
top: 0px;
display: none;

display: block;


<apex:form >

<div id="StatusIcon">
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP7" class="icon default" id="R"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP8" class="icon" id="Y"/>
<img src="/servlet/servlet.FileDownload?file=015S0000000PrP6" class="icon" id="G"/>




  • May 17, 2013
  • Like
  • 0