• Adriana Smith 9
  • NEWBIE
  • 25 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 9
    Questions
  • 23
    Replies
Hello, I'm building a trigger that I had at a previous company where an asset is populated on the account, from the listed products on an Opportunity, anytime it is Closed Won.
the trigger is:

trigger CreateAssetonClosedWon on Opportunity (after insert, after update) {
     for(Opportunity o: trigger.new){ 
      if(o.isWon == true && o.HasOpportunityLineItem == true){
         String opptyId = o.Id;
         OpportunityLineItem[] OLI = [Select UnitPrice, Quantity, PricebookEntry.Product2Id, PricebookEntry.Product2.Name, Project_Association__c, Product_Family__c, Product_Category__c, Converted_to_Asset__c  
                                      From OpportunityLineItem 
                                      where OpportunityId = :opptyId  and Converted_to_Asset__c = false];
         Asset[] ast = new Asset[]{};
         Asset a = new Asset();
         for(OpportunityLineItem ol: OLI){
            a = new Asset();
            a.AccountId = o.AccountId;
            a.Product2Id = ol.PricebookEntry.Product2Id;
            a.Quantity = ol.Quantity;
            a.Price =  ol.UnitPrice;
            a.PurchaseDate = o.CloseDate;

The error I'm getting is: Error: Compile Error: expecting right curly bracket, found '<EOF>' at line 17 column 0

I added a curly bracket on line 17, so it pushed the error to line 18.  What am I missing?
We created a custom link on our contacts to convert them to a lead. It opens a new lead page in a new window and fills in the information, but some fields aren't coming over properly. I think it's an issue in my URL. Any help would be appreciated. Specifically, the fields "Institution Type" "Country" and "State/Province" aren't being carried over.

Here's the URL language:

https://na1.salesforce.com/00Q/e?name_salutationlea2={!Contact.Salutation}&name_lastlea2={!Contact.LastName}&name_firstlea2={!Contact.FirstName}&lea8={!Contact.Phone}&lea3={!Account.Name}&lea11={!Contact.Email}&lea4={!Contact.Title}&lea16street={!Contact.MailingAddress}&lea16city={!Contact.MailingCity}&lea16state={!Contact.MailingState}&lea16country={!Contact.MailingCountry}&lea16zip={!Contact.MailingPostalCode}&lea9={!Contact.MobilePhone}&lea10={!Contact.Fax}&lea12={!Account.Website}
I've created a custom object called Invoices, related to Opportunities.  I've added a ton of custom fields, autonumber fields, etc.  What I need is to have a button that says 'create pdf' like how quotes work.  I would also LOVE to have templates so I can play with the pdf.  Pretty much, I need this new invoices custom object to act just like how quotes work.... 

So I don't know where to start....
We need a way to generate invoices on opportunities, and they need to have pretty much the exact same fields as a quote, as well as the ability to create a template, pdf the document, add new custom fields, etc.

Any help would be appreciated.
The below page is triggering the error message of: Enter a URL that is valid and well-formed.  Help?  I've been trying to write this for weeks now :(

<messaging:emailTemplate subject="Pricing Request Submitted" recipientType="User" 
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

<body>

<p> Dear {{!Contact.FirstName}},<p>

<p> {!Opportunity.OwnerFullName} is requesting custom pricing for {!Opportunity.Account}, for his opportunity related to {!Opportunity.Name} .</p>

<p> -Previous Job Number or Publication:<p>
<p> -Quantity:<p>
<p> -Page Count: <p>
<p> -Flat and Finished Size: <p>
<p> -Specific Fold: <p>
<p> -Are there PMS colors? <p>
<p> -Paper Stock/Weight: <p>
<p> -Any Special Features (Die Cut, Gloss, Emboss, etc)? <p>
<p> -Misc. Information: <p>

<p> Thank you! <p>

</body>
</html>
</messaging:htmlemailbody>
</messaging:emailTemplate>
This is triggering an error message below, could you help identify what the issue is?  Trying to create an email when a button is hit.

Error: Request_for_Pricing line 8, column 2: The markup in the document following the root element must be well-formed
Error: The markup in the document following the root element must be well-formed.


<messaging:emailTemplate subject="Pricing Request Submitted" recipientType="User" relatedToType="Opportunity">
<messaging:plainTextEmailBody >
Congratulations!
This is your new Visualforce Email Template.
</messaging:plainTextEmailBody>
</messaging:emailTemplate>

<body>

<p> Dear {!recipient.name},<p>

<p> {!Opportunity.OwnerFullName} is requesting custom pricing for {!Opportunity.Account}, for his opportunity related to {!Opportunity.Name} .</p>

<p> -Previous Job Number or Publication:<p>
<p> -Quantity:<p>
<p> -Page Count: <p>
<p> -Flat and Finished Size: <p>
<p> -Specific Fold: <p>
<p> -Are there PMS colors? <p>
<p> -Paper Stock/Weight: <p>
<p> -Any Special Features (Die Cut, Gloss, Emboss, etc)? <p>
<p> -Misc. Information: <p>

<p> Thank you! <p>

</body>
</html>
</messaging:htmlemailbody>
</messaging:emailTemplate>
I need to send an email to specific users directly from an opportunity.  Ideally, this would be a button named "Request Custom Pricing" that would pop up an email template in another window.  If it could populate the two users that would be great, but at least the template please, with to: fields in it.  Any help doing this would be greatly appreciated, as I'm new to VF or code.....
Need to create a lead from the contact record, where Name, Title, Company, email, and Address information is copied over.  Can someone help create this button?  I'm not sure where to even start.
I need a button on opportunities that requests custom pricing.  When clicked, it should act as a 'send email' button does, but prepopulated with an email template I've already created, and always sent to the same 2 users.... I'm completely new to this, although I've been an admin for about 8 years.  Any help would be appreciated.
Hello, I'm building a trigger that I had at a previous company where an asset is populated on the account, from the listed products on an Opportunity, anytime it is Closed Won.
the trigger is:

trigger CreateAssetonClosedWon on Opportunity (after insert, after update) {
     for(Opportunity o: trigger.new){ 
      if(o.isWon == true && o.HasOpportunityLineItem == true){
         String opptyId = o.Id;
         OpportunityLineItem[] OLI = [Select UnitPrice, Quantity, PricebookEntry.Product2Id, PricebookEntry.Product2.Name, Project_Association__c, Product_Family__c, Product_Category__c, Converted_to_Asset__c  
                                      From OpportunityLineItem 
                                      where OpportunityId = :opptyId  and Converted_to_Asset__c = false];
         Asset[] ast = new Asset[]{};
         Asset a = new Asset();
         for(OpportunityLineItem ol: OLI){
            a = new Asset();
            a.AccountId = o.AccountId;
            a.Product2Id = ol.PricebookEntry.Product2Id;
            a.Quantity = ol.Quantity;
            a.Price =  ol.UnitPrice;
            a.PurchaseDate = o.CloseDate;

The error I'm getting is: Error: Compile Error: expecting right curly bracket, found '<EOF>' at line 17 column 0

I added a curly bracket on line 17, so it pushed the error to line 18.  What am I missing?
I've created a custom object called Invoices, related to Opportunities.  I've added a ton of custom fields, autonumber fields, etc.  What I need is to have a button that says 'create pdf' like how quotes work.  I would also LOVE to have templates so I can play with the pdf.  Pretty much, I need this new invoices custom object to act just like how quotes work.... 

So I don't know where to start....
I need to send an email to specific users directly from an opportunity.  Ideally, this would be a button named "Request Custom Pricing" that would pop up an email template in another window.  If it could populate the two users that would be great, but at least the template please, with to: fields in it.  Any help doing this would be greatly appreciated, as I'm new to VF or code.....
Need to create a lead from the contact record, where Name, Title, Company, email, and Address information is copied over.  Can someone help create this button?  I'm not sure where to even start.