• Ahin
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 3
    Replies

I'm very new to writing triggers, but I think it's time to learn.  Here's the scenario:

 

I'm building an Invoice__c record by adding multiple Invoice_Item__c as Master Detail related list

 

An Invoice_Item__c consists of an Equipment__c lookup, an Equipment__c.Hourly_Rate__c.  

Next, I need to calculate the tax added to this related record.  I keep the tax rates in a non-related table
Tax_Rates__c

 

How would I write a trigger on the Invoice_Item__c object to pull Invoice__c.State then match it to Tax_Rates__c.State and return Tax_Rates__c.Rate into a field on Invoice_Item__c?

  • April 22, 2011
  • Like
  • 0

I'm very new to writing triggers, but I think it's time to learn.  Here's the scenario:

 

I'm building an Invoice__c record by adding multiple Invoice_Item__c as Master Detail related list

 

An Invoice_Item__c consists of an Equipment__c lookup, an Equipment__c.Hourly_Rate__c.  

Next, I need to calculate the tax added to this related record.  I keep the tax rates in a non-related table
Tax_Rates__c

 

How would I write a trigger on the Invoice_Item__c object to pull Invoice__c.State then match it to Tax_Rates__c.State and return Tax_Rates__c.Rate into a field on Invoice_Item__c?

  • April 22, 2011
  • Like
  • 0