Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics NAV (Archived)

How to set focus on the salesline added automatically to the Sales Quote page

(0) ShareShare
ReportReport
Posted on by 215

H5265.Sales-Quote-SubPage_2D00_salesline.png"/resized-image.ashx/__size/550x0/__key/CommunityServer-Components-UserFiles/00-00-01-67-62-Attached+Files/3073.Sales-Quote-Page_2D00_New-Action-Group.png" border="0" />

A similar 'Windowmaker' menu is added to the Lines fasttab of the Sales Quote page as shown below.

The only change here is that each action has a shortcut key.

The purpose of this menu is to call the add-on configurator which will allow me to design the door/window/glass item and in turn create a new sales line corresponding to the item that is created by the configurator. Note that the sales line is created automatically.

I have used SendKeys() function of Windows Script Host Object Model to invoke the action on the Lines subpage from the main Header page by passing the shortcut key shown above. See details of using SendKeys() --> http://dynamicsuser.net/blogs/mark_brummel/archive/2009/11/22/tip-15-execute-actions-on-subpages-from-the-action-pane.aspx

For each action on Sales Quote page, the OnAction() trigger is customized as shown below

NewWindow - OnAction()
//Send shortcut key 'Ctrl+A' to execute action on 'New Window' menu
WINSHELL.SendKeys('^a');
CurrPage.UPDATE(FALSE);

Similarly the OnAction() trigger on the Sales Quote Subform page is customized as shown below
<Action1100359002> - OnAction()
{CurrPage.SalesLines.FORM.}
OpenNewWMSalesLine(ItemType::Window);

The OpenNewWMSalesLine() function calls the add-on configurator which allows to design the item as required and after that it returns the item details using which it will create a new sales line corresponding to that item.

Now the problem i face.....

In SP1 when i click any of the action from the Header page, the SendKeys() function was working correctly by sending the appropriate shortcut key to the Lines page and the corresponding trigger was getting executed also.

After upgrade to R2, when i click on any of the action from the Header page, it does nothing. I later on realized that the cursor has to be on the Lines fasttab in order for the shortcut key to function. However this was not required when i use to do it in SP1.

Another thing when my configurator creates a new salesline, the Lines fasttab shows the current salesline in gray color.

 Now if i click any of the action from the header page, again it does nothing.

i then manually select the above line so that the gray color vanishes and the line is seen as currently selected in blue color. Now if i click the action from the header page it works. This was not the case in SP1.  For each new sales line i add via the configurator, i have to manually set the focus on any of the line on the Lines fasttab in order for the action in the header page to function correctly.

Although the OpenNewWMSalesLine() function does set the Rec var. to the newly created sales line by the configurator, i am not sure why the sales line is seen in grayed color and why there is a need for me to manually select that line in order to see it as having the current focus.

Does anyone have idea how to overcome the above?

Regards,

Hemant

 

*This post is locked for comments

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

Announcing Our 2025 Season 1 Super Users!

A new season of Super Users has arrived, and we are so grateful for the daily…

Vahid Ghafarpour – Community Spotlight

We are excited to recognize Vahid Ghafarpour as our February 2025 Community…

Tip: Become a User Group leader!

Join the ranks of valued community UG leaders

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 292,489 Super User 2025 Season 1

#2
Martin Dráb Profile Picture

Martin Dráb 231,305 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans