• Ash Jones 10
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 7
    Replies
Hello All,
I have a very basic trigger in sandbox which i want to push it through the production. Without the test class i am getting the 0% code coverage error. Can someone please help me with this?
My Trigger: Order__c (Custom object), i want to update the OwnerId with the value in custome field Owner_Id__c.

trigger UpdateOwner on Orders__c (before insert) {
for (Orders__C a : Trigger.New) {
a.OwnerId = a.Owner_Id__c;
}
}

Thanks.
Hi,
I have created a visual force page called "Create Quote" which gathers data from quote line items and creates a PDF page. I have created a button called "Create Quote" which works fine. I need to add the code so when this button is used, it can create a new attachment under attachments automatically. Can someone help me with this code?
The existing code looks like this.

<apex:page standardController="HPL_Pricing__c" renderAs="pdf" applyBodyTag="false">
<div class="header">
    <center><img src="{!$Resource.Logo}" width="25%"/></center>
    <center>P / N</center>
            </div>
  <apex:pageBlock title="HPL QUOTE REQUEST - {!HPL_Pricing__c.Name}">
Customer Account# <b><u>{!HPL_Pricing__c.Account__c}</u></b> <br/>
Customer Name: <u><b>{!HPL_Pricing__c.Distributor_oem__r.Name}</b></u><br/><br/>
Requested Date: <u><b>{!HPL_Pricing__c.Request_Date__c}</b></u><br/>
Project Information: <b>{!HPL_Pricing__c.Project_Information__c}</b><br/>
Request Type: <u><b>{!HPL_Pricing__c.Request_Type__c}</b></u><br/><br/>
Comments: <b>{!HPL_Pricing__c.Comments__c}</b><br/><br/>
</apex:pageBlock>
<apex:pageBlock title="Quote Information">
    <apex:dataTable value="{!HPL_Pricing__c.OEM_Quote_Line_Item__r}" var="quo" CellPadding="20" border="1">
        <apex:column headerValue="# of Sheets"> 
        <center><apex:outputText value="{!quo.Quantity__c}"/></center>
        </apex:column>
        <apex:column headerValue="Grade">
        <center><apex:outputText value="{!quo.Grade_Product__c}"/></center>
        </apex:column>
        <apex:column headerValue="Current List Price">
        <center><apex:outputText value="{!quo.Current_List_Price__c}"/></center>
        </apex:column>
        <apex:column headerValue="Project Price">
        <center><apex:outputText value="{!quo.Project_Price__c}"/></center>
        </apex:column>
        
            
    
    </apex:dataTable>
</apex:pageBlock>
<br/><br/>

Requested By: {!HPL_Pricing__c.CreatedBy.FirstName} {!HPL_Pricing__c.CreatedBy.LastName}<br/><br/><br/>
<apex:pageBlock title="Approval Comments">
</apex:pageBlock>

<apex:dataTable value="{!HPL_Pricing__c.OEM_Quote_Line_Item__r}" var="app">
 <apex:column >
{!app.Approval_Comments__c}
 </apex:column>
</apex:dataTable><br/><br/>
Approved By: {!HPL_Pricing__c.Approved_By1__c}

</apex:page>
Hello All,
I have a very basic trigger in sandbox which i want to push it through the production. Without the test class i am getting the 0% code coverage error. Can someone please help me with this?
My Trigger: Order__c (Custom object), i want to update the OwnerId with the value in custome field Owner_Id__c.

trigger UpdateOwner on Orders__c (before insert) {
for (Orders__C a : Trigger.New) {
a.OwnerId = a.Owner_Id__c;
}
}

Thanks.
Hi,

I would appreciate if you could suggest me a sample code to automate sending pdf through mail.

So the "Notes and Attachment" related list is present in the custom object "Invoice". Whenever a pdf is uploaded in the "Notes and Attachment", an email should be sent to few people. How do I achieve the same ? 
Hi all,
When custom button in detail page of  custom object is clicked i'm generating the PDF . I want to send the generated PDF as email. Can  we do this...?
Can anyone help me over here.

Thanks in advance.
Hi i am having a custom button,which when clicked generates the PDF and saves it in attachment.
Now i am trying to make it as email too.
so when the custom button is clicked,generate pdf ,save the pdf to attachment and email it to particular user email.

How can i do it?Can i do it on single button?Or do i need two buttons. 1 .generate and save
2.email pdf?
I am confused and struck here .I am able to generate it and save as attachment.
But i want all three steps(generate,save and email) in single button.Please help.
Thanks in advance.
I followed the instructions here: http://rjpalombo.com/2013/11/counting-open-activities-salesforce/

That code works perfectly in my sandbox org and does what it needs. When I try to deploy to production I get the following error:

the following triggers have 0% code coverage. Each trigger must have at least 1% code coverage. OpportunityProductTrigger

The odd thing is that Trigger it refers to in the error  (OpportunityProduct Trigger) shows 100% code coverage and has long existed in the production org. The trigger was created by 1 of our contracted developers. I'm not a developer myself but understand all the basic concepts and slowly trying to learn.