Jump to content

tschulte72

Registered Users - Approved
  • Posts

    2
  • Joined

Converted

  • FusionPro Products
    No

tschulte72's Achievements

Newbie

Newbie (1/14)

  • First Post Rare
  • Week One Done
  • One Month Later
  • One Year In
  • Conversation Starter Rare

Recent Badges

10

Reputation

  1. I really like this script. The issue I'm having is with the orientation of the PDF's I'm trying to insert. Some of the PDF's are set to lanscape and when they are placed in the merge they stay landscaped and get chopped off. Is there a way for this script to force all the PDF's to a portrait orientation?
  2. I recently had a customer who asked for a letter that used an alternate salutation if the member was under 18. ie. Dear Parent or Gaurdian of John Smith, (if under 18) or Dear John Smith, (if over 18) I came up with the following and it seems to work well so I thought I'd share it with anyone who might need something similar. The fuction that calculates the age based on a date uses the format MM/DD/YYYY for the provided birthday. function getAge(birth) { var today = new Date(); var curr_date = today.getDate(); var curr_month = today.getMonth() + 1; var curr_year = today.getFullYear(); var pieces = birth.split('/'); var birth_date = pieces[1]; var birth_month = pieces[0]; var birth_year = pieces[2]; if (curr_month == birth_month && curr_date >= birth_date) return parseInt(curr_year-birth_year); if (curr_month == birth_month && curr_date < birth_date) return parseInt(curr_year-birth_year-1); if (curr_month > birth_month) return parseInt(curr_year-birth_year); if (curr_month < birth_month) return parseInt(curr_year-birth_year-1); } var age = getAge(Field("Birthday")); return (age < 18) ? "Dear Parent or Guardian of " + Field("Name") + "," : "Dear " + Field("Name") + ",";
×
×
  • Create New...