Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Table of Contents
minLevel1
maxLevel7
outlinetrue

...

Merge Document (Doc template)

Jarvis (Apsona) - Field Mapping

Date

«ReceiptDate»

Heading

«IF CareOf»«AccountName»

«ELSE IF AccrecordType !="Household"»

«AccountName»«ENDIF»

«IF CareOf»Care Of: «CareOf»

«ELSE IF Deceased»Sir/Madam

«ELSE IF LegalCreditCheckLess100Greater0»

«IF PSalutation»«PSalutation»«ENDIF»

«PFirstName» «PLastName»«IF PSuffix»«PSuffix»«ENDIF»

and «IFSSalutation»«SSalutation»«ENDIF»

«SFirstName» «SLastName»«IF SSuffix» «SSuffix»«ENDIF»

«ELSE IF LegalCreditCheck100»

«IF LegalCreditSalutation»«LegalCreditSalutation»«ENDIF»

«LegalCreditFirstName» «LegalCreditLastName»

«IF LegalCreditSuffix» «LegalCreditSuffix»«ENDIF»«ENDIF»

«IF MailingLine1»«MailingLine1»«ENDIF»

«IF MailingLine2»«MailingLine2»«ENDIF»

«IF MailingLine3»«MailingLine3»«ENDIF»

«IF City»«City»«ENDIF» «State» «PostCode»

«Country»

  • "CareOf":"Receipt____AQB__AccountId__c___USYD_Receipting_Care_of__c"

  • "AccrecordType":"Account____RecordTypeId"

  • "AccountName":"Receipt____AQB__AccountId__c___Name"

  • "Deceased":"Receipt____AQB__ContactId__c___AQB__Deceased__c"

  • "LegalCreditCheckLess100Greater0":"Calculated_Steps____>0<100"
    where >0<100 :
    ({!Gift Recognition Credit.Gift Recognition Credit.Legal Credit %} > 0) &&
    ({!Gift Recognition Credit.Gift Recognition Credit.Legal Credit %} < 100) ? "PS" : ""

  • "LegalCreditCheck100": "Calculated_Steps____100%"
    where 100% :
    ({!Gift Recognition Credit.Gift Recognition Credit.Legal Credit %}==100) ? "C" : ""

  • "PSalutation": "Account____AQB__PrimaryContact__c___Salutation"

  • "PFirstName": "Account____AQB__PrimaryContact__c___FirstName"

  • "PLastName": "Account____AQB__PrimaryContact__c___LastName"

  • "PSuffix": "Account____AQB__PrimaryContact__c___Suffix"

  • "SSalutation": "Account____AQB__SecondaryContact__c___Salutation"

  • "SFirstName": "Account____AQB__SecondaryContact__c___FirstName"

  • "SLastName": "Account____AQB__SecondaryContact__c___LastName"

  • "SSuffix": "Account____AQB__SecondaryContact__c___Suffix"

  • "LegalCreditSalutation": "Gift_Recognition_Credit____AQB__ContactId__c___Salutation"

  • "LegalCreditFirstName": "Gift_Recognition_Credit____AQB__ContactId__c___FirstName"

  • "LegalCreditLastName": "Gift_Recognition_Credit____AQB__ContactId__c___LastName"

  • "LegalCreditSuffix": "Gift_Recognition_Credit____AQB__ContactId__c___Suffix"

  • "MailingLine1": "Receipt____AQB__AccountId__c___AQB__AccountMailingStreetLineOne__c"

  • "MailingLine2": "Receipt____AQB__AccountId__c___AQB__AccountMailingStreetLineTwo__c"

  • "MailingLine3": "Receipt____AQB__AccountId__c___AQB__AccountMailingStreetLineThree__c"

  • "City": "Receipt____AQB__AccountId__c___BillingCity"

  • "State": "Receipt____AQB__AccountId__c___BillingState"

  • "PostCode": "Receipt____AQB__AccountId__c___BillingPostalCode"

Salutation

«SalutationJava»

