Views:

Scenario Overview

In this scenario we have a requirement from a customer to open a new Appointment for a Lead from a button on the form. 

The customer wants the regarding field on the new Appointment form to automatically set the Lead but they don't want to actually create the Appointment until they click save.

The customer also wants the label of the button to appear in the User's language

Note: This article presumes you have the language pack for French installed in your Dynamics instance. For instructions on how to set this up, please see the Microsoft Documentation

North52 BPA Solution

The North52 BPA solution works like this:

  • An North52 Formula of type ClientSide - Calculation is created on the Lead entity
  • Quick Button formula of type ClientSide - Calculation is created that references the above formula
  • A Quick Button is added to the Lead form that invokes the Quick Button formula
Note: Quick Button V5 or higher is required for the scenario used in this article

North 52 Formula - Lead - Open a new Appointment

  • Navigate to Settings > N52 Formula
  • Create a new formula, setting the following values in the Formula Guide:
    • Set Source Entity set to Lead
    • Set Formula Type to ClientSide - Calculation
    • Select the Classic editor
    • Change the Name of the formula to Lead - Open a new Appointment
    • Copy the following formula into the Classic editor:
OpenQuickCreate('appointment', [lead.leadid], 
SetAttribute('location', [lead.address1_composite]),
SetAttribute('subject','Reminder Meeting with Potential Client  : ' + [lead.subject]))
  • Click Save

North 52 Formula - Quick Button Formula

The following set of steps outline how to create this Formula:

  • Navigate to Settings > N52 Formula
  • Create a new formula, setting the following values in the Formula Guide:
    • Set Source Entity set to Lead
    • Set Formula Type to ClientSide - Calculation
    • Select the Decision Table editor
    • Click Create
  • Change the Name of the formula to Quick Button for Create Appointment
  • Click Save

  • Go to the Fetch XML tab:
    • Click the + symbol to open up the Fetch XML window
    • For the Name, enter Find Users Language
    • For the Query, copy the following Fetch-Xml: 

<fetch top="50" >
  <entity name="usersettings" >
    <attribute name="uilanguageid" />
    <filter>
      <condition attribute="systemuserid" operator="eq" value="{0}" />
    </filter>
  </entity>
</fetch>

  • Click Save & Close

  • Click on the Decision Table editor
    • Right-click Operations > Toggle Advanced Mode
    • Select the Global Calculations sheet
      • In cell A2, enter Language Id of User
      • In cell A4, copy the following function:

FindValueFD('Find Users Language','uilanguageid','?','true', SetParams(WhoAmI()))

  • Click Save
  • Note down the formula short code for later use

  • Select Snippets > Quick Button (this will create a SampleQuickButton sheet) 
    • Change the CSSClass-1 to 'btn btn-primary'
    • Change the CSSStyle-1 to be 'width:200px'
    • Change the ClickShortcode-1 to be the formula shortcode form earlier. 
    • Change the DefaultLabel-1 to be 'Create Appointment'
  • Select row 4
  • Right-click Cells > Copy
  • Right-click Cells > Paste
  • Select cell A2
  • Right click Insert > Insert Condition
  • Select cell A2
    • Go to the Source tab
      • Click the refresh button to the right of the text box
      • Expand Global Calculations
      • Select Language Id of User
  • In cell A4 enter '1033'
    • This is the code for English
  • In cell A5 enter '1036'
    • This is the code for French
  • In row 5, under the DefaultLabel-1, change 'Create Appointment' to 'Créer Rendez-vous'
  • Click Save
  • Take note of the formula short code

Quick Button on Lead Form

For instructions on how to set up a Quick Button on a form, please review this article. Specifically the Install Process and Configuration sections. 

Testing

  • To test, open up a Lead and click on the Quick Button:

     
  • You will see a Quick Create form of an Appointment populated with data from the Lead appear:

     
  • To test multi-language support, login with a user that has set their language to French and go to a Lead record: