Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics GP (Archived)

GP VST unable to read any data from a line in a scrolling window.

Posted on by Microsoft Employee

I am attempting a simple modification of HR Applicant Interview Rating window and unable to find a way to read any of the scrolling window line data. 

I have no problems to get this done in VBA but using VST tried all available events and line field events and none fires.

Any suggestions? I only need to read key fields values (in this case only one from the line) and then update a custom field in the scroll line.

Thanks in advance

Ary

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: GP VST unable to read any data from a line in a scrolling window.

    Aaron,

    I got this working.

    Yes, we can set a custom field on the scrolling window on a line fill event.  That we can do.  We cannot read any window fields however as they are blank.  

    If we need to access fields that are filling in the scrolling window, we must access the table buffer.  That’s the only way to access those fields. In my case the table to read line data from was HR_App_Interview_LINE.

    Thanks for helping me.

    Ary

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: GP VST unable to read any data from a line in a scrolling window.

    Aaron,

    By this time the code is quite messed up. I was trying all available events and all that I need is to read one field "AppInterviewCategoryCode.Value" on the line of the modified window so I can assign a proper value to the custom line field. I found that the LineFillBeforeOriginal or After events fire but there is no values for the line fields available at the time these events fire.

    I will keep working and when I find the solution I will share code that works.

    Thanks,

    Any help is appreciated.

    Ary

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: GP VST unable to read any data from a line in a scrolling window.

    Ary,

    I don't think that this will have an impact on your scrolling window, but you probably don't need the unmodified version of  the form referenced if you're not using it in your code.  Also, I am wondering (and remember, I am no expert) that since you are referencing the scrolling window separately, the code doesn't know what to do.  Also, the last 4 lines seem strange to me.  It looks like you are referencing a TEMP table from within a modified form and I don't know if you can do that.  My C# is pretty rusty, so I may be wrong but that's what it looks like. 

    Try something like this (my changes are indicated with **) and let me know if that helps:

     

    using modHR = Microsoft.Dexterity.Applications.HumanResourcesModifiedDictionary;

    References to the form and scrolling  window.

          ** // Set a reference to the HR Applicant Interview Rating Form and Applicant Interview Rating Window

           modHR.HrApplicantInterviewRateForm HrApplicantInterviewRateForm;

           **modHR.HrApplicantInterviewRateForm.HrApplicationInterviewRate HrApplicantInterviewRateWindow;

    Below lots of testing event - only to last on the custom fields respond and than I have to change values to the custom fields in VBA.

               //Set up the responses to test change event

              ** HrApplicantInterviewRateWindow.ApplicantNumber.Change += new EventHandler(ApplicantNumber_Change);

               **HrApplicantInterviewRateWindow.AppInterviewTypeCode.Change += new EventHandler(AppInterviewTypeCode_Change);

               **HrApplicantInterviewRateWindow.ApplyDate.Change += new EventHandler(ApplyDate_Change);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.AppInterviewCategoryCode.Change += new EventHandler(AppInterviewCategoryCode_Change);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.LineFillBeforeOriginal += new System.ComponentModel.CancelEventHandler(HrApplInerviewRateScrollWindow_LineFillBeforeOriginal);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.LineFillAfterOriginal += new EventHandler(HrApplInerviewRateScrollWindow_LineFillAfterOriginal);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.Category.Change += new EventHandler(Category_Change);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.LocalLine1.Change += new EventHandler(LocalLine1_Change);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.SeqOrder.Change += new EventHandler(SeqOrder_Change);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.LocalDblScore.ValidateAfterOriginal += new EventHandler(LocalDblScore_ValidateAfterOriginal);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.LocalFillNoteLines.Change += new EventHandler(LocalFillNoteLines_Change);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.NotesIndex.Change += new EventHandler(NotesIndex_Change);

               **HrApplicantInterviewRateWindow.ScrollScrollingWindow.WeightFactor.Change += new EventHandler(WeightFactor_Change);

    /********  This section doesn't look right to me.  It looks as if you are referencing a TEMP table from within a modified form and I don't know if that's possible.  I also don't see where you have made a reference to the "HrAppllnerviewRateScrollWindow" that you are using in the last two lines of code. ***********************/

               HrAppInterviewLineTempTable = HumanResourcesModified.Forms.HrApplicantInterviewRate.Tables.HrAppInterviewLineTemp;

               HrAppInterviewLineTable = HumanResourcesModified.Forms.HrApplicantInterviewRate.Tables.HrAppInterviewLine;

               HrApplInerviewRateScrollWindow.LocalDblScore.Change += new EventHandler(LocalDblScore_Change);

               HrApplInerviewRateScrollWindow.LocalDummy.Change += new EventHandler(LocalDummy_Change);

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: GP VST unable to read any data from a line in a scrolling window.

    Aaron,

    Thanks for your quick respond.

    First using DAG.exe I created an assembly for the modified HR report dictionary and referenced it in the code.

    using directives:

    using HR = Microsoft.Dexterity.Applications.HumanResourcesDictionary;

    using modHR = Microsoft.Dexterity.Applications.HumanResourcesModifiedDictionary;

    References to the form and scrolling  window.

           // Set a reference to the HR Applicant Interview Rating Form

           modHR.HrApplicantInterviewRateForm HrApplicantInterviewRateForm;

           // Set a reference to the HR Applicant Interview Rating Form Scrolling Window

           modHR.HrApplicantInterviewRateForm.ScrollScrollingWindow HrApplInerviewRateScrollWindow;

    Below lots of testing event - only to last on the custom fields respond and than I have to change values to the custom fields in VBA.

               //Set up the responses to test change event

               HrApplicantInterviewRateForm.HrApplicantInterviewRate.ApplicantNumber.Change += new EventHandler(ApplicantNumber_Change);

               HrApplicantInterviewRateForm.HrApplicantInterviewRate.AppInterviewTypeCode.Change += new EventHandler(AppInterviewTypeCode_Change);

               HrApplicantInterviewRateForm.HrApplicantInterviewRate.ApplyDate.Change += new EventHandler(ApplyDate_Change);

               HrApplInerviewRateScrollWindow.AppInterviewCategoryCode.Change += new EventHandler(AppInterviewCategoryCode_Change);

               HrApplInerviewRateScrollWindow.LineFillBeforeOriginal += new System.ComponentModel.CancelEventHandler(HrApplInerviewRateScrollWindow_LineFillBeforeOriginal);

               HrApplInerviewRateScrollWindow.LineFillAfterOriginal += new EventHandler(HrApplInerviewRateScrollWindow_LineFillAfterOriginal);

               HrApplInerviewRateScrollWindow.Category.Change += new EventHandler(Category_Change);

               HrApplInerviewRateScrollWindow.LocalLine1.Change += new EventHandler(LocalLine1_Change);

               HrApplInerviewRateScrollWindow.SeqOrder.Change += new EventHandler(SeqOrder_Change);

               HrApplInerviewRateScrollWindow.LocalDblScore.ValidateAfterOriginal += new EventHandler(LocalDblScore_ValidateAfterOriginal);

               HrApplInerviewRateScrollWindow.LocalFillNoteLines.Change += new EventHandler(LocalFillNoteLines_Change);

               HrApplInerviewRateScrollWindow.NotesIndex.Change += new EventHandler(NotesIndex_Change);

               HrApplInerviewRateScrollWindow.WeightFactor.Change += new EventHandler(WeightFactor_Change);

               HrAppInterviewLineTempTable = HumanResourcesModified.Forms.HrApplicantInterviewRate.Tables.HrAppInterviewLineTemp;

               HrAppInterviewLineTable = HumanResourcesModified.Forms.HrApplicantInterviewRate.Tables.HrAppInterviewLine;

               HrApplInerviewRateScrollWindow.LocalDblScore.Change += new EventHandler(LocalDblScore_Change);

               HrApplInerviewRateScrollWindow.LocalDummy.Change += new EventHandler(LocalDummy_Change);

    Thanks,

    Ary

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: GP VST unable to read any data from a line in a scrolling window.

    Ary,

    Can you post the a code snippet from one of the fields that you are trying to read?  I suspect that it is being referenced incorrectly.   You have to go a bit further when you are referencing scrolling windows.  First reference the window, then the scrolling window, and finally the field.  An example would be:

    Dynamics.Forms.SopEntry.LineScroll.ItemNumber.Value

    "LineScroll" references the scrolling window, which allows us to get to the value of the item number within that scrolling window.

    Hope this helps,

    Aaron

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