Creating an Accounting Journal from an Opportunity
Problem
You want to create a Accounting journal directly from pledge information in a Opportunity. The journal should update the bank account with the accounts received and track the revenue by the donor.
Solution
To use ClickLink to create the information, you need to:
- Add the following custom fields to the Opportunity object and the Opportunity Page layout for the pledge and payment information:
- Bank Account (Lookup)
- Credit Amount (Formula (currency) with the formula Amount * -1)
- Credit Payment Reference (Formula(text with the formula Payment_Reference__c))
- Customer Account (Formula (text with the formula Account.Name))
- Debit Payment Reference (Formula (text with the formula Payment_Reference__c))
- Payment Method (Picklist with the values Check, Credit Card and Lockbox)
- Payment Date
- Payment Reference (Text(80))
- Payment Posted to Accounting (checkbox)
- Amount (Currency 16,2)
- Add the following fields to the Journal object:
- Pledge(Lookup to Opportunity)
- Payment Method(Text(40))
- Create a ClickLink rule to convert the Pledge Information to a Pledge Payment Journal:
Recommended Values for the Convert Pledge Information to Pledge Payment Journal ClickLink Rule Item Value ClickLink Rule Name Convert Pledge Information to Pledge Payment Journal Source Object Opportunity Source Object Name Field Name Source Object Process Field Payment_Posted_to_Accounting__c Target Object c2g__codaJournal__c Target Object Name Field Name - Create ClickLink mappings to map the fields from the opportunity to the Journal:
Recommended Mappings for the Convert Pledge Information to Pledge Payment Journal ClickLink Rule Target Record Created From Mapping Type Mapping Literal Source Field Target Field Source Record Source Field Payment_Date__c c2g__JournalDate__c Source Record Source Field Payment_Reference__c c2g__Reference__c Source Record Literal PAYMENT INFORMATION FOR PLEDGE c2g__JournalDescription__c Source Record Source Field Name Pledge__c Source Record Source Field Payment_Method__c Payment_Method__c - Create a ClickLink to convert the Pledge Information to Pledge Payment Journal Line Items:
Recommended Values for the Convert Pledge to Pledge Payment Journal Line Item ClickLink Rule Item Value ClickLink Rule Name Convert Pledge to Pledge Payment Journal Line Item Source Object Opportunity Source Object Name Field Name Target Object c2g__codaJournalLineItem__c Target Object Name Field Name - Create ClickLink mappings to map the source fields to the target fields for the rule you created in the previous step:
Recommended Mappings for the Convert Pledge to Pledge Payment Journal Line Item ClickLink Rule Target Record Type Target Record Created From Mapping Type Mapping Literal Source Field Target Field Credit Source Record Source Field Credit_Amount__c c2g__Value__c Credit Source Record Literal Account - Customer c2g__LineType__c Credit Source Record Source Field Customer_Account__c c2g__Account__c Credit Source Record Source Field Credit_Payment_Reference__c c2g__LineDescription__c Credit Source Record Literal Donations Received~ c2g__GeneralLedgerAccount__c Default Source Record Literal Bank Account c2g__LineType__c Default Source Record Source Field Amount c2g__Value__c Default Source Record Source Field Bank_Account__c c2g__BankAccount__c Default Source Record Source Field Debit_Payment_Reference__c c2g__LineDescription__c Default Source Record Literal Bank Account - Checking US~ c2g__GeneralLedgerAccount__c ~ Hard coded values. You must check that the data exists in your org to use these rules. - Create a Visualforce page to convert an Opportunity to a Pledge Journal. You can use the following Visualforce markup:
<apex:page standardController="Opportunity" extensions="ffirule.IntegrationRuleEngine" action="{!convert}">
<ffirule:IntegrationRule engine="{!engine}"/></apex:page> - In the Convert Pledge to Pledge Payment Journal ClickLink rule, create a ClickLink button in the to access the Opportunity to Pledge JournalVisualforce page that you created in the previous step.
- Create a button in the Opportunities custom buttons and links for the button you created in the previous step.
- Create a Visualforce page to convert Opportunity Pledges to Pledge Journals. You can use the following markup:
<apex:page standardController="Opportunity" extensions="ffirule.IntegrationRuleEngine" action="{!convert}" recordSetVar="records">
<ffirule:IntegrationRule engine="{!engine}"/></apex:page> - In the Convert Pledge to Pledge Payment Journal ClickLink rule, create a ClickLink button to access the Opportunity Pledges to Pledge Journals Visualforce page you created in the previous step.
- Create a button in the Opportunities custom buttons and links for the button you created in the previous step.
- Add the ClickLink buttons to the page layout for the Opportunity object.
- Create a ClickLink relationship on the Pledge Information to Pledge Payment Journal ClickLink rule that you created in step 3.
Recommended Relationship for the Convert Pledge Information to Pledge Payment Journal ClickLink Rule ClickLink Relationship Name Relationship ClickLink Rule Relationship Target Field Journal Lines Items to Journal Convert Pledge to Pledge Payment Journal Line Item c2g__Journal__c
To test the ClickLink rule open an opportunity and click Create Pledge Journal. A journal should be created with at least one journal line item depending on your accounting data.