Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

AddIn code not working on web client

Posted on by Microsoft Employee

Hi there,
I'm using Visual Studio Tools for Dynamics GP for the first time. Using GP 2013 R2 and Visual Studio 2013 (C#). The code works on the rich client but not on the web client. Any ideas on how I can I figure out why?

DLL has been copied to the AddIns folder.

Code used:

using System;

using System.Collections.Generic;

namespace DynamicsGPAddin1

{

[SupportedDexPlatforms(DexPlatforms.WebClient | DexPlatforms.DesktopClient)]

public class GPAddIn : IDexterityAddIn

{

// Create a reference to the Item Maintenance form

public static IvItemMaintenanceForm ItemMaintenanceForm = Dynamics.Forms.IvItemMaintenance;

// Create a reference to the Item Maintenance window

private IvItemMaintenanceForm.IvItemMaintenanceWindow ItemMaintenanceWindow = ItemMaintenanceForm.IvItemMaintenance;

 // IDexterityAddIn interface

public void Initialize()

{

// Create an instance of the Environmental Details form when the Item Maintenance form opens

ItemMaintenanceForm.OpenAfterOriginal += new EventHandler(ItemMaintenanceForm_OpenAfterOriginal);

// Find out if the add-in is being run on the web client

}

void ItemMaintenanceForm_OpenAfterOriginal(object sender, EventArgs e)

{

Int16 answer;

// Message Box for web client as MessageBox doesn't work on there

answer = Dynamics.Forms.SyVisualStudioHelper.Functions.DexAsk.Invoke("RS test - please ignore", "Yes", "No", "Cancel");

// set default value for field Description

this.ItemMaintenanceWindow.ItemDescription.Value = "RS Test";

//MessageBox.Show("RS TESTING");

}

}

}

*This post is locked for comments

  • Chad Sriram Profile Picture
    Chad Sriram 1 on at
    RE: AddIn code not working on web client

    I finally got mine to work. I did not have to make any entries whatsoever in the dynamics.exe.config file.

    The mistakes I made were:

    i) I had mistakenly placed the supported platform code as the first line inside the addin instead of inside the namespace but outside the addin code.

    ii) Used message boxes instead of Dex functions while building for the web client, once I re-wrote them, it worked. This development for the web client instructions is not specified in the VS 2013 SDK pdf file but specified in the VS 2015 SDK pdf file that comes with GP 2015 (Chapter 19 - Developing for the web client)

    iii) I did make sure to use the .Net Framework 4.5.1 for a build.

    I was using modified forms, so I generated the Application.Dynamics.ModifiedForms dll inside the GP install folder using the DAG (Dictionary Assembly Generator). Then, it worked like a charm inside the Addins folder without any additions to the Dynamics.exe.config file for the web client.

    I hope some of this helps someone out there.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AddIn code not working on web client

    As mentioned, we don't know how we got this to work.

  • Chad Sriram Profile Picture
    Chad Sriram 1 on at
    RE: AddIn code not working on web client

    Can you tell me what you did to get this to work? How do you get the public key token value for the addin? Is it necessary to be added to the Dynamics.exe.config file?

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AddIn code not working on web client

    Told this morning that a colleague got this working after creating another DEV environment. He doesn't know what the issue is with the environment I worked on. We will be doing the development shortly and holding thumbs that it all works out.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AddIn code not working on web client

    I am, see code attached to original post.

    Thanks for all the feedback Soma

  • soma Profile Picture
    soma 24,406 on at
    RE: AddIn code not working on web client

    Have you added the below code to you projects?

    In the following C# example, the logical-or operation is used to indicate that both

    the desktop client and the web client are supported.

    namespace CSharpSample

    {

             [SupportedDexPlatforms(DexPlatforms.DesktopClient |

             DexPlatforms.WebClient)]

             public class GPAddIn : IDexterityAddIn

            {

                 // IDexterityAddIn interface

                public void Initialize()

                {

                }

             }

    }

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AddIn code not working on web client

    I did, been trying alotta things. Not luck just yet.

    Must be something with the installation.

  • soma Profile Picture
    soma 24,406 on at
    RE: AddIn code not working on web client

    1. Paste only the DynamicsGPAddin1.DLL to GP installation folder.

    2. Try the below

    <addin name="DynamicsGPAddin1" type="DynamicsGPAddin1.GPAddIn,DynamicsGPAddin1"/>

    Note: To have add-ins loaded for the web client, add the SupportedDexPlatforms attribute to the class that implements the IDexterityAddIn interface for your integration. Refer to the section Specifying supported clients in Chapter 10, "Building and Deploying" for complete details about how to configure when an add-in is loaded from the VSTools SDK installation folder (by default: C:\Program Files (x86)\Microsoft Dynamics\GP2013 VS Tools SDK).

    Hope this helps!!!

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AddIn code not working on web client

    I have still not been able to resolve this issue.

    When logging into the web client I get the following error - Invalid Collections Management registration key. I don't think this will affect the AddIns though.

    I checked ProcessMonitor and it looks like the AddIns are being loaded (from the GP folder and from the AddIns folder).

    It is as if the DLL is not referenced at all - nothing of the AddIn is done and also no errors. For example, I added a reference to a Modified form and it didn't complain when the related DLL was not copied over - the desktop client did.

    Is there a way to configure the use of AddIns - switch it off? I'm leaning toward an installation error as this is a new installation - problem is that I didn't set it up, nor do I know much of how to set it up.

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    RE: AddIn code not working on web client

    The above was added to the DynamicsGPWeb section in the config file.

    Do I only copy the DynamicsGPAddin1.DLL over?

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

December Spotlight Star - Muhammad Affan

Congratulations to a top community star!

Top 10 leaders for November!

Congratulations to our November super stars!

Tips for Writing Effective Suggested Answers

Best practices for providing successful forum answers ✍️

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 291,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,214 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans