• b.gonzalez
  • NEWBIE
  • 155 Points
  • Member since 2013
  • Business System Analyst

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 45
    Questions
  • 50
    Replies
Hi there,

I created the following report formula called 'Total for Current FQ'. In the report, the opportunity values, should added up to the summary value but that is not the case. See image of the report below.  I appreciate any help on this. Thank you!

IF(OR((
Opportunity.Total_Amount_for_Current_FQ__c:SUM==0.00),
Opportunity.Total_Amount_for_Current_FQ__c:SUM==null), AMOUNT:SUM,
Opportunity.Total_Amount_for_Current_FQ__c:SUM)

User-added image

Here is the report:
User-added image

Beth
 
I am trying to create a Closed Won amount custom formula field.  When the Stage = Closed Won, the fiield should display the Amount value if the 'Total Amount for Current FQ' is $.0.00 or 'Null' or the 'Total AMount for Current FQ' value. I am not sure how to write these formula. Here are the fields that would be in the formula:

StageName =  Closed Won
Total_Amount_for_Current_FQ__c
Amount

I appreciate the help!

Thanks!
Hi there,

I am recieving the following error: String.contactId. I am not sure how to resolve this. I appreciate any assistance. 

Thanks!
<messaging:emailTemplate subject="Marketing Generated Named Account Prospects - NA-Eastern Region" recipientType="User" relatedToType="Campaign">
<messaging:htmlEmailBody > 
     <html>
        <body>
         <STYLE type="text/css">
               TH {font-size: 14px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
               TD  {font-size: 14px; font-face: verdana }
               TABLE {border: solid #CCCCCC; border-width: 1}
               TR {border: solid #CCCCCC; border-width: 1}
         </STYLE>
                  <font face="arial" size="3"></font>
        <p>Dear Jim Michelson,</p>
        <p>New marketing generated named account prospect(s) have been assigned to you and are now available for follow up. In addition, attached for your use is a follow up template.</p> 
        <p>To view the prospects that have been assigned to you click on the report link below.</p>
        <apex:outputLink value="https://qlogic--sandbox.cs7.my.salesforce.com/00OM0000000h74W">Named Account Prospects Eastern Region </apex:outputLink><br></br>

<table border="1"></table>
<tr></tr>
<table border="0" >
                 <tr >
                     <th>Prospect First Name</th><th>Prospect Last Name</th><th> Title </th><th> Phone </th><th> Email </th><th> State </th><th> Country </th><th>Company Name</th><th> Marketing Source</th>
                 </tr>
    <apex:repeat var="cm" value="{!relatedTo.CampaignMembers}," Rendered="{!IF(NOT(ISBLANK(!relatedTo.CampaignMembers[0].Notification_Needed__c)),true, false)}">
     <tr>
           <td>{!IF(cm.contactId != null,cm.contact.FirstName,cm.lead.firstname)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.LastName,cm.lead.lastname)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Title,cm.lead.Title)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Phone,cm.lead.Phone)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Email,cm.lead.Email)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.MailingState,cm.lead.State)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.MailingCountry,cm.lead.Country)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Account.Name,cm.lead.Company)}</td>
           <td>{!cm.Campaign.Name}</td>
           </tr> 
    </apex:repeat>                     
       </table>
       <p>Sincerely,</p> 
       <p>System Administrator</p>
        </body>
    </html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

Beth
I need some assistance. I am trying to write a VF email template that displays only the campaign members when the custom checkbox field called Notification Needed equals "True".  Listed below is the VF email template. 

In the template I wrote: <apex:repeat var="cm" value="{!relatedTo.CampaignMembers}," Rendered="{!IF(NOT(ISBLANK(!relatedTo.CampaignMembers.Notification_Needed__c)),true, false)}"> But it is not correct. 

I am recieving the following Error: Unknown property 'VisualforceArrayList.Notification_Needed__c'

I appreciate any help you can offer. Thanks!

 
<messaging:emailTemplate subject="Marketing Generated Named Account Prospects - NA-Eastern Region" recipientType="User" relatedToType="Campaign">
<messaging:htmlEmailBody > 
     <html>
        <body>
         <STYLE type="text/css">
               TH {font-size: 14px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
               TD  {font-size: 14px; font-face: verdana }
               TABLE {border: solid #CCCCCC; border-width: 1}
               TR {border: solid #CCCCCC; border-width: 1}
         </STYLE>
                  <font face="arial" size="3"></font>
        <p>Dear Jim Michelson,</p>
        <p>New marketing generated named account prospect(s) have been assigned to you and are now available for follow up. In addition, attached for your use is a follow up template.</p> 
        <p>To view the prospects that have been assigned to you click on the report link below.</p>
        <apex:outputLink value="https://qlogic--sandbox.cs7.my.salesforce.com/00OM0000000h74W">Named Account Prospects Eastern Region </apex:outputLink><br></br>

<table border="1"></table>
<tr></tr>
<table border="0" >
                 <tr >
                     <th>Prospect First Name</th><th>Prospect Last Name</th><th> Title </th><th> Phone </th><th> Email </th><th> State </th><th> Country </th><th>Company Name</th><th> Marketing Source</th>
                 </tr>
    <apex:repeat var="cm" value="{!relatedTo.CampaignMembers}," Rendered="{!IF(NOT(ISBLANK(!relatedTo.CampaignMembers.Notification_Needed__c)),true, false)}">
     <tr>
           <td>{!IF(cm.contactId != null,cm.contact.FirstName,cm.lead.firstname)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.LastName,cm.lead.lastname)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Title,cm.lead.Title)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Phone,cm.lead.Phone)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Email,cm.lead.Email)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.MailingState,cm.lead.State)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.MailingCountry,cm.lead.Country)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Account.Name,cm.lead.Company)}</td>
           <td>{!cm.Campaign.Name}</td>
           </tr>
    </apex:repeat>                     
       </table>
       <p>Sincerely,</p> 
       <p>System Administrator</p>
        </body>
    </html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 
