Skip to main content

Notifications

Finance | Project Operations, Human Resources, ...
Suggested answer

Automated loading of data into a scrolling window

Posted on by

This is one for the Dex developers.

I have a scrolling window where users can enter a product number, the warehouse and the price per unit before moving to the next line.  Every product number is unique so no quantity is required. All very straight forward.

However, the user can also enter a special code into the product field that will then prompt for a product list number.  This is a predefined list of products.  Once they enter the list number, it will read the first product, display that in the scrolling window and then prompt the user for the warehouse and price.

Once these are entered, the user enters another special code to automatically add the remainder of the list to the scrolling window.  The screen automatically loads each product, warehouse and price based on the first line entered.

After each line is added, it should scroll to the next line.

My issue is that sometimes it does scroll to the next line and sometimes it doesn't and all of the products overwrite line 2 on the scrolling window.  The product lists are usually 100-200 lines in length.

What I cannot work out is why it isn't either consistently working or consistently failing.  I have tried running this with debug turned on and still it sometimes works and sometimes doesn't and there are no errors or obvious issues I can find.

Has anyone tried doing this before?  I know I can populate scrolling windows for display purposes easily but this needs to be interactive (it is an Adds Allowed window).  This is the list of commands we are using to force the window to move to the next line.  This is done after it loads the next product number onto the screen.

Window_PullFocus(window NewAssetEntryScroll); 
fill window NewAssetEntryScroll;
force changes window NewAssetEntryScroll; 
Window_ScrollScrollingWindow(window NewAssetEntryScroll, SCROLLTYPE_NEXT); 

Has anyone tried something similar to this before?  

I have a feeling I may have to rewrite the entire process to use a different method.  I have tried playing around with the script and generally it makes it worse.

Any ideas would be appreciated.

Mark

Categories:
  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,915 Most Valuable Professional on at
    RE: Automated loading of data into a scrolling window

    Pulling the focus ensures the scroll change script is executed to save the current line. But the should the focus back to the scrolling window then issue the command to move.

    If they are updating the contents of the scrolling window, they should use fill window with the from current and/or refresh keywords.

    Regards

    David

  • mavrick5au Profile Picture
    mavrick5au on at
    RE: Automated loading of data into a scrolling window

    Hi David,

    I thought it was odd they were pulling focus away from the scrolling window.  I will make the changes you suggested and test it again.

  • mavrick5au Profile Picture
    mavrick5au on at
    RE: Automated loading of data into a scrolling window

    Sorry Almas, that is not possible.

  • David Musgrave MVP GPUG All Star Legend Moderator Profile Picture
    David Musgrave MVP ... 13,915 Most Valuable Professional on at
    RE: Automated loading of data into a scrolling window

    Hi Mark

    The Window_ScrollScrollingWindow() function needs you to current be focused on the previous line.

    You might need to use fill window from current and a focus statement or Window_SetFocus() beforehand to ensure you are in the correct position first.

    David

  • Suggested answer
    Almas Mahfooz Profile Picture
    Almas Mahfooz 11,003 User Group Leader on at
    RE: Automated loading of data into a scrolling window

    Hi Mark,

    I have worked on many scrolling windows and can help you. If you wish you can provide me your development  dictionary so I can review your code.

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!

Community AMA December 12th

Join us as we continue to demystify the Dynamics 365 Contact Center

Leaderboard

#1
André Arnaud de Calavon Profile Picture

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

#2
Martin Dráb Profile Picture

Martin Dráb 230,149 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Product updates

Dynamics 365 release plans