web
You’re offline. This is a read only version of the page.
close
Skip to main content

Notifications

Announcements

No record found.

Community site session details

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

DetailSetupExtend in Customizatiom Manager

(0) ShareShare
ReportReport
Posted on by 1,245

Hello Everyone

I'm trying to add a new "in memory" custom field that does not exists in the Insert Object Wizard field list to a existing spread control (grid) of Purchase Orders (04.250.00) screen. This field will be read-only and will display Account.Acct_cat value for the selected purorddet.puracct.

 I believe DetailSetupExtend which is part of SDK lets one do something of this nature. 

Any help is much appreciated.

TIA

Nayan

*This post is locked for comments

I have the same question (0)
  • Barry Flynn Profile Picture
    3,090 on at

    Nayan

    First - export the customization to a cst file, and save that file. Then - if it all goes wrong, you can import that cst file and get back to where you are now.

    << will display Account.Acct_cat value for the selected purorddet.puracct.

    My suggestion is:-

    - Include the Account table's .dh filr in the customization

    - In Form Load, do a SetAddr for that table

    - And a SQLCursorEx

    - In Form Display, do a vba_mExtend

    Unless I've forgotten something, at that point, if you save the customization, and reload the screen, the Insert Object wizard should offer you the Account table.

    You will also need to write some code (probably using SQLFetch1) to Fetch the right Account record at various times - including when the grid gets loaded or updated.

    Hope that gives you a start...

    Barry

  • Nayan Mansinha Profile Picture
    1,245 on at

    I followed the instructions you gave but the Account table is not showing up in Insert Object Wizard.  Seems like I'm missing something.  below is the code I added. Please let me know if you see something odd in there.  thanks in advance.

    Private Sub Form1_Load()

       Call VBA_SetAddr("Account", bAccount, nAccount, LenB(bAccount))

       Call SqlCursorEx(CSR_Account, NOLEVEL, "CSR_Account", "Account", "")

    End Sub

    Private Sub Form1_Display()

       MH_Grid = VBA_MOpen(bAccount, LenB(bAccount), Null, 0, Null, 0, Null, 0)

       serr1 = VBA_Mextend(MH_Grid, bAccount, LenB(bAccount))

    End Sub

  • Nayan Mansinha Profile Picture
    1,245 on at

    Never mind.  Our var pointed out the obvious mistake of mine.  the name of the table in the VBA_SetAddr's first arg was not correct.  it should be bAccount.

    thanks again for your help.

  • Barry Flynn Profile Picture
    3,090 on at

    Nayan

    I think you have a problem in your Form Display code.

    The code you posted is as follows

    << Private Sub Form1_Display()

    <<    MH_Grid = VBA_MOpen(bAccount, LenB(bAccount), Null, 0, Null, 0, Null, 0)

    <<    serr1 = VBA_Mextend(MH_Grid, bAccount, LenB(bAccount))

    << End Sub

    That code does NOT attach the Account table to the grid.

    Instead, it creates a new array containing the table, then attaches the table to that new array for a second time.

    You don't need the VBA_Open. That call creates a new array, and you don't need one of those.

    Instead, use GetGridHandle to find the handle of the array that is attached to the existing grid.

    Then your VBA_MExtend uses THAT handle, so that it attaches the Account table to the existing grid.

    Hope that helps...

    Barry

  • Nayan Mansinha Profile Picture
    1,245 on at

    yes.  I did change it to GetGridHandle.  Thank you so much for your help.  BTW, didn't we connect during Convergence? Was it you or someone else?

    thanks again

  • Barry Flynn Profile Picture
    3,090 on at

    << BTW, didn't we connect during Convergence? Was it you or someone else?

    I wasn't at Convergence.

    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

Responsible AI policies

As AI tools become more common, we’re introducing a Responsible AI Use…

Neeraj Kumar – Community Spotlight

We are honored to recognize Neeraj Kumar as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans