• nsoos
  • NEWBIE
  • 0 Points
  • Member since 2013

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

Hi,

 

I have a master object KC_Sales_c and a child object Pro_Forma_c

 

I have created an Apex trigger so that every time a KC Sales record is added a Pro Forma is automatically created.


Is it correct?

 

Thanks

 

trigger CreateProForma on KC_Sales__c (before insert) {

//1. Create collection of new Pro Formas
List<Pro_Forma_c> newProForma = new List<Pro_Forma_c>();

//2. Iterate through the new sales

for (KC_Sales_c sale : trigger.new) {

//2a. For each sales, create a new pro forma
Pro_Forma_c freshProForma = new Pro_Forma_c();
freshProForma.KC_Sales_c = sale.id;
freshProForma.Name = sale.Name_c;

// NO NO!
// insert freshProForma;

//2b. Add the new ProForma to the collection
newProForma.add(freshProForma);

}

//4. Save the new ProFormas

insert newProFormas;

}

  • June 18, 2013
  • Like
  • 0

Hi,

 

Is there a way to create an APEX code that triggers a workflow based on a formula field value?

 

I would like a workflow to be triggered if a formula field "error_c" is "Yes"

 

Is this possible?

 

Many Thanks

  • June 12, 2013
  • Like
  • 0

Hi,

 

I am trying to create an Apex trigger between 2 cross object fields.

 

I have a custom object Sale_c , and there is a (number) formula field Outstanding_Data_c calculating the outstanding number of Data outstanding on the sale. The value of this field is constantly changin automatically when Data is delivered.

 

I have another custom object Sale_allocation_c and there is a number field SA_Outstanding_Data_c . I would like this field to be updated with the value of Outstanding_Data_c automatically. Not sure if it makes a difference but Sale_allocation_c is the child and Sale_c is the parent in the relationship.

 

Could anyone offer me some expertise and help me with the code? I would really appreciate it.

 

Many Thanks

  • June 10, 2013
  • Like
  • 0

Hi,

 

I have created a custom button "Send Form" on Opportunities and I would like to use it to create a form. I would like to code it so that when I press the button it populates fields on the form (form can be Word Doc, PDF) with matching fields from that Opportunity. I have a data field called Form_sent_c I would also need a date field to be updated with the date when I press the button.

 

Is this possible?

 

Many Thanks for your help

Natalie

  • May 22, 2013
  • Like
  • 0

Hi,

 

Is there a way to create an APEX code that triggers a workflow based on a formula field value?

 

I would like a workflow to be triggered if a formula field "error_c" is "Yes"

 

Is this possible?

 

Many Thanks

  • June 12, 2013
  • Like
  • 0

Hi,

 

I am trying to create an Apex trigger between 2 cross object fields.

 

I have a custom object Sale_c , and there is a (number) formula field Outstanding_Data_c calculating the outstanding number of Data outstanding on the sale. The value of this field is constantly changin automatically when Data is delivered.

 

I have another custom object Sale_allocation_c and there is a number field SA_Outstanding_Data_c . I would like this field to be updated with the value of Outstanding_Data_c automatically. Not sure if it makes a difference but Sale_allocation_c is the child and Sale_c is the parent in the relationship.

 

Could anyone offer me some expertise and help me with the code? I would really appreciate it.

 

Many Thanks

  • June 10, 2013
  • Like
  • 0

Hi,

 

I have created a custom button "Send Form" on Opportunities and I would like to use it to create a form. I would like to code it so that when I press the button it populates fields on the form (form can be Word Doc, PDF) with matching fields from that Opportunity. I have a data field called Form_sent_c I would also need a date field to be updated with the date when I press the button.

 

Is this possible?

 

Many Thanks for your help

Natalie

  • May 22, 2013
  • Like
  • 0