Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Save more on your purchases! discount-offer-chevron-icon
Savings automatically calculated. No voucher code required.
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletter Hub
Free Learning
Arrow right icon
timer SALE ENDS IN
0 Days
:
00 Hours
:
00 Minutes
:
00 Seconds
Visualforce Development Cookbook
Visualforce Development Cookbook

Visualforce Development Cookbook: For developers who already know the basics of Visualforce, this book enables you to advance to the next level. With over 75 real-world examples accompanied by stacks of illustrations, it clarifies even the most complex concepts.

eBook
$28.99 $32.99
Paperback
$54.99
Subscription
Free Trial
Renews at $19.99p/m

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Table of content icon View table of contents Preview book icon Preview Book

Visualforce Development Cookbook

Chapter 1. General Utilities

In this chapter, we will cover the following recipes:

  • Overriding standard buttons

  • Data-driven styling

  • Turning off an action poller

  • Visualforce in the sidebar

  • Passing parameters to action methods

  • Reacting to URL parameters

  • Passing parameters between Visualforce pages

  • Opening a pop-up window

  • Adding a launch page

  • Testing a custom controller

  • Testing a controller extension

Introduction


This chapter provides solutions for a variety of situations that Visualforce developers are likely to encounter on a regular basis. Enhancing or replacing standard functionality with Visualforce enriches the user experience, improving user productivity and adoption. Visualforce also allows business processes to be highly systemized, guiding users through the creation and the ongoing management of data. Writing effective tests for Visualforce controllers is a key skill that allows developers to deploy Visualforce pages to production, and be confident that they will work as intended.

Overriding standard buttons


Two common complaints from users are that the information they are interested in requires a number of clicks to access, or that there is too much information on a single page, resulting in a cluttered layout that requires significant scrolling. This is an area where a Visualforce override can make a significant difference by traversing relationships to display information from a number of records on a single page.

Salesforce allows the standard pages associated with sObject record actions, such as view and edit, to be overridden with Visualforce pages. This is typically used to display the record in a branded or customized format; for example, to display the details and related lists in separate tabs.

In this recipe, we will override the standard page associated with viewing an account record with a Visualforce page that not only provides a tabbed user interface, but also lifts up additional activity information from the related contact list and line item information from the related opportunity lists. Further, the related opportunities displayed will be limited to those which are open.

Note

Only Visualforce pages that use the standard controller for the sObject can override standard pages.

Getting ready

This recipe makes use of a standard controller, so we only need to create the Visualforce page.

How to do it…

  1. Navigate to the Visualforce setup page by clicking on Your Name | Setup | Develop | Pages.

  2. Click on the New button.

  3. Enter AccViewOverride in the Label field.

  4. Accept the default AccViewOverride that is automatically generated for the Name field.

  5. Paste the contents of the AccViewOverride.page file from the code download into the Visualforce Markup area and click on the Save button.

  6. Then, navigate to the Visualforce setup page by clicking on Your Name | Setup | Develop | Pages.

  7. Locate the entry for the AccViewOverride page and click on the Security link.

  8. On the resulting page, select which profiles should have access and click on the Save button.

    Note

    As the record view override applies to all users, ensure that all profiles are given access to the Visualforce page. Any user with a profile that does not have access will receive an Insufficient Privileges error when attempting to view an account record.

  9. Now that the Visualforce page is complete, configure the account view override. Navigate to Your Name | Setup | Customize | Accounts | Buttons, Links and Actions.

  10. Locate the View entry on the resulting page and click on the Edit link.

  11. On the following page, locate the Override With entry, check the Visualforce Page radio button, and choose AccViewOverride from the list of available pages.

  12. Click on the Save button.

How it works…

When a user clicks on an account record link anywhere in Salesforce, the tabbed page with details from related records is displayed, as shown in the following screenshot:

The key areas of the code are the tabs for the related records. The Open Opportunities tab iterates the opportunities related list, and generates an <apex:pageblock /> for each opportunity that is currently open by encapsulating this inside a conditionally rendered <apex:outputPanel />.

<apex:repeat value="{!Account.Opportunities}" var="opp">
  <apex:outputPanel rendered="{!NOT(opp.IsClosed)}">
    <apex:pageBlock title="{!opp.Name}">

Then, the standard <apex:relatedList /> component is used to generate the opportunity product list by specifying the current value of the opportunity iterator as the subject of the component.

 <apex:relatedList subject="{!opp}" list="OpportunityLineItems" />

Data-driven styling


