Generate a Miscellaneous Adjustment from Payable Invoice in Accounting

Problem

You want to book accounts payable in Accounting to costs on a project in PSA.

Solution

Using ClickLink, create a ClickLink rule to take costs from a payable invoice in Accounting and create a miscellaneous adjustment in PSA:

  1. Add the following fields to the Payable Invoice object:
    • Misc Adjustment Created (checkbox)
    • Project (lookup to project in PSA)
    • PSA Expense Report (lookup to Expense Report in PSA)
    • Misc Adjustment Name (lookup to Miscellaneous Adjustment in PSA)
  2. Add the following fields to the Miscellaneous Adjustment object:
    • Payable Invoice (lookup to Payable Invoice in Accounting)
  3. Add a section to the Payable Invoice object page layout with the custom fields that you created in the previous step.
  4. Create a ClickLink rule to create a miscellaneous adjustment in PSA from a payable invoice in Accounting:
    Recommended Values for the Create Misc Adjustment from Payable Invoice ClickLink Rule
    ItemValue
    ClickLink Rule NameCreate Misc Adjustment from Payable Invoice
    Source Objectc2g__codaPurchaseInvoice__c
    Source Object Name FieldName
    Source Object Processed FieldMisc_Adjustment_Created__c
    Target Objectpse__Miscellaneous_Adjustment__c
    Target Object Name FieldName
  5. Create these ClickLink mappings for the ClickLink rule you created in the previous step:
    Recommended Mappings for the Create Misc Adjustment from Payable Invoice ClickLink Rule
    Target Record Created FromMapping TypeMapping LiteralSource FieldTarget Field
    Source RecordSource Field Project__c pse__Project__c
    Source RecordSource Field c2g__InvoiceTotal__cpse__Amount__c
    Source RecordLiteralExternal Cost pse__Transaction_Category__c
    Source RecordSource Field c2g__InvoiceDescription__c pse__Description__c
    Source RecordSource Field  Misc_Adjustment_Name__cName
    Source RecordSource Field c2g__InvoiceDate__cpse__Effective_Date__c
    Source RecordSource Field Name Payable_Invoice__c
  6. Create a Visualforce page to convert a single payable invoice to a miscellaneous adjustment. You can use the following Visualforce markup:

    <apex:page standardController="c2g__codaPurchaseInvoice__c" extensions="ffirule.IntegrationRuleEngine" action="{!convert}">

    <ffirule:IntegrationRule engine="{!engine}"/></apex:page>
  7. Create a Visualforce page to convert payable invoices from a list to miscellaneous adjustments. You can use the following Visualforce markup:

    <apex:page standardController="c2g__codaPurchaseInvoice__c" extensions="ffirule.IntegrationRuleEngine" action="{!convert}" recordSetVar="records">

    <ffirule:IntegrationRule engine="{!engine}"/></apex:page>
  8. In the Payable Invoice object, create buttons to access the Visualforce pages you created in the previous steps.
  9. Add the CreateMiscAdj button to the Payable Invoice object page layout.
  10. Add the CreateMiscAdjs button to the Payable Invoice object Payable Invoices List View.
  11. In the Create Misc Adjustment from Payable Invoice rule, create the corresponding buttons for the buttons you created in the previous step.

To test the ClickLink rule, click Create Misc Adjustment on a payable invoice. A miscellaneous adjustment is created in PSA.