Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL forum
Answered

How do I get a customization that will open the Sales Price screen, fill in an InvtID & PriceClassID, and refresh the grid?

Posted on by 80

Here is what I have so far:

I have a button on the Sales Order Entry screen that will Launch the Sales Price screen, passing the Customer Price class and the Inventory ID of the selected line.

I have the Display event of the Sales Price screen watching for those parameters to be passed, and when that happens it changes the Category to IL (Invt Item and Cust Price Class), fills in the Inventory ID and the Customer Price Class, then pushes the refresh button... except pushing the refresh button doesn't do anything.

I am pressing the button by:
sivMyApp.Controls("cmdRefresh").value = true

The button does get focus after the customized code runs. If I manually push the button immediately after, everything refreshes how I would expect it to.

I am filling in the Category, InvtID and CustPriceClassID using SetObjectValue although I also tried using the buffer with the same result.

I created a dummy button that clicks on the cmdRefresh, just to see if my code was pushing the refresh button too early in the process, but pushing the button programatically seems to have strange results no matter when you do it.

I'm including the VBA on the Sales Price screen.. it successfully switches the Category and fills in the Inventory and Price Class... Any ideas? Thanks!

 

Private Sub Form1_Display()

    Dim SOInvtID As String

    Dim SOClassID As String

    SOInvtID = ApplGetParmValue(PRMSECTION_VBRDT, "SOInvtID")

    SOClassID = ApplGetParmValue(PRMSECTION_VBRDT, "SOClassID")

    If (SOInvtID <> "" And SOClassID <> "") Then

        serr1 = SetObjectValue("cPriceCat", "IL")

        serr1 = SetObjectValue("cInvtID", SOInvtID)

        serr1 = SetObjectValue("ccustclassid", SOClassID)

        sivMyApp.Controls("cmdRefresh").value = True

    End If

End Sub

Categories:
  • Verified answer
    Barry Flynn Profile Picture
    Barry Flynn 3,090 on at
    Re: How do I get a customization that will open the Sales Price screen, fill in an InvtID & PriceClassID, and refresh the grid?

    Kelly

    I have used two ways of pressing buttons.

    The first way looks like your code.

                   sivmyapp.controls("Button_Name").value = true

    The other way uses SendKeys

                   Call ApplSetFocus("Button_Name")

                   Call SendKeys(" ",true)

    Both will often work.

    But not always.

    It seems that some buttons just don't want to co-operate.

    When I have found a "reluctant button" I have so far not found a workaround - other than putting up a message box "Could you please press the xxxx button now? "

    Not a very good workaround !!

    Barry

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

Anton Venter – Community Spotlight

Kudos to our October Community Star of the month!

Announcing Our 2024 Season 2 Super Users!

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

Dynamics 365 Community Newsletter - September 2024

Check out the latest community news

Leaderboard

#1
André Arnaud de Calavon Profile Picture

André Arnaud de Cal... 290,537 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 228,520 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans