• jjagt
  • NEWBIE
  • 0 Points
  • Member since 2009

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

Hello all,

 

I have an object called "Change Register" and want to convert that to an Opportunity.  Ideally, since Change Register is a reltaed list fro Account, i would like to have a custom list button that will just convert the selected Records to the respective opportunities.  Any idea on the best way to do this?  i am assuming Java is the answer for this using a custom button?

 

Any code snippetts would be helpful too.

 

 

Thanks

 

 

  • April 27, 2010
  • Like
  • 0

I have a Custom Object Called Services_Selection which is a Master/Detail to an Account.

 

When a certain field in Account is updated or changed (for instance a field called "Base Fee"), I want to update a field in all the related Services_Selection records.  

 

Since I am not aware on how to write this code I will explain it out:

 

When Account.BaseFee is changed/updated,

 

Set Services_Selection.Field1 = Services_Selection.Field2

 

Loop this until all child records are updated.  

 

If you have any questions, I will be glad to answer. Thanks in advance

 

Thank you,

 

 

 

  • April 27, 2010
  • Like
  • 0

Hello all,

 

I am trying to create a trigger that sets a Currency Field in the Object, to the result of what a formula was.  The issue is that when i do this, it says 

 

Error:Apex trigger UpdatePriceValue caused an unexpected exception, contact your administrator: UpdatePriceValue: execution of AfterUpdate caused by: System.Exception: Record is read-only: Trigger.UpdatePriceValue: line 4, column 3

 

Any way around this?  I have the code below:

 

 

trigger UpdatePriceValue on Services_Selection__c (after insert, after update)

{

for (Services_Selection__c SS : Trigger.new)

{

SS.Price_Value__c = SS.Price_Formula__c;

}

}

 

Thanks in advance, to anyone who can help resolve this small issue.

  • April 27, 2010
  • Like
  • 0

Hello all,

 

I am trying to create a trigger that sets a Currency Field in the Object, to the result of what a formula was.  The issue is that when i do this, it says 

 

Error:Apex trigger UpdatePriceValue caused an unexpected exception, contact your administrator: UpdatePriceValue: execution of AfterUpdate caused by: System.Exception: Record is read-only: Trigger.UpdatePriceValue: line 4, column 3

 

Any way around this?  I have the code below:

 

 

trigger UpdatePriceValue on Services_Selection__c (after insert, after update)

{

for (Services_Selection__c SS : Trigger.new)

{

SS.Price_Value__c = SS.Price_Formula__c;

}

}

 

Thanks in advance, to anyone who can help resolve this small issue.

 

 

  • April 27, 2010
  • Like
  • 0

I am trying to update a custom field using a button for the the custom Object.  

 

BACKGROUND:

The custom object is Services_Selection__c

Inside this custom Object is a field called Base_Fee__c that has a value

I want to update the Product_Attributes_Value__c field with the Base_Fee__c field

 

When the loop is Running, I want to update all selected records to be the Base_Fee__c value, instead of the hardcoded "200" I placed for testing purposes.  The code works fine, I just cannot get the field to automatically update based on the field above. 

 

Any thoughts?  I am sure this is a very easy question, but I have been struggling on this for a while.  Code is below :

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

var records = {!GETRECORDIDS($ObjectType.Services_Selection__c)};

var newRecords = [];

 

if (records[0] == null)

{

alert("Please select at least one row")

}

else

{

for (var n=0; n<records.length; n++)

{

var c = new sforce.SObject("Services_Selection__c");

c.id = records[n];

c.Product_Attributes_Value__c = 200;

newRecords.push(c);

}

 

result = sforce.connection.update(newRecords); window.location.reload(); }

  • April 20, 2010
  • Like
  • 0

I am trying to update a custom field using a button for the the custom Object.  

 

BACKGROUND:

The custom object is Services_Selection__c

Inside this custom Object is a field called Base_Fee__c that has a value

I want to update the Product_Attributes_Value__c field with the Base_Fee__c field

 

When the loop is Running, I want to update all selected records to be the Base_Fee__c value, instead of the hardcoded "200" I placed for testing purposes.  The code works fine, I just cannot get the field to automatically update based on the field above. 

 

Any thoughts?  I am sure this is a very easy question, but I have been struggling on this for a while.  Code is below :

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

var records = {!GETRECORDIDS($ObjectType.Services_Selection__c)};

var newRecords = [];

 

if (records[0] == null)

{

alert("Please select at least one row")

}

else

{

for (var n=0; n<records.length; n++)

{

var c = new sforce.SObject("Services_Selection__c");

c.id = records[n];

c.Product_Attributes_Value__c = 200;

newRecords.push(c);

}

 

result = sforce.connection.update(newRecords); window.location.reload(); }

  • April 20, 2010
  • Like
  • 0