Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

VS Tools error accessing field on modified form (DAG issue?)

Posted on by 2,281

I have added some custom fields to the GP 2015 R2 Item Maintenance and Item Maintenance Options windows using Modifier.  I have created the ModifiedForms assembly using DAG.

All of the custom fields show up in Visual Studio intellisense.  Everything looks good at design time.

But at runtime, I cannot access one of the custom fields.  It is as if VST doesn't think it exists.  I can access 9 other fields, but not one of the fields.  And that one field just happens to be a checkbox--I don't know if that is coincidence, or if there is some issue accessing custom checkboxes with VS Tools.

VSTError1.jpg

In Visual Studio, I can use intellisense to access the field and its value property:

ivItemAdditionalInfoModified.LocalBreakCase.Value

But at runtime, I get this error:

VSTError.jpg

If I Debug in Visual Studio and attempt to access the value (or any property) of the custom check box in the Immediate Window, I get this:

? ivItemAdditionalInfoModified.LocalBreakCase.Value 'Microsoft.Dexterity.Applications.DynamicsModifiedDictionary.IvItemMaintenanceForm.IvItemAdditionalInfoWindow' does not contain a definition for 'LocalBreakCase' and no extension method 'LocalBreakCase' accepting a first argument of type 'Microsoft.Dexterity.Applications.DynamicsModifiedDictionary.IvItemMaintenanceForm.IvItemAdditionalInfoWindow' could be found (are you missing a using directive or an assembly reference?)

I have tried renaming the checkbox.  I have tried deleting it from Modifier and adding it back.  I have even tried deleting my FORMS.DIC and re-creating all 10 of the custom fields from scratch.

I have re-run the DAG numerous times, recreating both the metadata assembly and the modified forms assembly.

Again, the 9 other custom fields (all String fields) work perfectly and I can read from and write to them from VS Tools.  The checkbox is the only one that is giving me issues.

This seems like an issue with the DAG, or some Modifier + DAG issue, or perhaps an issue with custom checkboxes.

Any suggestions?

My next step is to test a single custom checkbox on a different server.  And perhaps also try this with GP 2013 R2.

*This post is locked for comments

  • Josh P Profile Picture
    Josh P 2,895 on at
    RE: VS Tools error accessing field on modified form (DAG issue?)

    That looks like a fun tool.

    I have been working on a way to cast a win32 windows form to a Dynamics form object, but I am finding it difficult to cast between a DexForm in the Shell.dll and the Applications.dll base form / window objects.

    The first idea is to catch any modal windows / popups that do not originate from a Dexterity window (think application security popup window). I can get the properties using reflection on the Applications side. I can get the windows form from the Win32 API cast as a DexForm, but I can't make the two play nice with each other.

    The other utility for this would be to detect and debug windows as they open, close, and fire base windows events instead of needing to browse a collection of open windows on the application thread specifically. It would allow a developer to debug any third party window assuming it is running on the Dex session including the core GP windows / processes.  

    I'm not finding a lot of documentation on the topic either. :(

    If you colleague has a thought on this, I would sure like to hear about it.

  • steveendow Profile Picture
    steveendow 2,281 on at
    RE: VS Tools error accessing field on modified form (DAG issue?)

    Thanks Josh.  Interesting idea. My colleague Andrew Dean developed a "GP Object Explorer" tool that appears to do the same thing.  It uses reflection to display all windows and fields in the Application.Dynamics.dll, and also identifies any open GP windows, and then display the fields and values on those windows.

    ObjectExplorer.jpg

    Unfortunately I don't know that it would have helped me in this case--I realized that GP wasn't seeing the custom field, but I didn't understand why.  I hadn't yet made the connection that I was developing with one version of my ModifiedForms.dll while GP was using an older copy of my ModifiedForms.dll.

    Sometimes it's the small mistakes that are the hardest to track down...

  • Josh P Profile Picture
    Josh P 2,895 on at
    RE: VS Tools error accessing field on modified form (DAG issue?)

    Hey Steve,

    Check out jamesdlyn.wordpress.com/.../microsoft-dynamics-gp-sdk

    If you haven't seen this yet, it's a routine that I've adapted to sniff out fields and values for windows when debugging quickly inside GP. You just need to hook into an open GP window through whatever means you prefer to get all the data (menu handler, static variable, etc..).

  • Suggested answer
    steveendow Profile Picture
    steveendow 2,281 on at
    RE: VS Tools error accessing field on modified form (DAG issue?)

    I found my mistake.

    My deployment batch file was copying my recompiled AddIn DLL to the GP AddIns directory, but was NOT copying the updated ModifiedForms.dll from the VS Tools SDK directory.

    Since my Visual Studio reference was using the ModifiedForms.dll in the SDK directory, Intellisense worked fine.  But when GP attempted to run the AddIn, it had an old copy of the ModifiedForms.dll file in the AddIns directory, hence the failure to "see" new fields on the modified window.

    So whenever you re-run DAG, make sure to copy or deploy the ModifiedForms.dll to the AddIns directory.

    Ugh.  I don't recommend making that mistake. 

    facepalm_5F00_227789.jpg

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,269 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,198 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans