• TomTom Germany
  • NEWBIE
  • 0 Points
  • Member since 2013

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 1
    Replies
I am currently using the following scenario. Products and Pricebooks as from Salesforce standard. Additionally Orders and Order Products as from Salesforce standard. What I want to do is the following: I want to store all product related information i.e. size, weight etc. on the product object. All price related information should be on the pricebook as provided in the Salesforce standard. If I now create a new order, I first of all want to be able to select a pricebook to choose products from (with the option to change the pricebook later if after deleting all order products). Once the pricebook is chosen I want to create new order products using the information from the pricebook related products. I.e. if a product A exists with size and weight I also want to have the information size and weight to be copied automatically into the order product object. I am pretty sure that I would need some trigger coding to get this done. But I am totally unexperienced creating it. Can anybody help me out? And as a "free skate": how could I save any stock information in relation to the products? Thanks in advance....

I have a trigger on a custom object called "Time_Entry__c" that; when a record is created and *IF* there is a related contract associated with the Time Entry, it looks up the rates set-out on that contract record and uses the rates listed in the parent (Contract) record.

 

  Rate_1__c  (currency field)

  Rate_2__c  (currency field)

 

The look-up field on the Time_Entry__C object is called Contract__c

 

The related object is the Contract object in SF:  Contract__r

 

Contract__r has the two currency fields.

 

    CustomRate1__c

    CustomRate2__c

 

 

What I need is to have my trigger, look up the parent contract (if there is a value in Contract__c). and pull the two rates CustomRate1__c and CustomRate2__c and populate them into the Time Entry records Rate_1__c and Rate_2__c respectively.

 

Can anyone help with code for this trigger???

 

 

  • January 02, 2012
  • Like
  • 0