• timainman
  • NEWBIE
  • 75 Points
  • Member since 2010

  • Chatter
    Feed
  • 3
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 11
    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 have a picklist field (color__c) that has 4 possible values (Super Green, Green, Yellow & Red).  I need to show those colors based on the value of the field.

Here's what I have code-wise: 

 

<h1>Color: {!Support_Scorecard__c.Color_Code__c} </h1>

 

Here's the formula behind color_code__c: 

 

 

IF(ISPICKVAL(color__c, "Super Green"), IMAGE("/servlet/servlet.FileDownload?file=015T00000003eay", "Super Green"), 
IF(ISPICKVAL(color__c, "Green"), IMAGE("/servlet/servlet.FileDownload?file=015T00000003eat", "Green"), 
IF(ISPICKVAL(color__c, "Yellow"), IMAGE("/servlet/servlet.FileDownload?file=015T00000003eao", "Yellow"), 
IF (ISPICKVAL(color__c, "Red"), IMAGE("/servlet/servlet.FileDownload?file=015T00000003eaj", "Red"), 
"No Color Specified"))))

 

 

That works just fine in the regular page layout, but doesn't work at all in Visualforce.  What am I missing?

Any help you can offer is much appreciated.

Thanks,

Amber

 

Hi..,

 

I have VF page which contains dropdown ,an execute button and Refresh button and a table.Upon selecting a value in the dropdown and click on execute button,at the back end a method will execute and update a value custom object field.

 

Upon Clicking the Refresh button i want to display the update value in the table of VF page.I am able to update the table but whole page is getting loaded.

 

I want to refresh only the table componenet part not the dropdown when i click refresh button.

 

Can anyone please help me acheive this.

 

Thanks,

Srilakshmi B

Hey-

 

Pretty much think I know the answer to this one but I thought I would throw it out there to the group. I have a Apex script that sends an email based on a trigger. I would like the email to come from an email address other than the person who fired the triger. Looks like this is not possible. Any thoughts?

For example:

 

John Doe with the email address john.doe@acme.com fires a trigger when he updates an account. This trigger needs to send an email to another person Jane Doe. I would like this email to appear to come from Jane.Doe@acme.com not John.Doe@acme.com

 

Thanks in advance!

I have a standard HTML table tag that has three columns in each column I am trying to render a apex:dataList by passing a list of data to it.

 

Here is my code:

 

 

 

<tr>
<td><strong>Capabilities 1:</strong>
<apex:dataList value="{!sk.sh1}" var="skh">
<apex:outputText value="{!skh.Characteristic__c}"/>
</apex:dataList>
</td>
<td><strong>Capabilities 2:</strong>
<apex:dataList value="{!sk.sh2}" var="skh">
<apex:outputText value="{!skh.Characteristic__c}"/>
</apex:dataList>
</td><td><strong>Capabilities 3:</strong>
<apex:dataList value="{!sk.sh3}" var="skh">
<apex:outputText value="{!skh.Characteristic__c}"/>
</apex:dataList>
</td>
</tr>

 

When the page renders it renders the table like this:

 

 

 

<tr>
<td><strong>Capabilities 1:</strong></td>
</tr>
<tr>
<td class="data2Col first " colSpan="2">
<ul class="" id="j_id0:j_id2:db:0:j_id3:j_id13:j_id15">
<li id="j_id0:j_id2:db:0:j_id3:j_id13:j_id15:0" class="">A/B ratio 1/8 or worse</li>
<li id="j_id0:j_id2:db:0:j_id3:j_id13:j_id15:1" class="">&#8220;Power Promoter&#8221; letters reflect no attemp</li>
</ul>
</td>
</tr>
<tr>
<td class="data2Col first " colSpan="2"></td>
<td><strong>Capabilities 2 :</strong></td>
</tr>
<tr>
<td class="data2Col first " colSpan="2">
<ul class="" id="j_id0:j_id2:db:0:j_id3:j_id13:j_id18">
<li id="j_id0:j_id2:db:0:j_id3:j_id13:j_id18:0" class="">&#8220;Power Promoter&#8221; letters reflect inconsistent attempt to create Action Plan</li>
</ul>
</td>
</tr>
<tr>
<td class="data2Col first " colSpan="2"></td>
<td><strong>Capabilities 3:</strong></td>
</tr>
<tr>
<td class="data2Col first " colSpan="2">
<ul class="" id="j_id0:j_id2:db:0:j_id3:j_id13:j_id21">
<li id="j_id0:j_id2:db:0:j_id3:j_id13:j_id21:0" class="">&#8220;Power Promoter&#8221; letters reflect consistent ability to create Action Plan</li></ul>
</td>
</tr>
<tr>
<td class="data2Col first last " colSpan="2"> </td>
</tr>

 

As you can see it is sticking in a bunch of extra <tr> & <td> tags. I even tried to render the List with apex:repeat and apx:datatable and still got the issue.

 

Any thoughts/ideas would be appreciated. Thanks!

 

 

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 have a picklist field (color__c) that has 4 possible values (Super Green, Green, Yellow & Red).  I need to show those colors based on the value of the field.

Here's what I have code-wise: 

 

<h1>Color: {!Support_Scorecard__c.Color_Code__c} </h1>

 

Here's the formula behind color_code__c: 

 

 

IF(ISPICKVAL(color__c, "Super Green"), IMAGE("/servlet/servlet.FileDownload?file=015T00000003eay", "Super Green"), 
IF(ISPICKVAL(color__c, "Green"), IMAGE("/servlet/servlet.FileDownload?file=015T00000003eat", "Green"), 
IF(ISPICKVAL(color__c, "Yellow"), IMAGE("/servlet/servlet.FileDownload?file=015T00000003eao", "Yellow"), 
IF (ISPICKVAL(color__c, "Red"), IMAGE("/servlet/servlet.FileDownload?file=015T00000003eaj", "Red"), 
"No Color Specified"))))

 

 

That works just fine in the regular page layout, but doesn't work at all in Visualforce.  What am I missing?

Any help you can offer is much appreciated.

Thanks,

Amber

 

Hey-

 

Pretty much think I know the answer to this one but I thought I would throw it out there to the group. I have a Apex script that sends an email based on a trigger. I would like the email to come from an email address other than the person who fired the triger. Looks like this is not possible. Any thoughts?

For example:

 

John Doe with the email address john.doe@acme.com fires a trigger when he updates an account. This trigger needs to send an email to another person Jane Doe. I would like this email to appear to come from Jane.Doe@acme.com not John.Doe@acme.com

 

Thanks in advance!

hi all,

 

I have developed a before update trigger which has to fire when the lead status changes to reject then it should change the user to the manager of that user it is working perfectly in UI testing but getting errors when  testing with data loader.the error i am getting is "data changed by trigger for field Owner ID: owner cannot be blank". can any one help me to fix this error.

 

 

  • August 12, 2010
  • Like
  • 0

Hi..,

 

I have VF page which contains dropdown ,an execute button and Refresh button and a table.Upon selecting a value in the dropdown and click on execute button,at the back end a method will execute and update a value custom object field.

 

Upon Clicking the Refresh button i want to display the update value in the table of VF page.I am able to update the table but whole page is getting loaded.

 

I want to refresh only the table componenet part not the dropdown when i click refresh button.

 

Can anyone please help me acheive this.

 

Thanks,

Srilakshmi B