• DomeForce
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 0
    Replies

Totally new to code, I am trying to integrate DYMO LabelWriter Printer into Salesforce.com

 

The direction say to paste the follow code into the page editior:

 

<apex:page id="printAddressPage" standardController="Contact" extensions="PrintAddressExtension">
    <apex:includeScript value="{!$Resource.DymoFramework}"/>

    <div style="padding-bottom:6px">
        <apex:outputLink value="{!URLFOR($Action.Contact.View, $CurrentPage.parameters.id)}">
            Back to {!paObject.Contact.FirstName} {!paObject.Contact.LastName} detail page
        </apex:outputLink>
    </div>

    <apex:form >
    </apex:form>

</apex:page>

 

The next intruction says to create a singleton: paObject, but were in the above code to paste the following:

 

 

public class PrintAddressExtension

{

public PrintAddressExtension(ApexPages.StandardController controller)

{

 }

public class PaObject

{

private Contact m_contact; public PaObject() { Id id = System.currentPageReference().getParameters().get('id'); m_contact = id == null ? new Contact() : [Select Id, FirstName, LastName, MailingStreet, MailingCity, MailingState, MailingCountry, MailingPostalCode FROM Contact WHERE Id = :id]; } public Contact getContact() { return m_contact; } // contact full name public String getContactFullName() { if (m_contact == null) { system.Debug(logginglevel.ERROR, 'PaObject.m_contact is null'); return ''; } return m_contact.LastName + ', ' + m_contact.FirstName; } } private paObject m_paObject; public PaObject getPaObject() { if (m_paObject == null) { m_paObject = new PaObject(); System.debug(logginglevel.INFO, 'singleton PaObject is created'); } return m_paObject; } }