Skip to main content

Notifications

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

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

(0) ShareShare
ReportReport
Posted on by

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
    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
    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

Jainam Kothari – Community Spotlight

We are honored to recognize Jainam Kothari as our June 2025 Community…

Congratulations to the May Top 10 Community Leaders!

These are the community rock stars!

Announcing the Engage with the Community forum!

This forum is your space to connect, share, and grow!

Leaderboard >

Featured topics

Product updates

Dynamics 365 release plans