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)

Display combo box for just one company

(0) ShareShare
ReportReport
Posted on by

Hi

I have added a combo box to a screen in Dynamics SL7, but would like to hide it from all but one company, is this possible? 

I added the box at 'one group' customization level which hides it from most users, but when the users in that group log into a different company db they still have the box

Thank you for any help

*This post is locked for comments

I have the same question (0)
  • Verified answer
    Jeff Trotman Profile Picture
    275 on at

    Here's some VBA code that should do it.

    While in Customize Mode, select Visual Basic Editor from the Customize menu.  From the code window that appears, choose Form1 from the drop down box at the top on the left, and Load from the drop down box at the top on the right.

    This should insert this into your code window:

    Private Sub Form1_Load

    End Sub

    Between these two lines, paste this code but change the "ABC" to the CpnyID that you want this to visible in, and "cdocdesc" (in 2 places) to the name of the combo box you added.

       Dim strCpnyID As String

       Call GetBufferValue("bpes.CpnyID", strCpnyID)

       If Trim(strCpnyID) = "ABC" Then

           Call setprop("cdocdesc", PROP_VISIBLE, False)

       Else

           Call setprop("cdocdesc", PROP_VISIBLE, True)

       End If

    From the Visual Basic Editor, choose File, Close and Return to Solomon Screen and then save your customization like normally. Close the screen and re-open it and the combo box should show (or not) based on the company you are logged into.

  • Community Member Profile Picture
    on at

    Hi Jeff

    Thank you very much.

    This worked like a charm.

    Do you know any good resources where i can learn more VBA code?

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