Do you know how I can write a workflow formula for when the  Date_of_Last_Member_Added__c is changed on a specific campaign? The campaign name is "NA - Named Accounts Western Region Prospects"? Or should I use the campaign id?
There are specific data that needs to render in all caps in the VF email template. How do I write that into the VF email template?

This is section of code that needs be outputted in all caps. 
<th>CUSTOMER INFO</th><th> </th>
        <tr>
               <td><b>Company:</b></td>
           <td>{!relatedTo.Contact.Account.Name}</td>
            </tr>
           <tr>
               <td><b>Address:</b></td>
           <td>{!relatedTo.Contact.MailingStreet}</td>
            </tr>
       <tr>
               <td><b>City:</b></td>
           <td>{!relatedTo.Contact.MailingCity} </td>
            </tr> 
       <tr>
               <td><b>State:</b></td>
           <td>{!relatedTo.Contact.MailingState}</td>
           </tr>
           <tr>
               <td><b>Postal Code:</b></td>
           <td>{!relatedTo.Contact.MailingPostalCode}</td>
           </tr>
           <tr>
               <td><b>Country:</b></td>
           <td>{!relatedTo.Contact.MailingCountry}</td>
            </tr>
           <tr>
Here is the entire code of the VF email template:
<messaging:emailTemplate recipientType="Contact"
  relatedToType="Case"
  subject="RMA ON DEMAND - {!relatedTo.CaseNumber} - {!relatedTo.ThreadID__c}">
  <messaging:htmlEmailBody >
    <html>
     <table align="left" width="640px" border="0" cellspacing="0" cellpadding="0">
      <head>
      <apex:image id="Logo" value="https://c.cs16.content.force.com/servlet/servlet.ImageServer?id=015f0000000GJGr&oid=00Df0000003cHuJ&lastMod=1440092921000"/>
      </head>
      <body>
      <STYLE type="text/css">
          table {border-collapse:collapse; table-layout:fixed; width:600px;}
          table td {border:solid 1px #CCCCCC; width:100px; word-wrap:break-word;}
          H3 {color: #004488}
          TH {font-size: 14px; font-face: Tahoma; color: #004488; border: solid #CCCCCC; background: #dfdfdf;
               border-width: 1;  text-align: left } 
          TD  {font-size: 13px; font-face: Tahoma } /
          TABLE{border: solid #CCCCCC; border-width: 1}
          TR {border: solid #CCCCCC; border-width: 1}
        </STYLE>
        <font face="Tahoma" size="2">   
            <br></br>
            <div>Hi Gayle,</div> 
            <br></br>
            <div>Please process the following <b>RMA</b>. If there are any questions, please reply all.</div>
            <br></br>
          <table border="1" >
            <tr> 
               <th>RMA INFO</th><th> </th>
            <tr>    
               <td><b>RMA Type:</b></td>
           <td>{!relatedTo.RMA_Type__c}</td>
            </tr>
            <tr>    
               <td><b>Case Number:</b></td>
           <td>{!relatedTo.CaseNumber}</td>
           </tr>    
            <tr>
             <th>CUSTOMER INFO</th><th> </th>
        <tr>
               <td><b>Company:</b></td>
           <td>{!relatedTo.Contact.Account.Name}</td>
            </tr>
           <tr>
               <td><b>Address:</b></td>
           <td>{!relatedTo.Contact.MailingStreet}</td>
            </tr>
       <tr>
               <td><b>City:</b></td>
           <td>{!relatedTo.Contact.MailingCity} </td>
            </tr> 
       <tr>
               <td><b>State:</b></td>
           <td>{!relatedTo.Contact.MailingState}</td>
           </tr>
           <tr>
               <td><b>Postal Code:</b></td>
           <td>{!relatedTo.Contact.MailingPostalCode}</td>
           </tr>
           <tr>
               <td><b>Country:</b></td>
           <td>{!relatedTo.Contact.MailingCountry}</td>
            </tr>
           <tr>
               <td><b>Contact Name:</b></td>
           <td>{!relatedTo.Contact.Name}</td>
            </tr>
           <tr>
               <td><b>Contact Phone:</b></td>
           <td>{!relatedTo.Contact.Phone} </td>
            </tr>
           <tr>
               <td><b>Contact Email:</b></td>
           <td>{!relatedTo.Contact.Email}</td>
            </tr>
           <tr> 
               <th>PART INFO</th><th> </th>
            <tr>    
               <td><b>Model Number:</b></td>
           <td>{!relatedTo.Model_Number__c}</td>
            </tr>
           <tr>    
               <td><b>Outbound Part Number:</b></td>
           <td>{!relatedTo.Outgoing_Part__c}</td>
            </tr>
             <tr>    
               <td><b>Outbound Serial Number:</b></td>
           <td>{!relatedTo.Outgoing_Serial__c}</td>
           <tr>    
               <td><b>Inbound Part Number:</b></td>
           <td>{!relatedTo.Part_Number__c} {!relatedTo.Part_number_2__c} {!relatedTo.Part_number_3__c}</td>
            </tr>
           <tr>    
               <td><b>Inbound Part Serial Number:</b></td>
           <td>{!relatedTo.SN__c} {!relatedTo.Serial_number_2__c} {!relatedTo.Serial_number_3__c} {!relatedTo.Serial_number_4__c}</td>
            </tr>
            <tr>    
               <td><b>Chassis Serial Number:</b></td>
           <td>{!relatedTo.Chassis_Serial_Number_1__c} </td>
            </tr>
           <tr>    
               <td><b>Problem Description:</b></td>
           <td>{!relatedTo.Detailed_Problem_Description_1__c} </td>
            </tr>
         </tr>
      </tr>
     </tr>
     </tr>
    </table>
    <br></br>
    <div>Thanks,</div>
    <div>{!relatedTo.Owner.Name} </div>
   </font>
  </body>
  </table>
 </html>
</messaging:htmlEmailBody>  
</messaging:emailTemplate>

Thanks!

Beth
 
Creating a VF email tempate for the opportunity object. On the opportunity object we have a related list called Note to Distributor (API Name: Note_to_Distributor__c). I am trying to have the Note to Distributor to appear in the the VF emial template. 

I am recieving the following error: Invalid field Note_to_Distributor__c for SObject Opportunity. This is the section of the code regarding the error. I am not sure why API Name for Note to Distributor is incorrect?
<apex:repeat var="noteToDis" value="{!relatedTo.Note_to_Distributor__c}">
              <tr>
                <td><a href="https://cs16.salesforce.com/{!noteToDis.id}">View</a> |  
                <a href="https://cs16.salesforce.com/{!noteToDis.id}/e">Edit</a></td>
                <td>{!noteToDis.Note_To_Distributor_Body__c}</td>
                <td>{!noteToDis.CreatedDate)}</td>
              </tr>
         </apex:repeat>

Here is the entire VF Email Template Code:
<messaging:emailTemplate recipientType="Contact"
  relatedToType="Opportunity"
  subject="New Note to Distributor: {!relatedTo.ChannelRequestAuthorization__c}"
  replyTo="pmiprogrammanager@qlogic.com">
  <messaging:htmlEmailBody >
    <html>
      <body>
        <STYLE type="text/css">
          H3 {color: #004488}
          TH {font-size: 13px; font-face: arial; color: #004488; background: #dfdfdf;
               border-width: 1;  text-align: center } 
          TD  {font-size: 11px; font-face: arial } 
          TABLE {border: solid #CCCCCC; border-width: 1}
          TR {border: solid #CCCCCC; border-width: 1}
        </STYLE>
        <font face="arial" size="2">
      <h3>Request:{!relatedTo.ChannelRequestAuthorization__c}- New Note</h3>    
          <p>A new note has been added to the opportunity request. Please see details below. For more information regarding this registration,login into your PMI account and or contact your Qlogic Channel Sales Representative.</p>
          <table border="1" >
            <tr> 
               <th>Request Details</th>
            </tr>
            <tr>    
               <td><b>Channel Authorization Number:</b></td>
           <td>{!relatedTo.ChannelRequestAuthorization__c}</td>
            </tr>
            <tr>    
               <td><b>Distributor:</b></td>
           <td>{!relatedTo.Distributor__r.Name}</td>
           </tr>    
           <tr>
               <td><b>Reseller:</b></td>
           <td>{!relatedTo.Reseller__r.Name}</td>
            </tr>
            <tr>
               <td><b>End User:</b></td>
           <td>{!relatedTo.Account.Name}</td>
            </tr>
            <tr>
              <th>Product List</th><th>Quantity </th>
            </tr>
            <apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">
              <tr>
                <td><a href="https://cs16.salesforce.com/{!opp.id}">View</a> |  
                <a href="https://cs16.salesforce.com/{!opp.id}/e">Edit</a></td>
                <td>{!opp.PriceBookEntry.name}</td>
                <td>{!ROUND(opp.Quantity,0)}</td>
              </tr>
         </apex:repeat>  
            <apex:repeat var="noteToDis" value="{!relatedTo.Note_to_Distributor__c}">
              <tr>
                <td><a href="https://cs16.salesforce.com/{!noteToDis.id}">View</a> |  
                <a href="https://cs16.salesforce.com/{!noteToDis.id}/e">Edit</a></td>
                <td>{!noteToDis.Note_To_Distributor_Body__c}</td>
                <td>{!noteToDis.CreatedDate)}</td>
              </tr>
          </apex:repeat>                
       </table>
      <p/>
   </font>
  </body>
 </html>
</messaging:htmlEmailBody>  
</messaging:emailTemplate>

I appreciate the help!

Beth
 
I created a custom object called: On-Going Reveneye by Fiscal Quarter. This custom object is related to Opportunity object.

I need to be able to calculate the Remaining Quanity for a product that appears on the opportunity ( see image below). Does anyone know if this is possible?

Is it possible to write a formula that will match the product on the Opportuntity line item to the product on the On-Going revenue related list, then subtract quantities to get the remaining quantity?

User-added image

I appreciate the help!

Thanks!

Beth
How do I make a field visible based upon another field's selection without creating a visualforce page? Is this even possible?

 
Currently we have Opportunity Approval Process - when a opportunity record is submitted for approval- the approval goes to several approvers depending on the criteria listed in each step. If one BU “approves” one part of the deal and the other BU “rejects” other part, the entire deal would be "rejected”. Either the deal would have to be modified and “approved” by both Business Units, or the deal would be considered ‘dead’.

Each Business Unit is responsible for a different line of business(s). An opportunity can have mulitple lines of business. With the way the Approval Process is set up, we run the risk with the apporval request never getting to one of the Business Units. 

We want to split the approval process into two separate Approval Process. When the opportunity is submitted for approval. Two Approval Process are fired off at the same time. Is this possible?
I performed the following steps to delete Apex Class from production using Force.com IDE, however I am not able to deploy to the server? The button is greyed out. What am I doing wrong? Did I miss a step?

- Force.com IDE should be installed and working.
- Connect to the Productio Instance using the IDE.
- Created a project and select the apex class and trigger I want to delete. 
- Open the matching .xml file change the Status XML tag from "Active" to "Deleted".
- Save the file locally. 

User-added image
Beth
 
I have a custom button on the Case object. However when the users clicks on the button. The record is not updating.
 
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
if("{!Case.Status}" != "Closed"){ 
var record = new sforce.SObject("Case"); 
record.Id = "{!Case.Id}"; 
record.Status= 'Closed'; 
record.Product_Family__c= 'Unknown'; 
record.Product_Model__c= 'Unknown'; 
record.Problem_Code__c= 'Inquiry - Non-Technical'; 
record.Resolution_Code__c= 'Spam'; 
var result = sforce.connection.update([record]); 
} 
// check the result here 
window.location.reload();

 
I am not sure how to write a OnClick JavaScript custom close button on case object.

When the user clicks on this custom button, the following fields need to be updated with the given values.

Fields on case object:
Product Family = Unknown        
Product Model = Unknown
Problem Code = Non-Technical
Resolution Code = Spam
Status = Closed
Resolution Description = Spam
Account Name (lookup field) =  Unclassified Customer – Minnetonka 

Also need to associate the contact to the account; Unclassified Customer – Minnetonka


I appreciate the help!

Beth
In order to include approver comments on a Opportunity report, I created a custom field called BU Approver Comments opportunity. I orginally planned to create a field update on the Approval Process. However, I have been told this is not possible and that I would need to write a trigger.

Custom field on opportunity: BU_Approval_Comments__c

I am not sure who to write this trigger? Let me know what you need from me in order to write this trigger.

Beth

 
I am tryinig to import certificate files using the "Import from Keystore" button that appears on Certificate and Key Management page in setup. 

These are the certs that I am trying import:
  • COMODORSAOrganizationValidationSecureServerCA.crt
  • COMODORSAAddTrustCA.crt
  • AddTrustExternalCARoot.crt
  • STAR_qlogic_com.crt
When I import, I recieve error - keystore file is corrupted. I am not sure what I am doing and why I am getting error. PLEASE HELP!

User-added image

Beth
A problem with the OnClick JavaSCript for this button or link was encountered. Unexpected toekn ILLEGAL. Not sure what is "illegal". 

PLEASE HELP!
 
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/19.0/apex.js")} 

if('{!Opportunity.Opportunity_Status__c}' == 'Denied') { 
alert('This opportunity cannot be approved because it has been denied.'); 
} else if('{!Opportunity.Opportunity_Status__c}' != 'Approved') { 
alert('This opportunity must be approved in order to complete this action.'); 
}else if('{!Opportunity.Amount}' != '0.00') { 
alert('This opportunity cannot be updated because no products are listed'); 
}else if('var strQuantity = sforce.connection.query("select Id, Quantity from opportunityLineItem where OpportunityId = '{!Opportunity.Id}'")'); 
}else if('var records = strQuantity.getArray("records")'); 
}else if('var quantity; 
for (var i=0; i< records.length; i++) { 
var record = records[i]; 
if (record.Quantity <50) { 
quantity = record.Quantity'); 
} 
} 
}else if('switch(true){ 
case quantity<50:'){ 
alert('Quantity on products cannot be less than 50.')); 
}else { 
sforce.apex.execute("CMR_DesignWebService", "UpdateToPMIDesign",{OpportunityId:'{!Opportunity.Id}'}); 
alert('Opportunity Approved in PMI system.'); 
window.location = window.location; 
}

Beth
I am modifying a custom javascript button to include a validation that prevents the user from entering quanitities less than 50 for each product that is listed on the Opportunity record. Products are a related list on the Opportunity record. 

However I am not sure how to reference the Quantity field in the button. See bolden section. Please help!
 
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/19.0/apex.js")} 

var strStatus = '{!Opportunity.Opportunity_Status__c}'; 
switch(strStatus) { 
case 'Denied': 
alert('This opportunity cannot be approved because it has been denied.'); 
break; 
case 'Closed': 
case 'Awaiting Claim': 
case 'Claim Submitted': 
case 'Closed Expired': 
case 'Closed Won': 
case 'Closed Lost': 
alert('This opportunity cannot be updated.'); 
break; 
} 
var strAmount = '{!Opportunity.Amount}'; 
switch(strAmount){ 
case '$0.00': 
alert('This opportunity cannot be approved because no products are listed.'); 
break; 
} 
var strQuantity = '{!Product.Quantity}'; 
switch(strQuantity){ 
case 'Quantity < 50'  
alert('Quantity on products cannot be less than 50.'); 
break; 
default: 
sforce.apex.execute("CMR_DesignWebService", "ApproveToPMIDesign",{OpportunityId:'{!Opportunity.Id}'}); 
alert('Opportunity Approved in PMI system.'); 
window.location = window.location; 
break; 
}

 
I am recieving the following message when clicking on the custom button: "Problem with OnClick JavaScript button - unexpected end of input".

The issue is with the script written on !Opportunity. Amount. I am trying to write that the opportunity cannot be approved in PMI when the Amount field is BLANK.

Please help! Thanks! Beth
 
{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/19.0/apex.js")} 

var strStatus = '{!Opportunity.Opportunity_Status__c}'; 
switch(strStatus) { 
case 'Denied': 
alert('This opportunity cannot be approved because it has been denied.'); 
break; 
case 'Closed': 
case 'Awaiting Claim': 
case 'Claim Submitted': 
case 'Closed Expired': 
case 'Closed Won': 
case 'Closed Lost': 
alert('This opportunity cannot be updated.'); 
break; 
var strAmount = '{!Opportunity.Amount}'; 
switch(strAmount){ 
case 'Null': 
alter('This opportunity cannot be approved because no products are listed.'); 
break; 
default: 
sforce.apex.execute("CMR_DesignWebService", "ApproveToPMIDesign",{OpportunityId:'{!Opportunity.Id}'}); 
alert('Opportunity Approved in PMI system.'); 
window.location = window.location; 
break; 
}

 
Here is the message we are getting which is being returned after the lead is created successfully.

Msg 6522, Level 16, State 1, Procedure usp_SalesForceBulkImport, Line 0
A .NET Framework error occurred during execution of user-defined routine or aggregate "usp_SalesForceBulkImport":
System.InvalidOperationException: A result set is currently being sent to the pipe. End the current result set before calling Send.
System.InvalidOperationException:
   at Microsoft.SqlServer.Server.SqlPipe.Send(String message)
   at CMRCLR.CMRCLR.Salesforce.SendToPipe(String strText)
   at CMRCLR.CMRCLR.Salesforce.BulkImport(String SObjectName, String SObjectFieldList, String DataSourceQuery, Boolean IsSandbox, Int16 BatchSize)


Pleas help!

Beth
I am modifying an existing triggger and I am new to development. Need your help with the following error: Error: Compile Error: Variable does not exist: opp.Distributor_Performing_Integration__c at line 6 column 66
 
trigger CMR_OpportunityLineItemUpdated on OpportunityLineItem (after insert, after update, after delete, after undelete,before update, before insert) { 
    //Added before insert and before update events for Case 00076809
    //Added if condition for Case 00076809
    Opportunity I = trigger.new [0]; 
    if(I.RecordType.Name =='NewBDChannelOppRecordType'){
    if(I.RecordType.Name =='DesignChannelOpportunityRecordType'&&opp.Distributor_Performing_Integration__c==false&&opp.Distributor_Performing_Integration__c==true){
    if(trigger.IsAfter){
        string OpportunityId = '';
        if(trigger.isDelete) {
            OpportunityId = trigger.old[0].OpportunityId;
        } else {
            OpportunityId = trigger.new[0].OpportunityId;
        }
        Opportunity opp = new Opportunity(Id=OpportunityId);
        opp.CSG__c = false;
        opp.LMG__c = false;
        opp.NXN__c = false;
        opp.SPG__c = false;
        opp.SSG__c = false;
        opp.STI__c = false;
        opp.SIG__c = false;
        opp.EPG__c = false;
        List<OpportunityLineItem> prods = [Select PricebookEntry.Product2.Oracle_LOB__c From OpportunityLineItem Where PricebookEntry.IsActive = True And PricebookEntry.IsDeleted = False And PricebookEntry.Product2.IsActive = True And PricebookEntry.Product2.IsDeleted = False And OpportunityId = :OpportunityId];
        
        for(OpportunityLineItem oli:prods) {
            Product2 p2 = oli.PricebookEntry.Product2;

            if(p2.Oracle_LOB__c == 'CSG') {
                opp.CSG__c = true;
            } else if(p2.Oracle_LOB__c == 'LMG') {
                opp.LMG__c = true;
            } else if(p2.Oracle_LOB__c == 'NXN') {
                opp.NXN__c = true;
            } else if(p2.Oracle_LOB__c == 'SPG') {
                opp.SPG__c = true;
            } else if(p2.Oracle_LOB__c == 'SSG') {
                opp.SSG__c = true;
            } else if(p2.Oracle_LOB__c == 'STI') {
                opp.STI__c = true;
            } else if(p2.Oracle_LOB__c == 'SIG') {
                opp.SIG__c = true;
            } else if(p2.Oracle_LOB__c == 'EPG') {
                opp.EPG__c = true;
            }
           
        }
        update opp;
    }
    
    // Added for Case 00076809
    if(trigger.IsBefore){
        Set<String> products = new Set<String>{'SPG_SWITCH_TEST', 'SSG_ROUTER_TEST','PRF1-105XXC','PRF3-105XXC'};
        
        Map<Id,OpportunityLineItem> oliMap = new Map<Id,OpportunityLineItem>([Select Id, PricebookEntry.Product2.Name,PricebookEntry.Product2Id, Discount__c from OpportunityLineItem where Id in:trigger.New and (PricebookEntry.Product2.name in: products or PricebookEntry.Product2.Name like '%-MO-%')]);
        system.debug('**oliMap**'+oliMap );
        for(OpportunityLineItem oli: trigger.new){
            system.debug('**inside for**' );
            if(oliMap!= null && oliMap.get(oli.Id)!=null){
            system.debug('**inside if**' );
            oli.Discount__c = 0;
            }
        }   
    }
  }
 }
}

Thanks!

Beth
Hi there,

I created the following report formula called 'Total for Current FQ'. In the report, the opportunity values, should added up to the summary value but that is not the case. See image of the report below.  I appreciate any help on this. Thank you!

IF(OR((
Opportunity.Total_Amount_for_Current_FQ__c:SUM==0.00),
Opportunity.Total_Amount_for_Current_FQ__c:SUM==null), AMOUNT:SUM,
Opportunity.Total_Amount_for_Current_FQ__c:SUM)

User-added image

Here is the report:
User-added image

Beth
 
I am trying to create a Closed Won amount custom formula field.  When the Stage = Closed Won, the fiield should display the Amount value if the 'Total Amount for Current FQ' is $.0.00 or 'Null' or the 'Total AMount for Current FQ' value. I am not sure how to write these formula. Here are the fields that would be in the formula:

StageName =  Closed Won
Total_Amount_for_Current_FQ__c
Amount

I appreciate the help!

Thanks!
I need some assistance. I am trying to write a VF email template that displays only the campaign members when the custom checkbox field called Notification Needed equals "True".  Listed below is the VF email template. 

In the template I wrote: <apex:repeat var="cm" value="{!relatedTo.CampaignMembers}," Rendered="{!IF(NOT(ISBLANK(!relatedTo.CampaignMembers.Notification_Needed__c)),true, false)}"> But it is not correct. 

I am recieving the following Error: Unknown property 'VisualforceArrayList.Notification_Needed__c'

I appreciate any help you can offer. Thanks!

 
<messaging:emailTemplate subject="Marketing Generated Named Account Prospects - NA-Eastern Region" recipientType="User" relatedToType="Campaign">
<messaging:htmlEmailBody > 
     <html>
        <body>
         <STYLE type="text/css">
               TH {font-size: 14px; font-face: arial;background: #CCCCCC; border-width: 1;  text-align: center }
               TD  {font-size: 14px; font-face: verdana }
               TABLE {border: solid #CCCCCC; border-width: 1}
               TR {border: solid #CCCCCC; border-width: 1}
         </STYLE>
                  <font face="arial" size="3"></font>
        <p>Dear Jim Michelson,</p>
        <p>New marketing generated named account prospect(s) have been assigned to you and are now available for follow up. In addition, attached for your use is a follow up template.</p> 
        <p>To view the prospects that have been assigned to you click on the report link below.</p>
        <apex:outputLink value="https://qlogic--sandbox.cs7.my.salesforce.com/00OM0000000h74W">Named Account Prospects Eastern Region </apex:outputLink><br></br>

<table border="1"></table>
<tr></tr>
<table border="0" >
                 <tr >
                     <th>Prospect First Name</th><th>Prospect Last Name</th><th> Title </th><th> Phone </th><th> Email </th><th> State </th><th> Country </th><th>Company Name</th><th> Marketing Source</th>
                 </tr>
    <apex:repeat var="cm" value="{!relatedTo.CampaignMembers}," Rendered="{!IF(NOT(ISBLANK(!relatedTo.CampaignMembers.Notification_Needed__c)),true, false)}">
     <tr>
           <td>{!IF(cm.contactId != null,cm.contact.FirstName,cm.lead.firstname)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.LastName,cm.lead.lastname)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Title,cm.lead.Title)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Phone,cm.lead.Phone)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Email,cm.lead.Email)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.MailingState,cm.lead.State)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.MailingCountry,cm.lead.Country)}</td>
           <td>{!IF(cm.contactId != null,cm.contact.Account.Name,cm.lead.Company)}</td>
           <td>{!cm.Campaign.Name}</td>
           </tr>
    </apex:repeat>                     
       </table>
       <p>Sincerely,</p> 
       <p>System Administrator</p>
        </body>
    </html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>

 
Do you know how I can write a workflow formula for when the  Date_of_Last_Member_Added__c is changed on a specific campaign? The campaign name is "NA - Named Accounts Western Region Prospects"? Or should I use the campaign id?
There are specific data that needs to render in all caps in the VF email template. How do I write that into the VF email template?

This is section of code that needs be outputted in all caps. 
<th>CUSTOMER INFO</th><th> </th>
        <tr>
               <td><b>Company:</b></td>
           <td>{!relatedTo.Contact.Account.Name}</td>
            </tr>
           <tr>
               <td><b>Address:</b></td>
           <td>{!relatedTo.Contact.MailingStreet}</td>
            </tr>
       <tr>
               <td><b>City:</b></td>
           <td>{!relatedTo.Contact.MailingCity} </td>
            </tr> 
       <tr>
               <td><b>State:</b></td>
           <td>{!relatedTo.Contact.MailingState}</td>
           </tr>
           <tr>
               <td><b>Postal Code:</b></td>
           <td>{!relatedTo.Contact.MailingPostalCode}</td>
           </tr>
           <tr>
               <td><b>Country:</b></td>
           <td>{!relatedTo.Contact.MailingCountry}</td>
            </tr>
           <tr>
Here is the entire code of the VF email template:
<messaging:emailTemplate recipientType="Contact"
  relatedToType="Case"
  subject="RMA ON DEMAND - {!relatedTo.CaseNumber} - {!relatedTo.ThreadID__c}">
  <messaging:htmlEmailBody >
    <html>
     <table align="left" width="640px" border="0" cellspacing="0" cellpadding="0">
      <head>
      <apex:image id="Logo" value="https://c.cs16.content.force.com/servlet/servlet.ImageServer?id=015f0000000GJGr&oid=00Df0000003cHuJ&lastMod=1440092921000"/>
      </head>
      <body>
      <STYLE type="text/css">
          table {border-collapse:collapse; table-layout:fixed; width:600px;}
          table td {border:solid 1px #CCCCCC; width:100px; word-wrap:break-word;}
          H3 {color: #004488}
          TH {font-size: 14px; font-face: Tahoma; color: #004488; border: solid #CCCCCC; background: #dfdfdf;
               border-width: 1;  text-align: left } 
          TD  {font-size: 13px; font-face: Tahoma } /
          TABLE{border: solid #CCCCCC; border-width: 1}
          TR {border: solid #CCCCCC; border-width: 1}
        </STYLE>
        <font face="Tahoma" size="2">   
            <br></br>
            <div>Hi Gayle,</div> 
            <br></br>
            <div>Please process the following <b>RMA</b>. If there are any questions, please reply all.</div>
            <br></br>
          <table border="1" >
            <tr> 
               <th>RMA INFO</th><th> </th>
            <tr>    
               <td><b>RMA Type:</b></td>
           <td>{!relatedTo.RMA_Type__c}</td>
            </tr>
            <tr>    
               <td><b>Case Number:</b></td>
           <td>{!relatedTo.CaseNumber}</td>
           </tr>    
            <tr>
             <th>CUSTOMER INFO</th><th> </th>
        <tr>
               <td><b>Company:</b></td>
           <td>{!relatedTo.Contact.Account.Name}</td>
            </tr>
           <tr>
               <td><b>Address:</b></td>
           <td>{!relatedTo.Contact.MailingStreet}</td>
            </tr>
       <tr>
               <td><b>City:</b></td>
           <td>{!relatedTo.Contact.MailingCity} </td>
            </tr> 
       <tr>
               <td><b>State:</b></td>
           <td>{!relatedTo.Contact.MailingState}</td>
           </tr>
           <tr>
               <td><b>Postal Code:</b></td>
           <td>{!relatedTo.Contact.MailingPostalCode}</td>
           </tr>
           <tr>
               <td><b>Country:</b></td>
           <td>{!relatedTo.Contact.MailingCountry}</td>
            </tr>
           <tr>
               <td><b>Contact Name:</b></td>
           <td>{!relatedTo.Contact.Name}</td>
            </tr>
           <tr>
               <td><b>Contact Phone:</b></td>
           <td>{!relatedTo.Contact.Phone} </td>
            </tr>
           <tr>
               <td><b>Contact Email:</b></td>
           <td>{!relatedTo.Contact.Email}</td>
            </tr>
           <tr> 
               <th>PART INFO</th><th> </th>
            <tr>    
               <td><b>Model Number:</b></td>
           <td>{!relatedTo.Model_Number__c}</td>
            </tr>
           <tr>    
               <td><b>Outbound Part Number:</b></td>
           <td>{!relatedTo.Outgoing_Part__c}</td>
            </tr>
             <tr>    
               <td><b>Outbound Serial Number:</b></td>
           <td>{!relatedTo.Outgoing_Serial__c}</td>
           <tr>    
               <td><b>Inbound Part Number:</b></td>
           <td>{!relatedTo.Part_Number__c} {!relatedTo.Part_number_2__c} {!relatedTo.Part_number_3__c}</td>
            </tr>
           <tr>    
               <td><b>Inbound Part Serial Number:</b></td>
           <td>{!relatedTo.SN__c} {!relatedTo.Serial_number_2__c} {!relatedTo.Serial_number_3__c} {!relatedTo.Serial_number_4__c}</td>
            </tr>
            <tr>    
               <td><b>Chassis Serial Number:</b></td>
           <td>{!relatedTo.Chassis_Serial_Number_1__c} </td>
            </tr>
           <tr>    
               <td><b>Problem Description:</b></td>
           <td>{!relatedTo.Detailed_Problem_Description_1__c} </td>
            </tr>
         </tr>
      </tr>
     </tr>
     </tr>
    </table>
    <br></br>
    <div>Thanks,</div>
    <div>{!relatedTo.Owner.Name} </div>
   </font>
  </body>
  </table>
 </html>
</messaging:htmlEmailBody>  
</messaging:emailTemplate>

Thanks!

Beth
 
Creating a VF email tempate for the opportunity object. On the opportunity object we have a related list called Note to Distributor (API Name: Note_to_Distributor__c). I am trying to have the Note to Distributor to appear in the the VF emial template. 

I am recieving the following error: Invalid field Note_to_Distributor__c for SObject Opportunity. This is the section of the code regarding the error. I am not sure why API Name for Note to Distributor is incorrect?
<apex:repeat var="noteToDis" value="{!relatedTo.Note_to_Distributor__c}">
              <tr>
                <td><a href="https://cs16.salesforce.com/{!noteToDis.id}">View</a> |  
                <a href="https://cs16.salesforce.com/{!noteToDis.id}/e">Edit</a></td>
                <td>{!noteToDis.Note_To_Distributor_Body__c}</td>
                <td>{!noteToDis.CreatedDate)}</td>
              </tr>
         </apex:repeat>

Here is the entire VF Email Template Code:
<messaging:emailTemplate recipientType="Contact"
  relatedToType="Opportunity"
  subject="New Note to Distributor: {!relatedTo.ChannelRequestAuthorization__c}"
  replyTo="pmiprogrammanager@qlogic.com">
  <messaging:htmlEmailBody >
    <html>
      <body>
        <STYLE type="text/css">
          H3 {color: #004488}
          TH {font-size: 13px; font-face: arial; color: #004488; background: #dfdfdf;
               border-width: 1;  text-align: center } 
          TD  {font-size: 11px; font-face: arial } 
          TABLE {border: solid #CCCCCC; border-width: 1}
          TR {border: solid #CCCCCC; border-width: 1}
        </STYLE>
        <font face="arial" size="2">
      <h3>Request:{!relatedTo.ChannelRequestAuthorization__c}- New Note</h3>    
          <p>A new note has been added to the opportunity request. Please see details below. For more information regarding this registration,login into your PMI account and or contact your Qlogic Channel Sales Representative.</p>
          <table border="1" >
            <tr> 
               <th>Request Details</th>
            </tr>
            <tr>    
               <td><b>Channel Authorization Number:</b></td>
           <td>{!relatedTo.ChannelRequestAuthorization__c}</td>
            </tr>
            <tr>    
               <td><b>Distributor:</b></td>
           <td>{!relatedTo.Distributor__r.Name}</td>
           </tr>    
           <tr>
               <td><b>Reseller:</b></td>
           <td>{!relatedTo.Reseller__r.Name}</td>
            </tr>
            <tr>
               <td><b>End User:</b></td>
           <td>{!relatedTo.Account.Name}</td>
            </tr>
            <tr>
              <th>Product List</th><th>Quantity </th>
            </tr>
            <apex:repeat var="opp" value="{!relatedTo.OpportunityLineItems}">
              <tr>
                <td><a href="https://cs16.salesforce.com/{!opp.id}">View</a> |  
                <a href="https://cs16.salesforce.com/{!opp.id}/e">Edit</a></td>
                <td>{!opp.PriceBookEntry.name}</td>
                <td>{!ROUND(opp.Quantity,0)}</td>
              </tr>
         </apex:repeat>  
            <apex:repeat var="noteToDis" value="{!relatedTo.Note_to_Distributor__c}">
              <tr>
                <td><a href="https://cs16.salesforce.com/{!noteToDis.id}">View</a> |  
                <a href="https://cs16.salesforce.com/{!noteToDis.id}/e">Edit</a></td>
                <td>{!noteToDis.Note_To_Distributor_Body__c}</td>
                <td>{!noteToDis.CreatedDate)}</td>
              </tr>
          </apex:repeat>                
       </table>
      <p/>
   </font>
  </body>
 </html>
</messaging:htmlEmailBody>  
</messaging:emailTemplate>

I appreciate the help!

Beth
 
I have a custom button on the Case object. However when the users clicks on the button. The record is not updating.
 
{!REQUIRESCRIPT("/soap/ajax/29.0/connection.js")} 
if("{!Case.Status}" != "Closed"){ 
var record = new sforce.SObject("Case"); 
record.Id = "{!Case.Id}"; 
record.Status= 'Closed'; 
record.Product_Family__c= 'Unknown'; 
record.Product_Model__c= 'Unknown'; 
record.Problem_Code__c= 'Inquiry - Non-Technical'; 
record.Resolution_Code__c= 'Spam'; 
var result = sforce.connection.update([record]); 
} 
// check the result here 
window.location.reload();

 
I am not sure how to write a OnClick JavaScript custom close button on case object.

When the user clicks on this custom button, the following fields need to be updated with the given values.

Fields on case object:
Product Family = Unknown        
Product Model = Unknown
Problem Code = Non-Technical
Resolution Code = Spam
Status = Closed
Resolution Description = Spam
Account Name (lookup field) =  Unclassified Customer – Minnetonka 

Also need to associate the contact to the account; Unclassified Customer – Minnetonka


I appreciate the help!

Beth