Skip to main content

Notifications

Announcements

No record found.

Microsoft Dynamics SL forum
Unanswered

Journal Transactions Entry Customize to show Acct and Sub Descr

Posted on by Microsoft Employee

I want to show the account and Sub Account Description on the screen when the user scroll through the grid.

I have seen this implemented at the bottom of the screen which would be perfect.  I have tried to create teh customization but cannot seem to get it to work.

Dynamics SL version 7

 

 

  • Becky K Profile Picture
    Becky K 100 on at
    RE: Journal Transactions Entry Customize to show Acct and Sub Descr

    This worked, but then the user is able to change it, so I want it visible, but not able to be changed.  If it is not enabled, it will not populate and gives and VB error.    The value of the disabled SAF controls cannot be set.

  • Paul Phillips Profile Picture
    Paul Phillips 590 on at
    Re: Journal Transactions Entry Customize to show Acct and Sub Descr

    Hi Eric,

    Here's the gist of this type of customization:

    1. Add two label controls at the bottom of the form for each description

    2. The account description is loaded from the db in the cacct_Chk event

    3. The subaccount description is loaded from the db in the csub_Chk event

    4. Both descriptions are refreshed in the Spread1_LineGotFocus event

    When you load the account and subaccount decriptions from the database, set the label captions using the SetProps call with PROP_CAPTION.

    Here's sample code to retrieve the subaccount description. It is developer preference as to whether the cursor is globally scoped or not. I find that local scope is easier to maintain and the performance impact is negligible. You'll want to check around this code block to ensure that the subaccount number is not blank, and if it is, set the description to blank. To get the current value of the subaccount, use this call: GetObjectValue("cSub").

    Also note that in SL7 VBA, LenB(<buffer>) must still be passed to the SqlFetch API call, even though it is has been removed in the corresponding SDK (VBTools) API call.

    ---------------------------

    Dim SqlStr As String

    Dim csr_SubAcct As Integer

    Call SqlCursorEx(csr_SubAcct, NOLEVEL + SqlFastReadOnly, "csr_SubAcct", "", "")

    SqlStr = "SELECT * from Subacct (NOLOCK) WHERE Sub=" & SParm(SubAccount)

    serr1 = SqlFetch1(csr_SubAcct, SqlStr, bSubAcct, LenB(bSubAcct))

    Call SqlFree(csr_SubAcct)

    '-- Update label caption

    If serr1 = 0 Then

        Call setprop(LabelControlName, PROP_CAPTION, DefaultLabelCaption & Trim$(bSubAcct.Descr))

    Else

        Call setprop(LabelControlName, PROP_CAPTION, DefaultLabelCaption)

    End If

    '-- Refresh UI

    Call DispFields(FormName, LabelControlName)

    ---------------------------

    Paul

  • Community Member Profile Picture
    Community Member Microsoft Employee on at
    Re: Journal Transactions Entry Customize to show Acct and Sub Descr

    add GLtran.user1 to the grid, call it xuser1

    in the VB editor put this code in the cacct_Chk event

    Dim ctrldacct As SIVControl

    Dim ctrlxUser1 As SIVControl

    Set ctrldacct = sivMyApp.Controls("dacct")

    Set ctrlxUser1 = sivMyApp.Controls("xUser1")

           ctrlxUser1.value = ctrldacct.value

    You can use this same logic for the subacct.  

    Ayrin

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

#2
Martin Dráb Profile Picture

Martin Dráb 228,588 Most Valuable Professional

#3
nmaenpaa Profile Picture

nmaenpaa 101,148

Leaderboard

Featured topics

Product updates

Dynamics 365 release plans