Code Block
languagejs
(function () {
    
	// define all  merge fields to be used as variables for shorter reference
	var accountType = {!Account.Account.Account Type};
	    var grclc = {!Gift Recognition Credit.Gift Recognition Credit.Legal Credit %};
	
    
    var PLastName = {!Account.Primary Contact.Last Name} ? {!Account.Primary Contact.Last Name} : "";
    	var PFirstName = {!Account.Primary Contact.First Name} ? {!Account.Primary Contact.First Name} : "";
	
    
    var SLastName = {!Account.Secondary Contact.Last Name} ? {!Account.Secondary Contact.Last Name} : "";
    	var SFirstName = {!Account.Secondary Contact.First Name} ? {!Account.Secondary Contact.First Name} : "";
	
    
    var salutation1 = {!Account.Primary Contact.Salutation} ? {!Account.Primary Contact.Salutation} : "";
    	var salutation2 = {!Account.Secondary Contact.Salutation} ? {!Account.Secondary Contact.Salutation} : "";
	
    
    var careof = {!Receipt.Account.Receipting Care of};
  	  	var method = 0;
//	
Dear	var SalutationPstandaloneSal += First Name + Last Name
	if ((PLastName != "" && salutation1 == "") || (SLastName != "" && salutation2 == "")){
		if ((PFirstName != "" && PFirstName.length > 1) || (SFirstName != "" && SFirstName.length > 1 )){
			method = 1; // Dear First Name
		} else {
			method = 2; // Dear Supporter
		}
	}
	if ((accountType == 'Household') && (grclc < 100) && (PLastName == SLastName)) {
			switch(method){	
				case 1:
					return (PFirstName + " " + "and" + " " + SFirstName + " " + SLastName);
					break;
				case 2:
					return ("Supporter");
					break;
				default:
					return (salutation1 + " " + "and" + " " + salutation2 + " " + SLastName);
			}
	} else if ((accountType == 'Household') && (grclc < 100) &&  (PLastName != SLastName)) {
				switch(method){
					case 1:
						return (PFirstName + " " + "and" + " " + SFirstName);
						break;
					case 2:
						return ("Supporter");
						break;
					default:
						return (salutation1 + " " + PLastName + " " + "and" + " " + salutation2 + " " + SLastName);
				}
			} else if ((accountType != 'Household') && (careof)){
					return ({!Receipt.Account.Receipting Care of});						
				} else if ((accountType != 'Household')){
							return ("Sir/ Madam");
				} else if ((grclc == 100)){
					
						switch(method){	
							case 1:
								return (PFirstName);
								break;
							case 2:
								return ("Supporter");
								break;
							default:
								return (salutation1 + " " + PLastName);
						}						
				} else {
					return "";
				}
{!Contact Primary.Salutation Link.Standalone Salutation};
	var SstandaloneSal = {!Contact Secondary.Salutation Link.Standalone Salutation};
	
	// if standalone salutation, don't print the names
	if (PstandaloneSal) {
		PLastName = "";
		PFirstName = "";
	}
	
	// if standalone salutation, don't print the names
	if (SstandaloneSal) {
		SLastName = "";
		SFirstName = "";
	}
    
    if (grclc == 100) {
		// only one contact gets legal credit, we get the first GRC record and the credit contact of that GRC Record
        PLastName = {!Gift Recognition Credit.Contact Credited.Last Name} ? {!Gift Recognition Credit.Contact Credited.Last Name} : "";
        PFirstName = {!Gift Recognition Credit.Contact Credited.First Name} ? {!Gift Recognition Credit.Contact Credited.First Name} : "";
        
		// if standalone salutation, don't print the names
		if (PstandaloneSal) {
			PLastName = "";
			PFirstName = "";
		}
		
        salutation1 = {!Gift Recognition Credit.Contact Credited.Salutation} ? {!Gift Recognition Credit.Contact Credited.Salutation} : "";
        
		// second contact is blank
		salutation2 = "";
        
        SLastName = "";
        SFirstName = "";
    }

    
    // set the Method if no salutation to either of the two contacts, use first name or Supporter
	if ((PLastName != "" && salutation1 == "") || (SLastName != "" && salutation2 == "")){
        if (PFirstName != "" && PFirstName.length > 1 && SFirstName == ""){ // one contact, first name is not one character, 
            method = 1; // use first name
        } else if (PFirstName != "" && PFirstName.length > 1 && SFirstName != "" && SFirstName.length > 1){ // two contacts, first name is not one character
            method = 1; // use first name for both contacts
        } else {
            method = 2; // no salutation and no first name, use Dear Supporter
        }
    }
    
	
	// Household and two contact same surname - Dear Mr Ryan and Mrs Francesca Bryant
    if ((accountType == 'Household') && (grclc < 100) && (PLastName == SLastName)) {
        
            switch(method){    
                case 1: // Dear Ryan and Francesca Bryant
                    return (PFirstName + " " + "and" + " " + SFirstName + " " + SLastName);
                    break;
                case 2: // Dear Supporter
                    return ("Supporter");
                    break;
                default: // Dear Mr and Mrs Bryant or Dear Chancellor and Mrs Bryant
                    return (salutation1 + " " + "and" + " " + salutation2 + " " + SLastName);
                
            }
            
    // Household and two contact different surname - Dear Mr Ryan Bryant and Mrs Francesca Parkes
    } else if ((accountType == 'Household') && (grclc < 100) &&  (PLastName != SLastName)) {
                switch(method){
                    case 1: // Dear Ryan and Francesca
                        return (PFirstName + " " + "and" + " " + SFirstName);
                        break;
                    case 2: // Dear Supporter
                        return ("Supporter");
                        break;
                    default: // Dear Mr Bryant and Mrs Parkes or Dear Chancellor and Mrs Parkes
                        return (salutation1 + " " + PLastName + " " + "and" + " " + salutation2 + " " + SLastName);
                }
				
			// Not Household with careof
            } else if ((accountType != 'Household') && (careof)){
                    return ({!Receipt.Account.Receipting Care of});                        
                } else if ((accountType != 'Household')){
                            return ("Sir/ Madam");
                } else if ((grclc == 100)){ // Household and only one LC
              
                        switch(method){    
                            case 1: // Dear Ryan
                                return (PFirstName);
                                break;
                            case 2: // Dear Supporter
                                return ("Supporter");
                                break;
                            default: // Dear Mr Bryant or Dear Chancellor
                                return (salutation1 + " " + PLastName);
                        }                        
                } else {
                    return "";
                }
})()

Body

Date

«IF Pledge»«LastPaymentDate»«ELSE»«GiftDate»«ENDIF»

  • "LastPaymentDate": "Receipt__value__USYD_Gift_Date__c"

  • "GiftDate": "Receipt__value__AQB__GiftDate__c"

Received from

«GiftRecognitionCredit»

  • "GiftRecognitionCredit": "Receipt____AQB__GiftId__c___GRC_roll_up__c"

Flow: Gift Pledge Update - V6

Trigger: Gift/Pledge Created or Edited

If GRC exist:

concatenate contacts’:

Contact.Receipt Name

or

Contact.FirstName Contact.LastName

else:

Account.Account Name

Gift Pledge Update - V6

Amount

«GiftAmount»

  • "GiftAmount": "Receipt____AQB__Amount__c"

Receipt

«ReceiptNum»

  • "ReceiptNum": "Receipt____Name"

«COADesignation»

  • "COADesignation": "Receipt____USYD_Transaction_COA_Acc_Num_Roll_Up__c"

...