• Michal Skuhra
  • NEWBIE
  • 10 Points
  • Member since 2014
  • Anodius a.s.

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 3
    Replies
Hi All,

our next potentional customer is considering buy license for Professional Edition. With enabled feature "Integration via Web Services API" Can I develop Apex Trigger ? Because if not, what sense is about this feature? 

Thanks for answer 
Hi all,

i´ll try describe my problem. I have 2 objects, Standart (Opportunity) and Custom (Point_of_delivery__c). Both have same fields (EIC_code__c, Number_code__c). but value are only in custom object (Point_of_delivery__c).

In Opportunity IF i set  EIC_code__c, then I need retrieve Number_code__c  
FROM custom object Point_od_delivery__c which have right EIC_code__c. 

My code is right. 

trigger T22 on Opportunity (before insert, before update) {
    Opportunity[] opportunity = Trigger.new;

Point_of_delivery__c Number_code;

Number_code = 
[SELECT Number_code__c
FROM  Point_of_delivery__c
WHERE Point_of_delivery__c.EIC_code__c = :opportunity[0].EIC_code__c
LIMIT 1];

opportunity[0].Number_code__c = Number_code.Number_code__c;

}

BUT:
If I set  wrong EIC_code__c which doesnt exist, I have error. I need set default value if Number_code is null. 

Hi All,

our next potentional customer is considering buy license for Professional Edition. With enabled feature "Integration via Web Services API" Can I develop Apex Trigger ? Because if not, what sense is about this feature? 

Thanks for answer 
Hi all,

i´ll try describe my problem. I have 2 objects, Standart (Opportunity) and Custom (Point_of_delivery__c). Both have same fields (EIC_code__c, Number_code__c). but value are only in custom object (Point_of_delivery__c).

In Opportunity IF i set  EIC_code__c, then I need retrieve Number_code__c  
FROM custom object Point_od_delivery__c which have right EIC_code__c. 

My code is right. 

trigger T22 on Opportunity (before insert, before update) {
    Opportunity[] opportunity = Trigger.new;

Point_of_delivery__c Number_code;

Number_code = 
[SELECT Number_code__c
FROM  Point_of_delivery__c
WHERE Point_of_delivery__c.EIC_code__c = :opportunity[0].EIC_code__c
LIMIT 1];

opportunity[0].Number_code__c = Number_code.Number_code__c;

}

BUT:
If I set  wrong EIC_code__c which doesnt exist, I have error. I need set default value if Number_code is null. 

On the SF Quote Page, I see that I can override Create PDF to show my own VIsualForce page. I can also "RenderAs" a PDF. This works as expected.

 

But how can I show my own VisualForce page in the pdfOverlay that is shown when the user clicks "Create PDF" when there is no override. In this case, a standard template is served up on the "pdfOverlay" window, with default buttons (Save to Quote, Save and Email Quote, and Cancel).

 

I want my Visualforce quote document to appear in that window, using those same buttons.

 

Basically, I want to use my own template via a VIsualforce page, rather than the more restrictive Templates available to us via the standard quote templates. The template layout options just don't seem to permit the coplexity I need. For example, it is not possible (I think) to create multi-page Terms & Conditions, and lengthy paragraph language to develop a longer form quotation to the customer.

 

Is there a simple way to reuse that PDF overlay with my own VIsualForce PDF, including the existing "Save to Quote" (etc.) buttons in the PDF Overlay ?

 

This would save me lots of time.

 

P.S. The SF Quote page's HTML source shows the following, which is why I thought pdfOverlay had some relevance:

 

HTML Snippet From SF Quote Page:

 

 

<input value="Create PDF"  class="btn" title="Create PDF" name="createpdf" onclick="null
 var pdfOverlay = QuotePDFPreview.quotePDFObjs['quotePDFOverlay'];pdfOverlay.dialog.buttonContents = '&lt;input value=\&quot;Save to Quote\&quot;  class=\&quot;btn\&quot; name=\&quot;save\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'0\',\'0\');\&quot; title=\&quot;Save to Quote\&quot; type=\&quot;button\&quot; /&gt;&lt;input value=\&quot;Save and Email Quote\&quot;  class=\&quot;btn\&quot; name=\&quot;saveAndEmail\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').savePDF(\'1\');\&quot; title=\&quot;Save and Email Quote\&quot; type=\&quot;button\&quot; /&gt;&lt;input value=\&quot;Cancel\&quot;  class=\&quot;btn\&quot; name=\&quot;cancel\&quot; onclick=\&quot;QuotePDFPreview.getQuotePDFObject(\'quotePDFOverlay\').close();\&quot; title=\&quot;Cancel\&quot; type=\&quot;button\&quot; /&gt;';
pdfOverlay.summlid = '0EHE0000000PCKI';
pdfOverlay.setSavable(true);
pdfOverlay.setContents('/quote/quoteTemplateDataViewer.apexp?id=0Q0E0000000TNLo','/quote/quoteTemplateHeaderData.apexp?id=0Q0E0000000TNLo');
pdfOverlay.display();
" type="button" />

Any advice to get to this solution? 

 

Thanks, Matt