• Nordberg
  • NEWBIE
  • 0 Points
  • Member since 2006

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 16
    Replies

Hi,

 

I am currently trying to update a field on an opportunity record after the opportunity has been inserted or updated from the opportunity owners - user record.  I really don't know what I am doing but this is what I have pieced together.

 

 

This is the trigger

 

trigger InsuranceUpdate on Opportunity (after insert, after update) { for (Opportunity o : Trigger.new){ User u =[Select IS_Consultant__c from User Where Id=: o.OwnerId]; o.Iteam_Member__c = o.Owner.IS_Consultant__c; } }

 

 

This is the test class

public class testOpp{ static testMethod void InsuranceUpdate() { //find the test opp //flip it's status and update // Opportunity opp = new Opportunity(); opp.Name= 'JD Nordberg30'; opp.StageName = 'Active'; opp.CloseDate = Date.today(); insert opp; for (Opportunity o : [SELECT Id FROM Opportunity WHERE Name = 'JD Nordberg30']) { o.StageName = 'Prospect' ; update o; } } }

 

 

I am receiving the error below 

 

 

Description Resource Path Location Type System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, InsuranceUpdate: execution of AfterInsert caused by: System.Exception: Record is read-only Trigger.InsuranceUpdate: line 4, column 9: [] testOpp.cls InsuranceUpdate/src/classes line 11 Force.com run test failure

 


 

 

Also, how do I run a test of my code in eclipse?

 

Any help would be great


 

 

Hello All,

I am realatively new to both JavaScript and VisualForce. I am looking to dynamically change the type of field within a page based on the value of another field.

For example

if document.getElementById('D1') = "1/1/1900" ... Then change document.getElementById('D1I1') from inputField type to outputField.

Does anyone know if this is possible, and if so can help me fill in the holes.

Thanks

JD
Hello,

I am new to S-control's and am trying to allow a user to click a button and create a new custom object record with data being copied from the case object.  Listed below is my code, I do not receive any error, I just end up with a blank page.  I could be completely off here, but any help would be greatly appreciated. 

Code:
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<title>Copy Data From Convereted Lead</title> 
<HEAD>
<script src="https://www.salesforce.com/services/lib/ajax/beta3.3/sforceclient.js" type="text/javascript"></script>
<script type="text/javascript"> 

var srcObj = sforce.connection.retrieve(
    "Id, Employee_First_Name__c, Employee_Last_Name__c, Address_line_1__c", 
    "Case", ["Case"]);

var trgtObj = new sforce.SObject("Employee__c");
trgtObj.set("Employee_Last_Name__c", srcObj[0].get("Employee_Last_Name__c"));
trgtObj.set("First_Name__c", srcObj[0].get("Employee_First_Name__c"));
trgtObj.set("Street_Address__c", srcObj[0].get("Address_line_1__c"));


var saveResult = sforce.connection.create([trgtObj]);
alert(saveResult[0].getBoolean("success") — "Operation Successful" : "Operation Failed");

</script>
</HEAD>
<body>
</body>
</html>

 

Below is the validation rule.  Of course I realize now that the ownership change doesnt seem to trigger the validation rules.  Is there another way of doing this with an S-Control

and( $UserRole.Id = "00E30000000iDhl",ischanged( OwnerId ),not(ispickval( Closest_Office_Location__c ,"")),isnull( Web_Lead_Transfer_Success_Date__c ))

Thanks in advance for any advise,

JD

I am attempting to have my non-users of salesforce.com use the system without their knowing it.  I want to place a button or link on my company intranet and have that automatically log them into the system as a particular user and create a new custom object record.  When they click the save button I want the system to log them out of salesforce.com and send them back to the company intranet.

Can anyone give me some examples of how this would be done, and any code that would be necessary.

I really appreciate any help,

JD

I need to change the Lead owner via an S-Control after the new lead is saved.  The owner will be changed to the value of a custom field that is a lookup field to the user table. 

Any help would be appreciated,

Thanks,

JD
I need to change the Lead owner via an S-Control after the new lead is saved.  The owner will be changed to the value of a custom field that is a lookup field to the user table. 

Any help would be appreciated,

Thanks,

JD
I am attempting to change the Lead Owner to a field that resides on the Lead page layout.  The custom field is a lookup field to the User table.  Is this possible and if it is can anyone help me get started with some examples of how I might accomplish this.

Thansk,

JD
I am attempting to find a way to email a contact via workflow.  I know that it is not possible, but as a work around I thought that if we could at least limit the number of clicks necessary for these emails we could still launch our project.

My Goal:

To send an email to a service team memeber with a link (Scontrol) that when clicked will automatically initiate the send and email function for that conctact record and choose the appropriate template and send the email out.

Ultimatley it would take 4 clicks and change it to 1.  This would be a great time saver.

Any help would be great

Please contact me at jdnordberg@paramountequity.com
JD Nordberg

Thanks,

JD
I want to write a Scontrol that can be sent from the trigger of a workflow rule.  The scontrol link will automatically intitate the send an email function and select a specific email template and email it out with one click from the email.  I dont know how to really get started, does anyone have any ideas or possibly want to bid this project out please contact me at

jdnordberg@paramountequity.com

The ultimate goal of this is to send an email to a contact via workflow, but I have found no work around and if this is possible it is the quickest one click I could think of.

Thanks,

JD
Does anyone know of a way or a company that can enable the ability to email a contact record via workflow?  I haven't found anyone or anything to date, and salesforce.com Tech support said there is no way of doing it.  Is this true, I cant believe that someone hasn't come up with something yet.  Any workaround would be great.

Thanks,

JD
We have a custom object called “Transactions” that is where we import all of our AR invoices (The sum of the invoices is what drives our actual revenue number).  We then export them daily using the data loader, change all outstanding balances to 0, re-import all of the invoices with the 0 balances, then override that data with that day’s outstanding balances.  The problem is, over time, the list of invoices will become too long to manage so I’d like to sort of “archive” all of the invoices with 0 balances in a separate area so they’ll still be in the system but not in the same location.  How should this be handled?  Should we create a new custom object for the Archived invoices?  Also I need help writing S-Control so that when an invoice balance turns to 0 the invoice will move to this new object. 
Hello everybody,
I'm searching for a s-control that for a certain record type fills automatically the field "account name" in the opportunity whith a certain value (always the same). The field should be also set as read only.

Sorry but I don't know anything about s-control programming.

can anybody help me?

Thanks

Feno
  • November 18, 2008
  • Like
  • 0
How can I move data using VF or S-Control from one custom object to another custom object ?  I want to set up a condition or a button which when clicked would copy the field values from one custom object A into custom object B. I want a automated process which pre-populate fields which need not be re-entered.
 
Thanks,
Anusha
  