A useful technique when creating a custom user interface with Visualforce is to conditionally style important pieces of information to draw the user's attention to them as soon as a page is rendered.

Most Visualforce developers are familiar with using merge fields to provide sObject field values to output tags, or to decide if a section of a page should be rendered. In the tag shown below, the merge field, {!account.Name}, will be replaced with the contents of the name field from the account sObject:

<apex:outputField value="{!account.Name}"/>

Merge fields can also contain formula operators and be used to dynamically style data when it is displayed.

In this recipe we will display a table of campaign records and style the campaign cost in green if it was within budget, or red if it was over budget.

How to do it…

  1. Navigate to the Visualforce setup page by clicking on Your Name | Setup | Develop | Pages.

  2. Click on the New button.

  3. Enter ConditionalColour in the Label field.

  4. Accept the default ConditionalColour that is automatically generated for the Name field.

  5. Paste the contents of the ConditionalColour.page file from the code download into the Visualforce Markup area and click on the Save button.

  6. Click on the Save button to save the page.

  7. Navigate to the Visualforce setup page by clicking on Your Name | Setup | Develop | Pages.

  8. Locate the entry for the ConditionalColour page and click on the Security link.

  9. On the resulting page, select which profiles should have access and click on the Save button.

How it works…

Opening the following URL in your browser displays the ConditionalColour page: https://<instance>/apex/ConditionalColour. Here, <instance> is the Salesforce instance specific to your organization, for example, na6.salesforce.com.

A list of campaigns is displayed, with the campaign cost rendered in red or green depending on whether it came in on or over budget.

Conditional styling is applied to the Actual Cost column by comparing the actual cost with the budgeted cost.

<apex:column style="color:
   {!IF(AND(NOT(ISNULL(campaign.ActualCost)), 
   campaign.ActualCost<=campaign.BudgetedCost), 
  "lawngreen", "red")}" value="{!campaign.ActualCost}"/>

See also

  • The Data-driven decimal places recipe in Chapter 2, Custom Components shows how to format numeric values to a specified number of decimal places.

Turning off an action poller


The standard Visualforce <apex:actionPoller/> component sends AJAX requests to the server based on the specified time interval. An example use case is a countdown timer that sends the user to another page when the timer expires. But what if the action poller should stop when a condition in the controller becomes true, for example, when a batch apex job completes or an update is received from a third-party system?

In this recipe, we will simulate the progression of a payment through a number of states. An action poller will be used to retrieve the latest state from the server and display it to the user. Once the payment reaches the state Complete, the action poller will be disabled.

Getting ready

This recipe makes use of a custom controller, so this will need to be created before the Visualforce page.

How to do it…

  1. Navigate to the Apex Classes setup page by clicking on Your Name | Setup | Develop | Apex Classes.

  2. Click on the New button.

  3. Paste the contents of the PollerController.cls Apex class from the code download into the Apex Class area.

    Tip

    Note that there is nowhere to specify a name for the class when creating through the setup pages; the class name is derived from the Apex code.

  4. Click on the Save button.

  5. Next, create the Visualforce page by navigating to the Visualforce setup page by clicking on Your Name | Setup | Develop | Pages.

  6. Click on the New button.

  7. Enter ActionPoller in the Label field.

  8. Accept the default ActionPoller that is automatically generated for the Name field.

  9. Paste the contents of the ActionPoller.page file from the code download into the Visualforce Markup area.

  10. Click on the Save button to save the page.

  11. Navigate to the Visualforce setup page by clicking on Your Name | Setup | Develop | Pages.

  12. Locate the entry for the ActionPoller page and click on the Security link.

  13. On the resulting page, select which profiles should have access and click on the Save button.

How it works…

Opening the following URL in your browser displays the ActionPoller page: https://<instance>/apex/ActionPoller.

Here, <instance> is the Salesforce instance specific to your organization, for example, na6.salesforce.com.

The page polls the server for the current state, displaying the message Polling … when the action poller executes as shown in the following screenshot:

Once the current state reaches Complete, the action poller terminates.

The key to this recipe is the enabled attribute on the actionPoller component.

<apex:actionPoller action="{!movePayment}" 
     rerender="payment" interval="5" status="status" 
     enabled="{!paymentState!='Complete'}"/>

Tip

Downloading the example code

You can download the example code files for all Packt books you have purchased from your account at http://www.packtpub.com. If you purchased this book elsewhere, you can visit http://www.packtpub.com/support and register to have the files e-mailed directly to you.

This merge field references the paymentState property from the custom controller, which is evaluated each time the action poller executes until it becomes false. At this time the action poller is permanently disabled.

The Polling … message is generated by the actionStatus component associated with the action poller. This component has a startText attribute but not a stopText attribute, which means that the text will only be displayed while the AJAX request is in progress.

<apex:actionStatus startText="Polling ..." id="status"/>

See also

  • The Using action functions recipe in Chapter 7, JavaScript shows how to execute a controller.

Visualforce in the sidebar


Visualforce is commonly used to produce custom pages that override or supplement standard platform functionality. Visualforce pages can also be incorporated into any HTML markup through use of an iframe.

Note

An iframe, or inline frame, nests an HTML document inside another HTML document. For more information, visit http://reference.sitepoint.com/html/iframe.

In this recipe, we will add a Visualforce page to a Salesforce sidebar component. This page will display the number of currently open cases in the organization, and will be styled and sized to fit seamlessly into the sidebar.

Getting ready

This recipe makes use of a custom controller, so this will need to be created before the Visualforce page.

How to do it…

  1. Navigate to the Apex Classes setup page by clicking on Your Name | Setup | Develop | Apex Classes.

  2. Click on the New button.

  3. Paste the contents of the CasesSidebarController.cls Apex class from the code download into the Apex Class area.

  4. Next, create the Visualforce page by navigating to the Visualforce setup page by clicking on Your Name | Setup | Develop | Pages.

  5. Click on the New button.

  6. Enter CasesSidebar in the Label field.

  7. Accept the default CasesSidebar that is automatically generated for the Name field.

  8. Paste the contents of the CasesSidebar.page file from the code download into the Visualforce Markup area.

  9. Click on the Save button to save the page.

  10. Navigate to the Visualforce setup page by clicking on Your Name | Setup | Develop | Pages.

  11. Locate the entry for the CasesSidebar page and click on the Security link.

  12. On the resulting page, select which profiles should have access and click on the Save button.

    Note

    Ensure that all profiles whose sidebar will display the Visualforce page are given access. Any user with a profile that does not have access will see an Insufficient Privileges error in their sidebar.

  13. Next, create the home page component by navigating to the Home Page Components setup page by clicking on Your Name | Setup | Customize | Home | Home Page Components.

  14. Scroll down to the Custom Components section and click on the New button.

  15. If the Understanding Custom Components information screen appears, as shown in the following screenshot, click on the Next button.

    Tip

    To stop this information screen appearing each time you create a home page component, select the Don't show this page again box before clicking on the Next button.

  16. On the next page, Step 1. New Custom Components, enter Case Count by Status in the Name field, select the HTML Area option, and click on the Next button.

  17. On the next page, Step 2. New Custom Components, select the Narrow (Left) Column option.

  18. Select the Show HTML box.

  19. Paste the following markup into the editable area:

    <iframe style="border: none" src="/apex/CasesSidebar"  seamless=""></iframe>
  20. Click on the Save button.

  21. Next, add the new component to one or more home page layouts. Navigate to Your Name | Setup | Customize | Home | Home Page Layouts.

  22. Locate the name of the home page layout you wish to add the component to and click on the Edit link.

  23. On the resulting page, Step 1. Select the Components to show, select the Case Count by Status box in the Select Narrow Components to Show section and click on the Next button.

  24. On the next page, Step 2. Order the Components, use the arrow buttons to move the Case Count by Status component to the desired position in the Narrow (Left) Column list and click on the Save button.

  25. Repeat steps 22 to 24 for any other home page layouts that will contain the sidebar component.

    Tip

    This will add the component to the sidebar of the home page only. To add it to the sidebar of all pages, a change must be made to the user interface settings.

  26. Navigate to Your Name | Setup | Customize | User Interface and locate the Sidebar section.

  27. Select the Show Custom Sidebar Components on All Pages box as shown in the following screenshot, and click on the Save button.

How it works…

The component appears in the sidebar on all pages, showing the number of cases open for each nonclosed status, as shown in the following screenshot:

There's more…

The case counts displayed in the sidebar will be retrieved when the page is displayed, but will remain static from that point. An action poller can be used to automatically refresh the counts at regular intervals. However, this will introduce a security risk, as each time the poller retrieves the updated information it will refresh the user's session. This means that if a user were to leave their workstation unattended, the Salesforce session will never expire. If this mechanism is used, it is important to remind users of the importance of locking their workstation should they leave it unattended.

Left arrow icon Right arrow icon
Download code icon Download Code

Key benefits

  • Provide an enhanced user experience with dynamically generated, reactive pages
  • Access data over additional channels via public web sites and mobile pages
  • Packed with easy to follow recipes, including step-by-step instructions and Apex/Visualforce code downloads

Description

Visualforce, in conjunction with Apex, makes it easy to develop sophisticated, custom UIs for Force.com desktop and mobile apps without having to write thousands of lines of code and markup. The "Dynamic Binding" feature of Visualforce lets you develop generic Visualforce pages to display information related to the records without necessarily knowing which data fields to show. This is accomplished through a formula-like syntax, which makes it simple to manage even a complex hierarchy of records. "Visualforce Development Cookbook" provides solutions for a variety of challenges faced by Salesforce developers and demonstrates how easy it is to build rich, interactive pages using Visualforce. Whether you are looking to make a minor addition to the standard page functionality or override it completely, this book will provide you with the required help throughout. "Visualforce Development Cookbook" starts with explaining the simple utilities and builds up to advanced techniques for data visualization and reuse of functionality. This book contains recipes that cover various topics like creating multiple records from a single page, visualizing data as charts, using JavaScript to enhance client-side functionality, building a public website and making data available to a mobile device. "Visualforce Development Cookbook" provides lots of practical examples to enhance and extend the Salesforce user interface.

Who is this book for?

"Visualforce Development Cookbook" is aimed at developers who have already grasped the basics of Visualforce. Awareness of the standard component library and the purpose of controllers is expected.

What you will learn

  • Write effective controller tests
  • Maintain multiple records from a single page
  • Produce re-usable components for utility functions
  • Create custom charts to visualize single or multiple sets of data
  • Redraw part of a page in response to user input
  • Replace standard components with custom, brandable versions
  • Provide access to data via a public website
  • Allow users to create and retrieve data from a mobile device
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Country selected
Publication date, Length, Edition, Language, ISBN-13
Publication date : Sep 24, 2013
Length: 334 pages
Edition : 1st
Language : English
ISBN-13 : 9781782170808
Vendor :
Salesforce
Languages :
Tools :

What do you get with Print?

Product feature icon Instant access to your digital copy whilst your Print order is Shipped
Product feature icon Paperback book shipped to your preferred address
Product feature icon Redeem a companion digital copy on all Print orders
Product feature icon Access this title in our online reader with advanced features
Product feature icon DRM FREE - Read whenever, wherever and however you want
OR
Modal Close icon
Payment Processing...
tick Completed

Shipping Address

Billing Address

Shipping Methods
Estimated delivery fee Deliver to United States

Economy delivery 10 - 13 business days

Free $6.95

Premium delivery 6 - 9 business days

$21.95
(Includes tracking information)

Product Details

Publication date : Sep 24, 2013
Length: 334 pages
Edition : 1st
Language : English
ISBN-13 : 9781782170808
Vendor :
Salesforce
Languages :
Tools :

Packt Subscriptions

See our plans and pricing
Modal Close icon
$19.99 billed monthly
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Simple pricing, no contract
$199.99 billed annually
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts
$279.99 billed in 18 months
Feature tick icon Unlimited access to Packt's library of 7,000+ practical books and videos
Feature tick icon Constantly refreshed with 50+ new titles a month
Feature tick icon Exclusive Early access to books as they're written
Feature tick icon Solve problems while you work with advanced search and reference features
Feature tick icon Offline reading on the mobile app
Feature tick icon Choose a DRM-free eBook or Video every month to keep
Feature tick icon PLUS own as many other DRM-free eBooks or Videos as you like for just $5 each
Feature tick icon Exclusive print discounts

Frequently bought together


Stars icon
Total $ 115.98
Visualforce Development Cookbook
$54.99
Salesforce CRM: The Definitive Admin Handbook - Second Edition
$60.99
Total $ 115.98 Stars icon

Table of Contents

9 Chapters
General Utilities Chevron down icon Chevron up icon
Custom Components Chevron down icon Chevron up icon
Capturing Data Using Forms Chevron down icon Chevron up icon
Managing Records Chevron down icon Chevron up icon
Managing Multiple Records Chevron down icon Chevron up icon
Visualforce Charts Chevron down icon Chevron up icon
JavaScript Chevron down icon Chevron up icon
Force.com Sites Chevron down icon Chevron up icon
jQuery Mobile Chevron down icon Chevron up icon

Customer reviews

Top Reviews
Rating distribution
Full star icon Full star icon Full star icon Full star icon Half star icon 4.4
(7 Ratings)
5 star 42.9%
4 star 57.1%
3 star 0%
2 star 0%
1 star 0%
Filter icon Filter
Top Reviews

Filter reviews by




Sara Morgan Nettles Nov 18, 2013
Full star icon Full star icon Full star icon Full star icon Full star icon 5
The code recipes are great and could really go far in demonstrating the potential of the platform. It is obvious that the author has implemented many, if not all of these recipes in real-world scenarios. However, I think this may be a dangerous book for developers new to the Force.com platform. In fact, I would not recommend it to anyone who has not worked with the platform for at least one year.The sample code that was provided was easy to download and well organized. It was also formatted properly so that you could cut and paste it straight into your development org. Very little sample code is included in the actual book, which I think helps to ensure that the book stays up to date. As long as the publisher and author continue to update the sample code with each new Salesforce release, the code should stay viable as the platform inevitably changes.I REALLY liked the chapters on JavaScript and jQuery Mobile and cannot wait to try out some of the recipes included for my clients. In short, this is an invaluable resource for seasoned Force.com developers, but should be approached with caution for newbies.
Amazon Verified review Amazon
harish May 11, 2015
Full star icon Full star icon Full star icon Full star icon Full star icon 5
I book that guides to grow as an advanced Visual Force developer.
Amazon Verified review Amazon
Sarabdeep Oct 24, 2016
Full star icon Full star icon Full star icon Full star icon Full star icon 5
A must have for an intermediate to advanced Visualforce developer. I have come across the use cases in my earlier projects and would have really loved to have this book earlier.
Amazon Verified review Amazon
talkinghead Jan 14, 2015
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
As a long time SF consultant and developer, I found this book full of VERY useful code snippets. However, the companies website for downloading the code samples is terrible. If they would solve this problem, I'd give the book 5 stars. I'm only giving it 4 stars since without the full code samples you'll have to guess at a lot.
Amazon Verified review Amazon
Mona Jan 06, 2014
Full star icon Full star icon Full star icon Full star icon Empty star icon 4
If you are a developer who wants to know the nuts and bolts of Visualforce Pages then DONT refer to this book immediately. Visualforce developer guide will be a better book for you. However, if you do have some programming experience in VisualForce, then this book does its job extremely well. Its a book which is like a pocket dictionary to have for seasoned Visualforce Developers.The sample code that was provided was easy to download and well organized.Chapters 6,7,8 and 9 are simply great. Even though I have worked a lot on Visualforce page there are certain areas on Visualforce Charts and Javascript which were new to me as well. So as a cookbook this book does the job very well.
Amazon Verified review Amazon
Get free access to Packt library with over 7500+ books and video courses for 7 days!
Start Free Trial

FAQs

What is the digital copy I get with my Print order? Chevron down icon Chevron up icon

When you buy any Print edition of our Books, you can redeem (for free) the eBook edition of the Print Book you’ve purchased. This gives you instant access to your book when you make an order via PDF, EPUB or our online Reader experience.

What is the delivery time and cost of print book? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela
What is custom duty/charge? Chevron down icon Chevron up icon

Customs duty are charges levied on goods when they cross international borders. It is a tax that is imposed on imported goods. These duties are charged by special authorities and bodies created by local governments and are meant to protect local industries, economies, and businesses.

Do I have to pay customs charges for the print book order? Chevron down icon Chevron up icon

The orders shipped to the countries that are listed under EU27 will not bear custom charges. They are paid by Packt as part of the order.

List of EU27 countries: www.gov.uk/eu-eea:

A custom duty or localized taxes may be applicable on the shipment and would be charged by the recipient country outside of the EU27 which should be paid by the customer and these duties are not included in the shipping charges been charged on the order.

How do I know my custom duty charges? Chevron down icon Chevron up icon

The amount of duty payable varies greatly depending on the imported goods, the country of origin and several other factors like the total invoice amount or dimensions like weight, and other such criteria applicable in your country.

For example:

  • If you live in Mexico, and the declared value of your ordered items is over $ 50, for you to receive a package, you will have to pay additional import tax of 19% which will be $ 9.50 to the courier service.
  • Whereas if you live in Turkey, and the declared value of your ordered items is over € 22, for you to receive a package, you will have to pay additional import tax of 18% which will be € 3.96 to the courier service.
How can I cancel my order? Chevron down icon Chevron up icon

Cancellation Policy for Published Printed Books:

You can cancel any order within 1 hour of placing the order. Simply contact customercare@packt.com with your order details or payment transaction id. If your order has already started the shipment process, we will do our best to stop it. However, if it is already on the way to you then when you receive it, you can contact us at customercare@packt.com using the returns and refund process.

Please understand that Packt Publishing cannot provide refunds or cancel any order except for the cases described in our Return Policy (i.e. Packt Publishing agrees to replace your printed book because it arrives damaged or material defect in book), Packt Publishing will not accept returns.

What is your returns and refunds policy? Chevron down icon Chevron up icon

Return Policy:

We want you to be happy with your purchase from Packtpub.com. We will not hassle you with returning print books to us. If the print book you receive from us is incorrect, damaged, doesn't work or is unacceptably late, please contact Customer Relations Team on customercare@packt.com with the order number and issue details as explained below:

  1. If you ordered (eBook, Video or Print Book) incorrectly or accidentally, please contact Customer Relations Team on customercare@packt.com within one hour of placing the order and we will replace/refund you the item cost.
  2. Sadly, if your eBook or Video file is faulty or a fault occurs during the eBook or Video being made available to you, i.e. during download then you should contact Customer Relations Team within 14 days of purchase on customercare@packt.com who will be able to resolve this issue for you.
  3. You will have a choice of replacement or refund of the problem items.(damaged, defective or incorrect)
  4. Once Customer Care Team confirms that you will be refunded, you should receive the refund within 10 to 12 working days.
  5. If you are only requesting a refund of one book from a multiple order, then we will refund you the appropriate single item.
  6. Where the items were shipped under a free shipping offer, there will be no shipping costs to refund.

On the off chance your printed book arrives damaged, with book material defect, contact our Customer Relation Team on customercare@packt.com within 14 days of receipt of the book with appropriate evidence of damage and we will work with you to secure a replacement copy, if necessary. Please note that each printed book you order from us is individually made by Packt's professional book-printing partner which is on a print-on-demand basis.

What tax is charged? Chevron down icon Chevron up icon

Currently, no tax is charged on the purchase of any print book (subject to change based on the laws and regulations). A localized VAT fee is charged only to our European and UK customers on eBooks, Video and subscriptions that they buy. GST is charged to Indian customers for eBooks and video purchases.

What payment methods can I use? Chevron down icon Chevron up icon

You can pay with the following card types:

  1. Visa Debit
  2. Visa Credit
  3. MasterCard
  4. PayPal
What is the delivery time and cost of print books? Chevron down icon Chevron up icon

Shipping Details

USA:

'

Economy: Delivery to most addresses in the US within 10-15 business days

Premium: Trackable Delivery to most addresses in the US within 3-8 business days

UK:

Economy: Delivery to most addresses in the U.K. within 7-9 business days.
Shipments are not trackable

Premium: Trackable delivery to most addresses in the U.K. within 3-4 business days!
Add one extra business day for deliveries to Northern Ireland and Scottish Highlands and islands

EU:

Premium: Trackable delivery to most EU destinations within 4-9 business days.

Australia:

Economy: Can deliver to P. O. Boxes and private residences.
Trackable service with delivery to addresses in Australia only.
Delivery time ranges from 7-9 business days for VIC and 8-10 business days for Interstate metro
Delivery time is up to 15 business days for remote areas of WA, NT & QLD.

Premium: Delivery to addresses in Australia only
Trackable delivery to most P. O. Boxes and private residences in Australia within 4-5 days based on the distance to a destination following dispatch.

India:

Premium: Delivery to most Indian addresses within 5-6 business days

Rest of the World:

Premium: Countries in the American continent: Trackable delivery to most countries within 4-7 business days

Asia:

Premium: Delivery to most Asian addresses within 5-9 business days

Disclaimer:
All orders received before 5 PM U.K time would start printing from the next business day. So the estimated delivery times start from the next day as well. Orders received after 5 PM U.K time (in our internal systems) on a business day or anytime on the weekend will begin printing the second to next business day. For example, an order placed at 11 AM today will begin printing tomorrow, whereas an order placed at 9 PM tonight will begin printing the day after tomorrow.


Unfortunately, due to several restrictions, we are unable to ship to the following countries:

  1. Afghanistan
  2. American Samoa
  3. Belarus
  4. Brunei Darussalam
  5. Central African Republic
  6. The Democratic Republic of Congo
  7. Eritrea
  8. Guinea-bissau
  9. Iran
  10. Lebanon
  11. Libiya Arab Jamahriya
  12. Somalia
  13. Sudan
  14. Russian Federation
  15. Syrian Arab Republic
  16. Ukraine
  17. Venezuela