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

🌸 Community Spring Festival 2025 Challenge Winners! 🌸

Congratulations to all our community participants!

Adis Hodzic – Community Spotlight

We are honored to recognize Adis Hodzic as our May 2025 Community…

Kudos to the April Top 10 Community Stars!

Thanks for all your good work in the Community!

Leaderboard > Microsoft Dynamics NAV (Archived)

Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans