Calling dox42 in the List/Library Context Menu

Prev Next

For a hands-on example, follow these instructions to generate a PDF SharePoint list item using a dynamic REST link based on your selected list or library item. We are going to use the dox42 ReturnAction.

Steps

  1. Create the REST link for the dox42 Return Action with one of these options:

    Important

    Please make sure that you have installed the dox42 Server properly and that the dox42 Server is allowed to read data from SharePoint:

    • To create the REST link, please see the dox42 Server Documentation.

    • Open the dox42 Server Client and select the REST URL button in the bottom right corner.

  2. Transform the static REST link into a dynamic link for the context menu. The static link is:

    https://yourserver.com:4242/dox42services.asmx?Operation=GenerateDocument&DocTemplate=https%3a%2f%2fYourServer.com%3a4242%2fdox42Templates%2fEmployeeContract.docx&InputParam.EmployeeID=1&ReturnAction.Format=PDF

    The input parameter “EmployeeID” needs to be dynamic based on the list item.

    1. Use the function {ItemId}, which gets the ID of the list item.

      Note

      {ItemId} is case sensitive. Be sure to use the correct casing.

      Then, the REST Link will look as follows:

      https://yourserver.com:4242/dox42services.asmx?Operation=GenerateDocument&DocTemplate=https%3a%2f%2fYourServer.com%3a4242%2fdox42Templates%2fEmployeeContract.docx&InputParam.EmployeeID={ItemId}&ReturnAction.Format=PDF

  3. Open the Lists and Libraries tab in SharePoint Designer.

  4. Integrate the dynamic link into the SharePoint context menu. The dox42 REST call will be integrated using “Custom Actions”.

  5. Go to the List Settings ribbon.

    SharePoint Designer interface displaying employee list settings and customization options.

    List Settings ribbon

  6. Select Custom Action > List Item Menu.

    The Create Custom Action dialog opens.

    Creating a custom action to generate a PDF employee list using dox42.

    Create Custom Action dialog

  7. Enter a name and a description.

  8. In the Select the type of action section, select Navigate to URL and paste the dynamic dox42 REST link that you have created earlier.

  9. Select OK.

Result

The context menu will now display the option Preview Contract with dox42 which holds the dynamic REST link.