  • August 04, 2008
  • Like
  • 0
We have a bunch of values in our picklist that start with the word "Outbound".
 
We will also be doing imports later that will have this word also.
 
So how would I use a formula to find a picklist value that contains the word Outbound?
  • May 23, 2008
  • Like
  • 0
Not sure how many here this news comes as news to, but it sure came as news to us when we learned recently that, irrespective of how restrictive a user's given Profile may be, they will always still be able to change the record ownership on a record belonging to another user to themselves if they wish!

This was acknowledged by the Salesforce tech support team and management, and the only solution we were given was the use of the following validation constraint:

ISCHANGED(OwnerId)

This, however, has the unfortunate side effect of provoking the exact opposite problem accross all users: that of disabling the ability to modify ownership on any record even if you're the Administrator!

Neither situation being acceptable, I figured if I could adjust the formula to apply itself only to those users belonging to the appropriate ProfileID, then all other profile members would continue to be able to modify the ownership of records belonging to other users, and so attempted the following validation constraint instead:

AND (ISCHANGED( OwnerId ) , $User.ProfileId = "00e30000000evEUAAY")

==> By the way, that winking smilie face is supposed to be just a ')' <==

The ID shown is the ID for our sales team's custom profile, but this code - despite passing the syntax checker - provides no constraints whatsoever, even for members of the listed profile! Essentially, this code takes me back to square one, i.e. - as if I had no validation constraints entered to begin with.

Can someone please help us with this?

It's mind-boggling that a program as sophisticated as Salesforce would ommite such an essential function as the ability to restrict users from changing the ownership of records not belonging to them!

Please help...

Thanks,
Philip
I am the administator for our marketing department. Our sales team is really large, so we aren't implmenting this tool to them...yet. I have an excel spreadsheet that has our territories broken down by zip code (quite large), and I need to somehow import the spreadsheet and auto populate new and current fields with this information based on the zipcode.
 
I think this is possible within a formula but I cannot make it work... and I have a TON of zipcodes to incorporate! Ideas? Comments? suggestions? Please help :smileysad:

I am attempting to have my non-users of salesforce.com use the system without their knowing it.  I want to place a button or link on my company intranet and have that automatically log them into the system as a particular user and create a new custom object record.  When they click the save button I want the system to log them out of salesforce.com and send them back to the company intranet.

Can anyone give me some examples of how this would be done, and any code that would be necessary.

I really appreciate any help,

JD

I need to change the Lead owner via an S-Control after the new lead is saved.  The owner will be changed to the value of a custom field that is a lookup field to the user table. 

Any help would be appreciated,

Thanks,

JD
I am attempting to find a way to email a contact via workflow.  I know that it is not possible, but as a work around I thought that if we could at least limit the number of clicks necessary for these emails we could still launch our project.

My Goal:

To send an email to a service team memeber with a link (Scontrol) that when clicked will automatically initiate the send and email function for that conctact record and choose the appropriate template and send the email out.

Ultimatley it would take 4 clicks and change it to 1.  This would be a great time saver.

Any help would be great

Please contact me at jdnordberg@paramountequity.com
JD Nordberg

Thanks,

JD
I am trying to find a simple way to change the owner of a custom object record to the User name stored in a custom field. The custom object's sharing is set to PRIVATE and I want to ensure that new records have the proper OWNER even if someelse creates the record, say an admin person. There is a custom EMPLOYEE NAME field on the page layout which is a lookup on the USER table. Once the record is created, I just want to ensure that the EMPLOYEE NAME becomes the record OWNER as well. Hopefully something automatic when the record is created and saved.
  • March 01, 2006
  • Like
  • 0