Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL (Archived)

SL7-sdk How can I get the extension field in a grid to update

Posted on by Microsoft Employee

This is the code in the Chk event for my unit price field. 

qty =

Me.cQtyOrdered.Ctlget_Text

price =

CDbl(ChkStrg)

extension = FPMult(qty, price, MONEY)

 

Me.cExtension.Ctlset_Text(extension)

Call DispFields(Me, PNULL, PNULL)

 

I know that extension has the correct value, but I can't get it into the cExtension field in the grid.  What am I missing?

Thanks,

Ayrin

*This post is locked for comments

  • Verified answer
    Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: SL7-sdk How can I get the extension field in a grid to update

    I really thought I had tried this.

           bxprojectitems.extension = FPMult(qty, price, MONEY)

           Call DispFields(Me, cExtension, cExtension)

  • Barry Flynn Profile Picture
    Barry Flynn 3,090 on at
    Re: SL7-sdk How can I get the extension field in a grid to update

    Ayrin

    Can you confirm that your code is VBA (and not VBTools)?

    Is your unit price field located on the grid?

    (Things may get a bit complicated if it is not.)

    I think the simplest way to populate the cExtension control should be to use the SetObjectValue API call.

    So, your code might look like this...

    I'm just typing this into this message, so there may be the odd typo...

      qty = Me.cQtyOrdered.Ctlget_Text

      price = CDbl(ChkStrg)

      extension = FPMult(qty, price, MONEY)

      serr1 = SetObjectValue("cExtension", Extension)

    My memory is a little vague offhand.

    It is possible that the SetObjectValue call may require a string as its final parameter.

    (I'm assuming that Extension is a Double).

    If that call is unhappy, try converting your Extension variable to a String.

    I've omitted your line

       Me.cExtension.Ctlset_Text(extension)

    I wasn't very sure what that was doing.

    I've also left unchanged your line which uplifts Qty. I don't quite understand it, but, from your xcomments,  it seems that it works!

    A possible alternative might be

      qty = GetObjectValue ("cQtyOrdered")

    Does that help?

    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

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,280 Super User 2024 Season 2

#2
Martin Dráb Profile Picture

Martin Dráb 230,235 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,156

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans