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

Community site session details

Session Id :
Microsoft Dynamics SL (Archived)

ask - name of main buttons

(0) ShareShare
ReportReport
Posted on by 3,205

hi there,

need help please.

almost in each screen, there are buttons in 1 line. the buttons are:

- new, save, cancel, finish, and so on.

in customization menu, what is the name of those buttons? since I can't select those button. maybe I can make manipulation over VB script / editor.

 

thanks before

*This post is locked for comments

I have the same question (0)
  • Barry Flynn Profile Picture
    3,090 on at
    Re: ask - name of main buttons

    What are you trying to do with those buttons?

    You cab "press" them using the "edit_" series of calls - is

     call edit_save

    You can write code that is executed when they are pressed - ie in the Update1_OnUpdate event (for the Save button.)

    In VBTools, you can enable them or disable them using the SetButton calls.

    I'm not sure offhand if they are available in Customizations.

    If they are, there is a customization rule that you can make things "tighter" but not "looser" - ie you can, for example, disable a button that is enabled, but you can't enable one that the screen itself has disabled.

    Are those comments any use?

    Barry

  • rodi Profile Picture
    3,205 on at
    Re: ask - name of main buttons

    Hi there,

    I wanna perform prior checking for some fields, if the fields fulfill the condition that I've determined before, then the process may continue, otherwise the process stop/can't be process.

    is it possible?thanks before

  • Barry Flynn Profile Picture
    3,090 on at
    Re: ask - name of main buttons

    So you want to prevent the SAVE operation from taking place under some conditions?

    If so, you can use the Update1_OnUpdate event.

    Be aware that in a Save, this event can fire multiple times - once for each Level that is being saved, plus maybe an extra time at the beginning and/or the end of the Save operation.

    You could write code like this

       if Level = WhateverLevelYouAreChecking then

           if DataIsNotCorrect then

               call MessBox("An Error Message", mb_ok, "VBA Editing")

               retval = ErrNoMess

               exit sub

          ens if

      end if

    As soon as you exit from that event with RetVal set to ErrNoMess, the kernel will abandon the Save operation.

    Does that help?

    Barry

  • rodi Profile Picture
    3,205 on at
    Re: ask - name of main buttons

    hi Barry,

    thanks for your help. yes it makes me more understand, but still confuse where I suppose to put on the script, in (general) or in one of procedure event.

    and need help for -before screen process for Save/finish-, system must do:

    - check entry on field in another screen, if data on that field fulfill the condition, then screen allowed to do save/finish process

    - else: exit from that event

    the field(s) which need to be checked, is computed by that other screen.

    hope you can understand what I mean.

    thanks before

  • Barry Flynn Profile Picture
    3,090 on at
    Re: ask - name of main buttons

    << but still confuse where I suppose to put on the script, in (general) or in one of procedure event.

    I think the Update1_OnUpdate event is the place to do it - that fires when a SAVE takes place, and (as noted earlier) it gives you the ability to abort the Save operation if the data entered is not acceptable to your code.

    >> help for -before screen process for Save/finish

    As noted, the code you write in the Update1_OnUpdate event has the ability to abort the Save operation.

    If it does so, the entire Save operation should get rolled-back so that "it never happened"  (provided that both the host screen, and your code, "obey the rules" for database transactions.)

    Barry

  • Barry Flynn Profile Picture
    3,090 on at
    Re: ask - name of main buttons

    << I think the Update1_OnUpdate event is the place to do it

    Just in caase that terminology was confusing, I am talking about the OnUpdate event of the Update1 control.

    So, in VBA, you find the Update1 control in the left hand drop-down box, then find its OnUpdate event in the right hand drop-down box.

    Barry

  • rodi Profile Picture
    3,205 on at
    Re: ask - name of main buttons

    hi Barry,

    yes you are correct. thanks for clear explanation about this.

    I just need create new procedure (which is as "update1"), then I choose event for "_onupdate".

    also, is it same with VB, when I create procedure/function:

    function1_onupdate(variable1,variable2)

    can I apply that technique to VBA? and will it do same behavior with VB?

    thanks before

  • Barry Flynn Profile Picture
    3,090 on at
    Re: ask - name of main buttons

    Sorry but I'm not sure what you are asking here.

    The same event is available

    (a) In the SDK (aka VBTools), used for writing a new screen

    (b) In Customization manager - for both VBA code and the older BSL code

    From memory, in all cases, the control is Update1.

    The name of the event may vary a bit ("Update", or

    "OnUpdate" etc.

    In all cases, you select the Control, then select the Event that you require.

    "The system" will then create the (empty) Sub for you, with the required parameters.

    Barry

  • rodi Profile Picture
    3,205 on at
    Re: ask - name of main buttons

    hi Barry,

    when I try to run the code, show message error:

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

    Microsoft Visual Basic

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

    Compile error:

    Procedure declaration does not match description of event or procedure having the same name

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

    OK   Help  

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

    name of procedure is:

    Private Sub update1_onupdate()

    may you give me help? thanks before

  • Barry Flynn Profile Picture
    3,090 on at
    Re: ask - name of main buttons

    << Private Sub update1_onupdate()

    No that us definitely not correct.

    And "editing it" is not likely to help - I strongly suspect that "something is wrong" and any code you may write in that event will not get executed during a Save.

    Before we get further into this, can you please tell me:-

    - Are you writing a new screen using the SDK?

    - Or are you writing Customization code for a screen that already exists?

    If you are writing customization code:-

    - Which screen is it?

    - Are you writing VBA or BSL (they have some differences)

    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…

Pallavi Phade – Community Spotlight

We are honored to recognize Pallavi Phade as our Community Spotlight honoree for…

Leaderboard > 🔒一 Microsoft Dynamics SL (Archived)

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans