• Vinoj
  • NEWBIE
  • 388 Points
  • Member since 2014

  • Chatter
    Feed
  • 11
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 34
    Replies

Hi Gurus,

I have created an Apex Class which creates a User Account (future method) . This Class is called from Process Builder when a custom object record is created.

Now, I am trying to create a Test Class, but I am getting 'MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa):'

How to get around this ?

Thanks,

Raghu



Now, I am trying to create a test class for this, 
 

My Apex Class "RequestController" is showing a problem in the Developer Console: "Line 1164 - Unexpected token: '\upsert'. I am new to working with Apex and am not a coder.  How do I go about resolving this problem in the Developer console?  Following is a partial  piece of the RequestController around line 1164 (upsert rCon.request;):
    static testMethod void RequestRFP_Test19() {
    
        PageReference pageRef = Page.requesttype;
        test.setCurrentPageReference (pageRef);
        
        RequestController rCon = new RequestController ();
        
        Account a19 = new Account (Name = 'test');
        
        insert a19;
        
        Opportunity o19 = new Opportunity (
                              AccountID = a19.id
                            , Name = 'test opp'
                            , StageName ='00 - Prospect'
                            , CloseDate = system.today()
                            , Taken_From__c = 'Allied Solutions'
                            );
        
        insert o19;
        
        rCon.request.Opportunity__c = o19.id;
        rCon.Request.RFC_Request__c = true;
        rCon.request.Product__c = 'MTG Protection Insurance and Tracking'
        
        upsert rCon.request;
        
        test.startTest();
        rCon.save();
        rCon.cancel();
        rCon.step1();
        rCon.step2();
        rCon.step3();
  
        test.stopTest();
    
}

Note there are a total of 21 tests in this Apex Class.  They all have a similar structure to one listed above, with the same line as line 1164. 
Hi,

I'm trying to wrap my head around a particular problem.   We have some number fields, and these fields need to produce 2 things:  The number entered if they are filled out, and if they are not filled out a -1 answer.

So far I am using the following statement, which accomplishes 1/2 the job (getting -1 as an answer if blank).   Does anyone know how to bring the entered number into the results, should the field be filled out?

IF(ISBLANK(My_number field), '-1', '0')

Thanks for any leads.
Hi,
I keep getting this error when trying to do a Trailhead Challenge.  Any ideas?  Thanks.
User-added image

Here is my code:
PhoneNumberEvent.evt
<aura:event type="APPLICATION" description="Event template">
    <aura:attribute name="phone" type="String"/>
</aura:event>
MyApplication.app
<aura:application >
    ({
	send : function(component, event, helper) {
		var phone = component.find("phone").get("v.value");
        console.log(phone);
        $A.get("event.c:PhoneNumberEvent").setParams({
            phone: phone
       }).fire();
	}
	})
    
    ({
	answer : function(component, event, helper) {
		var text = event.getParam("phone");
        component.set("v.phone", text);
	}
	})

    <c:PhoneNumberInput/>
    <c:PhoneNumberOutput/>
</aura:application>
PhoneNumberInput.cmp
<aura:component >
    <aura:registerEvent name="PhoneNumberEvent" type="c:PhoneNumberEvent"/>
    <ui:inputPhone aura:id="phone" label="phone" />
    <ui:button label="Show Phone" press="{!c.send}"/>
</aura:component>
PhoneNumberOutput.cmp
<aura:component >
    <aura:attribute name="phone" type="String" default="No Phone Number"/>
    <ui:outputText aura:id="phone" value="{!v.phone}"/>
    <aura:handler event="c:PhoneNumberEvent" action="{!c.answer}"/>
</aura:component>
I am using the following code for before insert trigger for a custom object Position__c. 

When I try to save get an error. Error message is as follows:
Line 4: Invalid field working_on__c for sObject Position__c.

******** Trigger code on developer **********
trigger Trg1 on Position__c (before insert) {
    for(Position__c t : Trigger.new){
        if(t.working_on__c==t.Hiring_Manager__c){
            t.working_on__c.adderror ('Data in name and Working fields should be different');
        }
    }
}
***********

Please let me know what is wrong.

Thanks,
MS
 
I cannot seem to pass this challenge and I have tried so many different ways.
Here is my  code for .cmp and .app
<aura:component>
    <aura:attribute name="Street" type="String" />
    <aura:attribute name="City" type="String" />
    <aura:attribute name="State" type="String" />
    <aura:attribute name="PostalCode" type="String" />
    
    <div class="addressDetails">
        <div class="street">Street: {!v.Street}</div>
        <div class="state">State: {!v.State}</div>
        <div class="city">City: {!v.City}</div>
        <div class="postalCode">ZipCode: {!v.PostalCode}</div>
    </div>
    
</aura:component>
and my .app
<aura:application >
    
    <h1>Starting the DisplayAddress component</h1>
    <c:DisplayAddress Street="22 north" City="Provo" State="ut" PostalCode="99900"/>
   
</aura:application>

If anyone could help that we be awesome,
TIA
Scott
 
I created the sendEmail class as was able to send/receive the email as the instructions indicated. However, under the section "Call Static Method" I ran into an error. 

This instructions read: 
          " In the Developer Console, find the open tab for the EmailManager class and modify the first line of the sendMail() method definition to the following (the only change is the added static keyword.)
 
                   public static void sendMail(String address, String subject, String body) {

                   Save the class by pressing Ctrl+S.  "

When I try to save, I get: 
FIELD_INTEGRITY_ERROR: 
Failed to create createContainerMember for containerId=undefined: null is not a valid containerId.

Here are the first few lines of the class (with the addition of the word 'static' per instructions)

public class EmailManager {

    // Public method
    public static void sendMail(String address, String subject, String body) {
        // Create an email message object.....

Further, the page is now in a perminant 'saving' mode under the file menu.   Thanks for any help.

Hello I'm new to Salesforce and I'm doing the trailhead to learn.
But I'm stuck at this challenge in Lightning Module.

Here's the challenge:
Create a simple Lightning component with a styled headline. The headline must use an H1 tag with a CSS class that enforces a 24px font-size. Make the component available in the Navigation Menu of Salesforce1.The component must be named 'MyLightningComponent'.
The component must include an H1 tag with a CSS class named 'headline'. The 'headline' CSS class must set a font-size of 24px.
The Lightning Component tab that is added to Salesforce1 must be called 'MyLightning'.

And here's what I did:

MyLightningComponent.cmp

<aura:component implements='force:appHostable'>
    <div class="headline">
    <h1>My Lightning Component</h1>
    </div>
</aura:component>
MyLightningComponentApp.app
<aura:application>
    <h1>Hello Lightning App!</h1>
    <c:MyLightningComponent />
</aura:application>

MyLightningComponent.css
.THIS {
}

.THIS.headline{
    font-size:24px;
}

I created the tabs in the Salesforce1 and everithing looks right but I can't pass the challenge because it's aways return a error saying "The component does not include an H1 tag with a 'headline' CSS class"

I do no what to do with this error.
Hi, I'm pretty new to Salesforce (had this job about 3 weeks) and I'm trying to set up a validation rule that prevents one particular user from creating an event anywhere but in opportunities.
Here's the logic on the validation rule:

CreatedBy.Id = "00530000002EKrz" 
&& 
NOT(LEFT(WhatId,3) = "006")

Now, when I try to create an event while logged in as this user, I get the following error message:

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Event_AfterInsert caused an unexpected exception, contact your administrator:
Event_AfterInsert: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0 with id 00UV0000001jJghMAE; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, This event must be associated with an opportunity.: []: Trigger.Event_AfterInsert: line 12, column 1

So it's having some kind of problem with 'Event_AfterInsert'. That's this:
 
trigger Event_AfterInsert on Event (after insert)
{
	For (Event e : trigger.new)
    {
        For (Account a : [Select Id, Region__c from Account where Id = :e.AccountId])
	    {
	        // Update the event record
			Event[] ev = [select id, Region__c from Event where id = :e.Id];
			ev[0].Region__c = a.Region__c;
			update ev[0];
	    }
    }
}

But I have no idea where to go from here.  The 'This event must be associated with an opportunity' part of the error message is exactly what I put as my validation rule's error message, which is also confusing me.

Any help would be greatly appreciated.
Thank you!
Hello all,

I made a schedulable batch that I want to run at certain hours, let's say 6, 12 and 18. I'm writting those hours in a custom setting CS_Schedule__c. How can I call that CS from Apex and get the hours?

Thanks in advance.
Hi ,

If i use debug stmts in trigger  to print some value, where can i see those printed data whenever a trigger is fired.


Regards,
Suresh.



 
  • April 01, 2015
  • Like
  • 0

Hi Gurus,

I have created an Apex Class which creates a User Account (future method) . This Class is called from Process Builder when a custom object record is created.

Now, I am trying to create a Test Class, but I am getting 'MIXED_DML_OPERATION, DML operation on setup object is not permitted after you have updated a non-setup object (or vice versa):'

How to get around this ?

Thanks,

Raghu



Now, I am trying to create a test class for this, 
 

My Apex Class "RequestController" is showing a problem in the Developer Console: "Line 1164 - Unexpected token: '\upsert'. I am new to working with Apex and am not a coder.  How do I go about resolving this problem in the Developer console?  Following is a partial  piece of the RequestController around line 1164 (upsert rCon.request;):
    static testMethod void RequestRFP_Test19() {
    
        PageReference pageRef = Page.requesttype;
        test.setCurrentPageReference (pageRef);
        
        RequestController rCon = new RequestController ();
        
        Account a19 = new Account (Name = 'test');
        
        insert a19;
        
        Opportunity o19 = new Opportunity (
                              AccountID = a19.id
                            , Name = 'test opp'
                            , StageName ='00 - Prospect'
                            , CloseDate = system.today()
                            , Taken_From__c = 'Allied Solutions'
                            );
        
        insert o19;
        
        rCon.request.Opportunity__c = o19.id;
        rCon.Request.RFC_Request__c = true;
        rCon.request.Product__c = 'MTG Protection Insurance and Tracking'
        
        upsert rCon.request;
        
        test.startTest();
        rCon.save();
        rCon.cancel();
        rCon.step1();
        rCon.step2();
        rCon.step3();
  
        test.stopTest();
    
}

Note there are a total of 21 tests in this Apex Class.  They all have a similar structure to one listed above, with the same line as line 1164. 
Hi,

I'm trying to wrap my head around a particular problem.   We have some number fields, and these fields need to produce 2 things:  The number entered if they are filled out, and if they are not filled out a -1 answer.

So far I am using the following statement, which accomplishes 1/2 the job (getting -1 as an answer if blank).   Does anyone know how to bring the entered number into the results, should the field be filled out?

IF(ISBLANK(My_number field), '-1', '0')

Thanks for any leads.
Hi,
I keep getting this error when trying to do a Trailhead Challenge.  Any ideas?  Thanks.
User-added image

Here is my code:
PhoneNumberEvent.evt
<aura:event type="APPLICATION" description="Event template">
    <aura:attribute name="phone" type="String"/>
</aura:event>
MyApplication.app
<aura:application >
    ({
	send : function(component, event, helper) {
		var phone = component.find("phone").get("v.value");
        console.log(phone);
        $A.get("event.c:PhoneNumberEvent").setParams({
            phone: phone
       }).fire();
	}
	})
    
    ({
	answer : function(component, event, helper) {
		var text = event.getParam("phone");
        component.set("v.phone", text);
	}
	})

    <c:PhoneNumberInput/>
    <c:PhoneNumberOutput/>
</aura:application>
PhoneNumberInput.cmp
<aura:component >
    <aura:registerEvent name="PhoneNumberEvent" type="c:PhoneNumberEvent"/>
    <ui:inputPhone aura:id="phone" label="phone" />
    <ui:button label="Show Phone" press="{!c.send}"/>
</aura:component>
PhoneNumberOutput.cmp
<aura:component >
    <aura:attribute name="phone" type="String" default="No Phone Number"/>
    <ui:outputText aura:id="phone" value="{!v.phone}"/>
    <aura:handler event="c:PhoneNumberEvent" action="{!c.answer}"/>
</aura:component>
And my code for Oppertunity is this...what is my mistak and same as when i write for solution it also shows mw some error?


apex:page standardController="Opportunity">
  <apex:form >
<apex:pageBlock title="Opportunity Edit">
<apex:pageBlockButtons >
<apex:commandButton action="{!save}" value="save" />
<apex:commandButton action="{!cancel}" value="cancel"/>
<apex:commandButton action="{!save&new}" value="save&new"/>
</apex:pageBlockButtons>
<apex:pageBlockSection title="Opportunity Information" columns="2">
        
        <apex:inputField value="{!Opportunity.Private}"/>
        <apex:inputField value="{!Opportunity.name}"/>
        <apex:inputField value="{!Opportunity.Type}"/>
        <apex:inputField value="{!Opportunity.LeadSource}"/>
        <apex:inputField value="{!Opportunity.Amount}"/>
        <apex:inputField value="{!Opportunity.CloseDate}"/>
        <apex:inputField value="{!Opportunity.NextStep}"/>
        <apex:inputField value="{!Opportunity.Stage}"/>
        <apex:inputField value="{!Opportunity.Probability(%)}"/>
       </apex:pageBlockSection>
</apex:pageBlock>
</apex:form>
</apex:page>
I am using the following code for before insert trigger for a custom object Position__c. 

When I try to save get an error. Error message is as follows:
Line 4: Invalid field working_on__c for sObject Position__c.

******** Trigger code on developer **********
trigger Trg1 on Position__c (before insert) {
    for(Position__c t : Trigger.new){
        if(t.working_on__c==t.Hiring_Manager__c){
            t.working_on__c.adderror ('Data in name and Working fields should be different');
        }
    }
}
***********

Please let me know what is wrong.

Thanks,
MS
 
I cannot seem to pass this challenge and I have tried so many different ways.
Here is my  code for .cmp and .app
<aura:component>
    <aura:attribute name="Street" type="String" />
    <aura:attribute name="City" type="String" />
    <aura:attribute name="State" type="String" />
    <aura:attribute name="PostalCode" type="String" />
    
    <div class="addressDetails">
        <div class="street">Street: {!v.Street}</div>
        <div class="state">State: {!v.State}</div>
        <div class="city">City: {!v.City}</div>
        <div class="postalCode">ZipCode: {!v.PostalCode}</div>
    </div>
    
</aura:component>
and my .app
<aura:application >
    
    <h1>Starting the DisplayAddress component</h1>
    <c:DisplayAddress Street="22 north" City="Provo" State="ut" PostalCode="99900"/>
   
</aura:application>

If anyone could help that we be awesome,
TIA
Scott
 
I have a formula field, "Age", that caluclates the ages of our clients.  Age is set up as a text return type and has this formula:
IF(TODAY() >=Date(YEAR(TODAY()), 
MONTH(Birthdate), DAY(Birthdate)), 
TEXT(YEAR(TODAY()) - YEAR(Birthdate)), 
TEXT(YEAR(TODAY()) - YEAR(Birthdate) - 1))  

I want to create an "age range" field, so created another formula field with a return type of text, but keep getting the error:  Error: Incorrect parameter type for operator '>'. Expected Text, received Number.  Here is my formula:  

IF(age__c>"18","19+",
IF(age__c>="15","15-18",
IF(age__c>="10","10-14",
IF(age__c>="6","6-9",
IF(age__c>="3","3-5",
IF(age__c<="2","None"))))))

I get an error too if I try to change my age field to a number and try it from that way.  

Thanks for any help!
Kris
I created the sendEmail class as was able to send/receive the email as the instructions indicated. However, under the section "Call Static Method" I ran into an error. 

This instructions read: 
          " In the Developer Console, find the open tab for the EmailManager class and modify the first line of the sendMail() method definition to the following (the only change is the added static keyword.)
 
                   public static void sendMail(String address, String subject, String body) {

                   Save the class by pressing Ctrl+S.  "

When I try to save, I get: 
FIELD_INTEGRITY_ERROR: 
Failed to create createContainerMember for containerId=undefined: null is not a valid containerId.

Here are the first few lines of the class (with the addition of the word 'static' per instructions)

public class EmailManager {

    // Public method
    public static void sendMail(String address, String subject, String body) {
        // Create an email message object.....

Further, the page is now in a perminant 'saving' mode under the file menu.   Thanks for any help.
Hello, can anyone help me pls.
I created a workflow with the next criteria: send_email__c equals true
and
the action: I used the Email Alert and the template that send the email, but my sandbox doesn't send the email when the field send_email__c is true. Does anyone know why?
btw: in my production I created the same workflow with the same criteria, email alert and template and it works.
Hi,

I have a PDF quote that is generated by visualforce.  Everything works fine, except I am having problems with the checkboxes.  I saw in one post that checkboxes don't work in PDF's and you have to try images.
https://developer.salesforce.com/forums/ForumsMain?id=906F0000000999tIAA

But this only seems to work sometimes for me.  Sometimes the image will show checked, other times not.

For example, I tried
<apex:outputtext rendered="{!if(opportunity.Crossflow__c,true,false)}" escape="false"> <td>Crossflow: <img src="/img/checkbox_checked.gif"/> </td> </apex:outputtext>
            <apex:outputtext rendered="{!if(opportunity.Crossflow__c,false,true)}"> <td>Crossflow: <img src="/img/checkbox_unchecked.gif"/> </td> </apex:outputtext>
and nothing happens

But if I try
 
<apex:outputtext rendered="{!if(opportunity.Crossflow__c,true,false)}" escape="false"> <td>Crossflow: <img src="/img/checkbox_checked.gif"/> </td> </apex:outputtext>
            <apex:outputtext rendered="{!if(opportunity.Crossflow__c,false,true)}"> <td>Crossflow: <img src="/img/checkbox_unchecked.gif"/> </td> </apex:outputtext>
               
             <img src="/img/checkbox_unchecked.gif"/>
                <img src="/img/checkbox_checked.gif"/>

I get a 4 checkboxes. including some that I haven't told to have checked.

Whole code below
<apex:page standardController="Opportunity" showHeader="false" renderas="pdf">
<!--
    <head>
<style>@page {size:landscape;</style> 
</head> 
--> 
                  <img src="/img/checkbox_unchecked.gif"/>
                <img src="/img/checkbox_checked.gif"/>     

    
<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>
    <td>
        <img src='{!URLFOR($Resource.Logo)}'  title="logo" />
    </td>
    <td  align="right"><font face="Arial" >
    <b>Contract for {!Opportunity.Account.Name}</b></font><br/>
    </td>
    
    
</tr>

<hr/>

<table border="0" cellspacing="0" cellpadding="0" width="100%" id="table1">
<tr>    <td ><font face="Arial"  >
        {!$Organization.Name}<br/>
        {!$Organization.Street}<br/>
        {!$Organization.City} {!$Organization.State}. {!$Organization.PostalCode} <br/>
       
        </font></td> 
        <td width="50%">&nbsp;</td>
   <td ><font face="Arial">Contract Number: 
   <br/>
        <br/>
        Offer valid Through:&nbsp;<apex:OutputField value="{!Opportunity.CloseDate}"/><br/>    
        Proposed by: {!Opportunity.Owner.LastName} {!Opportunity.Owner.FirstName}</font>
     </td>
</tr>
</table>
    
<hr/>
<p><b><font face="Arial" color="#000080">Address Information</font></b></p>

<table border="0" width="100%" id="table2">
<tr>
       <td colspan="3">
           <font face="Arial">Account name: {!Opportunity.Account.Name} <br/></font>
           <font face="Arial">Bond Number: {!Opportunity.Bond_Number__c} <br/></font>
       </td>
</tr>
<tr>
       <td>          
           <font face="Arial">Bill To:<br/>
                             {!Opportunity.Account.BillingStreet}<br/>
                            {!Opportunity.Account.BillingCity} {!opportunity.account.BillingState}. {!Opportunity.Account.BillingPostalCode} 
           </font>
        </td>
        <td width="50%"></td>
        <td >
           <font face="Arial">Ship To:<br/>
                              {!Opportunity.Account.ShippingStreet}<br/>
                             {!Opportunity.Account.ShippingCity} {!opportunity.Account.ShippingState}. {!Opportunity.Account.ShippingPostalCode} 
           </font>
        </td>
</tr>    
</table>
<hr/>
    </table> 
<!-- *************************************************************************************************************** -->  

<table width="100%" id="table5">
<tr>
   <td width="50%"><b>{!$Organization.Name}</b></td>
   <td width="50%"><b>{!Opportunity.Account.Name}</b></td>
</tr>
<tr>
   <td width="50%">&nbsp;</td>
   <td width="50%">&nbsp;</td>
</tr>
<tr>
   <td width="50%">Signature<hr color="black" size="1"/></td>
   <td width="50%">Signature<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Name<hr color="black" size="1"/></td>
   <td width="50%">Name<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Title<hr color="black" size="1"/></td>
   <td width="50%">Title<hr color="black" size="1"/></td>
</tr>
<tr>
   <td width="50%">Date<hr color="black" size="1"/></td>
   <td width="50%">Date<hr color="black" size="1"/></td>
</tr>
</table>
<p>&nbsp;</p>
<hr/>
<!-- <p align="center"><font face="Arial"><i>Copyright {!$Organization.Name}.</i></font></p> -->
    
<!-- *************************************************************************************************************** -->    
 <!--  <div style="page-break-after:always;"> </div>  -->
    
<!-- *************************************************************************************************************** -->
<p><b><font color="#000080" face="Arial">Products</font></b></p>
<table border="0" width="100%" id="table4">
<tr>
       <td bgcolor="#C0C0C0"><font face="Arial">Product</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Item ID#</font></td>    

       <td bgcolor="#C0C0C0"><font face="Arial">Variety</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Vintage</font></td> 
       <td bgcolor="#C0C0C0"><font face="Arial">Appelation</font></td> 
       <td bgcolor="#C0C0C0"><font face="Arial">Alc %</font></td>     
       <td bgcolor="#C0C0C0"><font face="Arial">Quantity</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Unit Price</font></td>
       <td bgcolor="#C0C0C0"><font face="Arial">Total Price</font></td>
    
   
</tr>
<tr>
       <apex:repeat value="{!Opportunity.OpportunityLineItems}" var="line">
          <tr>
             <td>{!line.PricebookEntry.Name}</td>
             <td>{!line.Item_Id__c}</td> 

             <td>{!line.Variety__c}</td>
             <td>{!line.Vintage__c}</td>              
             <td>{!line.Appelation__c}</td> 
             <td>{!line.Alc_Percent__c}</td>               
             <td>{!line.Quantity}</td>
             <td><apex:OutputField value="{!line.UnitPrice}"/></td>
             <td><apex:OutputField value="{!line.TotalPrice}"/></td>
               
            
              
          </tr>
       </apex:repeat>  
</tr>
<tr>
       <td bgcolor="#C0C0C0" align="right" colspan="9">
       <font face="Arial"><b>Total:</b>&nbsp;<apex:Outputtext value="{0,number,$###,###,##0.00}">
        <apex:param value="{!opportunity.amount }"/> </apex:outputText>           
           </font></td>
</tr>
<tr>
       <td  align="right" colspan="9">
           <font face="Arial"><b>Deposit:</b>&nbsp;<apex:outputText value="{0,number,$###,###,##0.00}">
               <apex:param value="{!opportunity.amount * (opportunity.Deposit_Percent__c / 100)}"/></apex:outputText> 
               </font></td>
</tr>    
</table>
<br/>
     
  <hr/>
      

   
   
<!-- *************************************************************************************************************** -->
    <p><b><font color="#000080" face="Arial">Treatments</font></b></p>  
    <table border="0" width="100%">
       <tr>
        
            <apex:outputtext rendered="{!if(opportunity.Crossflow__c,true,false)}" escape="false"> <td>Crossflow: <img src="/img/checkbox_checked.gif"/> </td> </apex:outputtext>
            <apex:outputtext rendered="{!if(opportunity.Crossflow__c,false,true)}"> <td>Crossflow: <img src="/img/checkbox_unchecked.gif"/> </td> </apex:outputtext>
               
             <img src="/img/checkbox_unchecked.gif"/>
                <img src="/img/checkbox_checked.gif"/>     

    
                 
            <apex:outputtext rendered="{!if(opportunity.Alc_Removal__c,true,false)}"> <td>Alc Removal: <img src="/img/checkbox_checked.gif"/> </td> </apex:outputtext>
            <apex:outputtext rendered="{!if(opportunity.Alc_Removal__c,true,false)}"> <td>Alc Removal: <img src="/img/checkbox_checked.gif"/> </td> </apex:outputtext>

         
           
           
           <td>Alc Removal: <apex:outputField value="{!opportunity.Alc_Removal__c}"/> </td>
           <td>VA Removal: <apex:outputField value="{!opportunity.VA_Removal__c}"/> </td>
        </tr>
        <tr>
           <td>Cold Stablity: <apex:outputField value="{!opportunity.Cold_Stability__c}"/> </td>           
           <td>Beginning Alc: <apex:outputField value="{!opportunity.Beginning_Alc__c}"/> </td>           
           <td>None: <apex:outputField value="{!opportunity.no_treatment__c}"/> </td>            
        </tr>  
        <tr>
           <td>Heat Stability: <apex:outputField value="{!opportunity.Heat_Stability__c}"/> </td>           
           <td>Finished Alc: <apex:outputField value="{!opportunity.Finished_Alc__c}"/> </td>  
           <td>Other: <apex:outputField value="{!opportunity.other_treatment__c}"/> </td> 
        </tr>
    </table>
    
    <br/>
    <hr/>
   

 <!-- *************************************************************************************************************** -->      

    <apex:outputtext rendered="{!if(or(NOT(ISNULL(opportunity.Glass__c)), 
                               NOT(ISNULL(opportunity.Closure__c)),
                               NOT(ISNULL(opportunity.Capsule__c)),
                               NOT(ISNULL(opportunity.Capusle_Color__c))
                               ), true, false)
                               }" escape="false">
    
    <p><b><font color="#000080"  face="Arial">Packaging</font></b></p>  
    <table border="0" width="100%">
        <tr>
        <td>Glass: {!opportunity.Glass__c}</td>
        <td>Closure: {!opportunity.Closure__c}</td> 
        <td>Capsule: {!opportunity.Capsule__c}</td> 
        <td>Capsule Color: {!opportunity.Capusle_Color__c}</td> 
        </tr>
    </table>
    
    
    </apex:outputtext>  
    <hr/>
    
     <!-- *************************************************************************************************************** --> 
  <apex:outputtext rendered="{!opportunity.special_notes__c != NULL }">  
    
 <p><b><font color="#000080" face="Arial" >Special Notes:</font></b></p> 
    

        <p>
            {!opportunity.Special_Notes__c}                                                 
        </p>
  


    
    
    
    <br/>  
       </apex:outputText>                                    
 <!-- *************************************************************************************************************** -->    
    <div style="page-break-after:always;"> </div>    
 <!-- *************************************************************************************************************** -->   
 <p><b><font color="#000080" face="Arial">Payment Terms</font></b></p> 
    <hr/>
    <apex:outputText >
        <p>
            {!opportunity.Payment_Terms__c}                                                 
        </p>
    </apex:outputText>


    
    
    
   
 <!-- *************************************************************************************************************** -->       
   
    
 <p><b><font color="#000080"  face="Arial">Terms and Conditions</font></b></p>  
   
    
    
    
<apex:outputText rendered="{!if(Opportunity.type=='Bulk Wine', true, false)}">
    <p><b>Taxes:</b> State and Federal taxes to be paid by customer.                                        
    </p>    
         
    <p>This agreement is for the bond to bond purchase and transfer of Bulk Wine. The Bulk Wine has been inspected and accepted by the Buyer, and this is considered an "as is" purchase.  Wine is to be finished and bottled offsite. 30 days storage from contact signing or arrival of bulk wine has been included. Customer to provide all vessels for wine transfer within this allotted 30 days. Storage beyond the allotted 30 days will be calculated separately. If no such vessels are provided, customer will be subject to barrel rental fees and storage per Exhibit B3. Bulk sale occurs, and ownership of wine transfers, when buyer approves this sale agreement via signature.                                                         
    </p>
    
    <p>
        For microbial stability testing, we recommend the use of Vinquiry. www.enartisvinquiry.com southern California location Santa Maria Branch 2717 Aviation Way, Suite 100, Santa Maria, CA 93455, Tel:805-922-6321 fax:805-922-1751 or northen California location Napa Branch 1282 Vidovich Avenue, Suite C, St. Helena, CA 94574, tel:707-967-0290 fax:707-967-0295.                                                        
    </p>
    
    <p>
       These terms and conditions apply to the purchase of unlabeled bottled wines (“Shiners”) purchased by Buyer in the Contract from Terravant Wine Company, LLC (“Terravant”; Buyer and Terravant together, the “Parties”).                                                      
    </p>
    
    <p>
        <b>Condition  of  Wine.</b>   Buyer has inspected, sampled and/or tested  the  Bulk  Wine  to Buyer's full satisfaction.   Buyer will be given an opportunity to re-sample the Bulk Wine at any time up to, and including, the Delivery Date.   Delivery of the Bulk Wine by Seller to Buyer on the Delivery Date shall constitute full acceptance by Buyer of the Bulk Wine. Seller  has  made  no  representation  or  warranty   as  to  the  quality,   characteristics or suitability  of the wine for any purpose or use.  The Bulk Wine is sold in "as is" condition. Seller does warrant it is the owner of the Bulk Wine, free to sell it to Buyer, and that the Bulk  Wine  is free  and  clear  of any  liens  and  encumbrances and  it complies  with  any applicable  Federal and State Laws or Regulations concerning such wine.                                                     
    </p>
   
    <p>
        <b>Release, Disclaimer and Waiver of Consequential Damages, Limitation of Liability and Hold Harmless.</b>   The  parties  recognize   and  acknowledge  that  the  winemaking process  involves  many  intangible  and  subjective  factors,  that  personal  preferences and opinions  often  differ  widely  concerning wine quality,  and that the limitation  of liability set  forth   herein   is  a  material   inducement   for  Seller  to  enter   into  this  Agreement. Accordingly:                                                       

    </p>
    
    <p>
        Buyer  acknowledges and  agrees  that  Seller's  legal  liability  under  or resulting  from  this Agreement,   based  upon  any  claim  by  Buyer,  whether  for  negligence, breach  of  this agreement, breach  of  warranty,  express  or implied,  or  upon  any  other  basis  in  law  or equity,  shall  be strictly  and solely  limited  to money  damages  in an amount  which  shall not exceed,  under any circumstances, the actual price paid by the Buyer to the Seller  for the  Bulk  Wine.  This  limitation   shall  be  the  full  and  only  extent  of  Seller's  liability regardless  of the  form  in  which  any  legal  or  equitable  action  may  be brought  against Seller, and the foregoing  shall constitute  Buyer's  sole and exclusive  remedy.  in no event shall  Seller  be  liable  for  any  special,   indirect,   incidental,   consequential  or  punitive damages,  or for loss  of profits  or for any other  damages  or other  legal  liability  of any kind,  beyond  or  different  than  the  limited  measure  of  recoverable   damages  expressly agreed  to herein.   Seller  makes  no representation or warranties  with  respect  to the Bulk Wine  delivered   under  this  Agreement   whether  express  or  implied,   including   without limitation  any  warranties  of  merchantability or  fitness  for  a particular  purpose  and  all such  warranties  are expressly waived  and disclaimed except  as set forth  herein.   Buyer hereby  releases  Seller,  its agents  and employees, from  any  claims,  demands,  damages, liability  or causes  of action  for any monetary  recovery  except  as expressly  set forth  and limited  above  and  agrees  to  hold  Seller,  its  agents  and  employees free  and  harmless there from.   The  parties  recognize  it  would  be  impracticable and  extremely  difficult  to determine  and fix actual damages  in the event of any breach, act or omission  by Seller, its agents  or employees, as referenced  above  and the parties  agree  that the limitation  upon damages  specified  above  represents  their  joint,  good  faith,  best  effort  to fairly  set  and limit any such damages and it shall apply and control regardless of alleged or actual other or further damages, claims, losses, expenses or costs of any kind.                                                        
    </p>
    
    <p>
        <b>Indemnification.</b>  Buyer shall defend, indemnify and hold harmless Seller, its owners, members, officers, directors, shareholders, representatives, agents and employees, against any and all liability, loss or expense of any kind, including but not limited to claims, damages,  costs,  fees  (including  reasonable  attorney's  fees,  interest,  accounting  fees, expert witness fees, costs, and expenses), losses, recoveries, settlement expenses and/or fines, incurred by Seller, whether or not foreseeable, contingent or otherwise and whether directly or indirectly arising from or related to any act, omission, negligence, whether active or passive, breach or other conduct of Seller, its agents or employees, arising out of Buyer's use of the Bulk Wine.                                                      
    
    </p>
    
    <p>
        <b> Non-Disclosure.</b>  Buyer and Seller agree that (except as may be required by law) they, and each of them respectively, will not disclose, and will not allow the disclosure of, any of the terms and conditions of this Agreement to any third party without the prior written consent of the non-disclosing party.  Buyer and Seller hereby represent that they understand the confidential nature of this Agreement and will use all efforts to ensure that the terms and conditions of this Agreement remain confidential and will cause their officers, directors, employees,  representatives,  agents,  advisors  and consultants not  to disclose  any of  the terms or conditions hereof.  Buyer and Seller further covenant and agree that they will not disclose the origin of the Bulk Wine (except for appellation or geographic designation) nor disclose each other’s identity to any third party.   Buyer shall not be entitled to use any trade names, trademarks or trade dress of or related to Seller in any way, including, without limitation, the marketing or distribution of, or advertising for the sale of, any of the Bulk Wine or any wine blended therewith, nor shall Buyer acquire any interest  in the trade names trademarks or trade dress of Seller.                                                       

    </p>
    
    <p>
        <b>Venue:</b>  Any arbitration or other legal action arising out of, or related to, this Agreement shall be venued in Santa Barbara County, CA.

    </p>
    
    <p>
        <b>Governing Law.</b>   This Agreement shall be governed by and construed according to the laws of the State of California.                                                     

    </p>
    
    <p>
        <b>Successors and Assigns.</b>  This Agreement shall be binding on all successors, permitted assigns, heirs, and executors of the parties and shall not be assigned by either party without the prior written consent of the other party.                                                       

    </p>
    
    </apex:outputText>    

<!-- ********************************************************************************************************************************* -->
    
 <apex:outputtext rendered="{!if(or(Opportunity.type =='Finished Case Goods',Opportunity.type=='Custom Blend', Opportunity.type=='Private Label'), true, false)}">
    <p>
        These terms and conditions apply to the purchase of bottled wines (“Shiners”) purchased by Buyer in the Contract from Terravant Wine Company, LLC (“Terravant”; Buyer and Terravant together, the “Parties”).
     </p>

     <p>
         <b>Responsibilities of Parties.</b>  At the request of Buyer, Terravant shall be responsible for labeling and packing the Shiners, using the label and intellectual property (“Label”) provided by Buyer.  Buyer shall be responsible for providing the Label, for paying for the Shiners, and for arranging and paying the freight for the removal of the Shiners from Terravant storage as required by the terms of the Contract.  Buyer shall provide proof of all federal and state required licenses and permits including but not limited to those required by the California Department of Alcoholic Beverage Control (“ABC”), Federal Alcohol and Tobacco Tax and Trade Bureau (“TTB”), and the California Board of Equalization.
     </p>
     
     <P>
         <b>Recordkeeping.</b> Terravant shall be responsible for all cellar recordkeeping required in connection with the labeling of Buyer’s Shiners.  Source documents will be maintained by Terravant to support the label claims for Buyer’s labeled Shiners.  Upon request, Terravant will make its records available for inspection by representatives of regulatory agencies.
     </P>
     
     <p>
         <b>Labeling</b>  It is the responsibility of TWC as the bottler to obtain a Certificate of Label Approval (COLA) for wines bottled in our facility.  Please submit your label art to TWC at least 45 days in advance of shipping so we may obtain a COLA for your label.  All labels should include the statement “Vinted and bottled by_____, Buellton, CA.”   If we are unable to obtain a COLA for your label before shipping, we will transfer the unlabeled wine to a bonded location of your choosing with a copy of our COLA and we will work with you to obtain approval of your label after you have received the wine.  It is your responsibility to affix a label with an approved COLA to the purchased wine bottles.  Note that unlabeled bottled wine may only be transferred in bond with an approved COLA and that unlabeled wine should not be removed from bond as “tax-paid.”   
     </p>
     
     <p>
         <b>Removal from Terravant Bond.</b>    Shiners shall be tax-paid by Buyer upon removal from Terravant premises unless arrangements for bond-to-bond transfer are made with Terravant.  Shiners may be transferred in bond and stored in bond in Terravant’s bonded storage facility or another bonded storage facility.  Terravant’s staff will prepare a bill of lading and bond-to-bond transfer form from Buyer to Terravant or such other bonded facility as Buyer shall specify.  Terravant will not pay taxes upon removal of wine from bond.   If wine is stored under Terravant’s bond, it must be tax-paid by Buyer prior to removal for delivery to Buyer.  
     </p>
     
     <p>
         <b>Prices and Payment Schedule.</b>  The prices and payment schedule for labeled Shiners are listed on the Contract.  If terms are not met, contract will be voided. Labeled Shiners shall not be removed from Terravant premises prior to payment in full by Buyer unless otherwise agreed in writing by the Parties. Terravant shall have a lien on Buyer’s labeled Shiners for all amounts due and payable under the Contract and may sell Buyer’s wine at a public or private sale to satisfy Terravant’s lien, as permitted by law.
     </p>
     
    <p>
        <b>Sales Tax Liability.</b>  Buyer will be responsible and liable for payment of all applicable sales taxes.  Buyer will provide Terravant with a resale certificate on a form acceptable to Terravant.  If Buyer neglects to provide such certificate, then at Terravant’s sole option it can pay the sales tax due and collect the tax from Buyer. 
        </p>     
     
     <p>
         <b>Storage and Removal.</b>  Storage charges will begin 30 days after project completion at a charge of $0.20 per case per month. Long term storage is subject to approval and buyer must enter into a custom crush agreement with TWC for the duration. Removals by full pallet quantities only. It is the Buyer's responsibility to organize trucking companies to remove the wine from TWC's Santa Maria facility. TWC requires a minimal 48 hour notice for pick up.
     </p>
     
     <p>
         <b>Limitation of Liability.</b> In no event shall Terravant be liable for any incidental, consequential or special damages, interest, costs or expenses, or for loss of use of lost profits or wages, incurred by buyer in connection with the purchase or sale or use of goods, whether or not Terravant knew such damages might be incurred. Buyer shall not off-set any costs against invoice payment unless approved in advance in writing by Terravant. 
     </p>
     
     <p>
         <b>Force Majeure.</b>  In the event either Terravant or Buyer is unable to perform its obligations under the Contract because of the passage hereafter of any laws or regulations, or because of any legal or administrative proceedings of any government or governmental agency, court or administrative agency order, strikes, boycotts, lockouts, other labor disturbances, interruption of power, Terravant’s temporary or permanent lack or loss of processing capacity for reasons outside Terravant’s  reasonable control, fire, explosion, catastrophe, crop failure or shortage as a result of uncontrollable actions of the elements, or other Act of God, then the party so affected shall, while to the extent so affected be relieved to the extent thus prevented from performing its obligations hereunder.     
      </p>
     
     <p>
         <b>Governing Law.</b>  This Agreement shall be governed by, construed, and enforced in accordance with, and subject to, the laws of the State of California.
         
     </p>
     
     <p>
         <b>Dispute Resolution.</b>  The Parties shall first attempt to resolve any dispute related to this Agreement in an amicable manner.  If unable to resolve the issue, the parties will choose a mutually acceptable mediator in Santa Barbara, California to assist with resolution of the matter.  If unable to agree upon an acceptable mediator, either party may ask a mutually agreed-upon mediation service to appoint a neutral mediator, and the mediation shall be conducted under the Commercial Mediation Rules of the mutually acceptable mediation service.  Any disputes remaining unresolved after mediation shall be settled by binding arbitration conducted in Santa Barbara, California at JAMS, in accordance with JAMS arbitration administration policies and JAMS arbitration procedures.  The prevailing party shall be entitled to recover its costs and reasonable attorney’s fees, as determined by the arbitrator. The arbitrator shall be required to follow the law.
     </p>
     
     
 </apex:outputtext>
    
    
</apex:page>

Hopefully I'm just making a stupid mistake, but I'm worried there is a bug somewhere

Thanks,
 
Hi,

I'm new to the development side so any help would be appreciated.

I have created a custom object Prospects, whose standard field is Prospect Name. I would like Prospect Name to autopopulate with the Account Name that the custom object is associated with. (Account is a lookup on the custom object). I first tried this with a workflow and it is not updating when I create a new record. My next thought is that this needs to be a trigger, but I do not have enough experience writing these. Is this even possible? Any suggestions would be appreciated.
Hi everyone,

I am currently going through all of the TrailHead Modules in my spare time.  I am currently on the Apex Trigger module and I am having an issue.  When I go to save the initial example trigger it just keeps saying saving and never actually saves.   I've copied my code below.

trigger helloWorldTrigger on Account (before insert) {
    System.debug('Hello World!');
}

The one thing I noticed that was different was that in the example Hello World! is green while in my code it is red.