There are two types of buttons you can create on your agreement object:

Client Credentials
 This button interacts with SharePoint as an administrator user.

Delegate
This button prompts user to log in to Office 365 and run processes as the Active Directory user that was logged in. In most cases, the Salesforce user and Active Directory user should be the same. 

The System Administrator must add the button to a page layout before users can access functionality. 


To Add Office 365 Integration Buttons

  1. In Salesforce, click Setup from the Setup icon in the upper right 
  2. Click Object Manager
  3. Click on your agreement object. For example, Contract Agreement
  4. Navigate to Buttons, Links and Actions and click New Button or Link
  5. Enter a name for the button in the Label field. We recommend Document Collaborations.
  6. For Behavior, select Display in existing window without sidebar or header
  7. Enter the button URL. For examples, here is the code for creating the buttons on the Contract Agreement object:

    Document Collaborations (Delegate)

    {!URLFOR('/apex/APXT_Redlining__DocumentCollaboration', null, [agreementId=APXT_Redlining__Contract_Agreement__c.Id], false)}
    CODE

    Document Collaborations (Client Credentials)

    {!URLFOR('/apex/APXT_Redlining__DocumentCollaboration', null,
    [agreementId=APXT_Redlining__Contract_Agreement__c.Id,
    authType='CLIENT_CREDENTIALS'], false)}
    CODE
  8. Click Save
  9. Click Page Layout in the left menu
  10. Add the buttons you created to your page layout in the custom buttons or Salesforce Mobile and Lighting Experience Actions section. 
  11. Click Save