• wkuehler
  • NEWBIE
  • 49 Points
  • Member since 2005

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 13
    Replies

So this is my first trigger going into production.  I've gone through the workbooks but I have come to a stop as I'm not sure where I'm going wrong.  With the trigger I'm trying to populate a lookup field on the opportunity with the current account owner that is associated to the opportunity.

 

Here is the code:

 

trigger AccountOwner on Opportunity (after update) {

//update opportunity with current account owner
List<Opportunity> AccountOwner = 
[SELECT Account.OwnerId, Acct_Owner__c FROM Opportunity FOR UPDATE];

    for (Opportunity o: AccountOwner){
        if(o.Acct_Owner__c <> Account.OwnerId){
        o.Acct_Owner__c=Account.OwnerId;
        }
    }
    update AccountOwner;
}

 

 

I'm getting a compile error at line 9 column 9 Illegal assignment from Schema.SObjectField to Id.

 

Suggestions/ help?  It doesn't have to be a look up field, it can be changed to text if that is the issue.

 

thanks,

How to insert valuse of Date datatype in Database ?

I used all the things 'YYYY-MM-DD' , 'DD-MM-YYYY' , DD-MM-YYYY

General error is :

Illegal conversion from String to Date or Integer to Date...

Please help me by query that How will I insert the values....

Does anyone know of a way to query on the deleted by field?  An example of what I am looking for is:

var queryResult = sforce.connection.queryAll("Select Id, Name, DeletedBy from Lead where IsDeleted = true");
Any ideas?
 
There used to be a place on crmsuccess.com that had an s-control to link Salesforce to Google Maps.  I have scoured crmsuccess.com, the appexchange and these forums to find the link to the code, but it's not anywhere to be found.  I came across a few links, but they were all dead ones.

Can someone post the official location of this s-control?  Salesforce, how about putting it on the AppExchange?

Thanks.
Hello,

This is my first post. I have a custom object, and I need to count the number of events attached to the custom object and update the event count on the custom object. Is this possible using an s-control? I have limited programming experience, but can understand code. I appreciate your help in advance.

This S-Control is being called from a link on the account page.  All I want it to do is update the phone number to be "5555555".  Any help would be appreciated.

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>

<script src="http://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>

<script language="JavaScript1.2">
function updateaccountinfo()
{
 var updateObjects = new Array();
 var accountinfo = new Sforce.Dynabean("account");
 
 accountinfo.set("Id", "{!Account_ID}");
 accountinfo.set("Phone", "555555");
 updateObjects.push(accountinfo);
 
 var update = sforceClient.Update(updateObjects);
 //window.parent.parent.location.href = '../setup/own/entityowneredit.jsp—retURL=../../home/home.jsp&id={!Account_ID}&p2=Bob Tester&save=1';
}
</script>
</head>

<body onload="updateaccountinfo()">
</body>
</html>

 

Message Edited by wkuehler on 05-30-2006 07:22 PM

Message Edited by wkuehler on 05-31-2006 05:57 AM

I would like to create a tab that would display the equivalent of an account report with Account Name, Account Site, and Account Phone as the columns. It should display all accounts owned by the logged in user.

Is an S-control the best approach here? If so, any info to get me started would be appreciated.

Thanks

Wkuehler
Anyone have any idea what this meesage is about?

describeBox_init: wild_error