Setting Document Type with a Macro

Answered

Comments

8 comments

  • Official comment
    Avatar
    Yaremi Miranda Lopez

    Hello Stuart,

    I have a macro that changes the document type when the Business Partner is selected and it works fine. Here is it:

    Comment actions Permalink
  • Avatar
    Nadav Caridi

    Hi , 

    you can use set focus / send keys with enter after setting the value, just be aware that send keys isn't recommended by boyum.

    might be a cleaner way to do this (?)

    Comment actions Permalink
  • Avatar
    Stuart Blackwell

    In theory that should work, but in practice, after using either Focus or Click to select the ComboBox,  no following input works. Using Set, or SendKeys has no impact on the screen and the ComboBox remains open awaiting user input.

    Comment actions Permalink
  • Avatar
    Nadav Caridi

    ok try use dynamic code as follows : 

     

    SAPbouiCOM.ComboBox myCombo = (SAPbouiCOM.ComboBox)form.Items.Item("3").Specific;
    myCombo.Select("S", SAPbouiCOM.BoSearchKey.psk_ByValue);

    Comment actions Permalink
  • Avatar
    Stuart Blackwell

    Aside from needing the change "S" to "I" for setting it to Item Type, it works perfectly. Thank you.

    Comment actions Permalink
  • Avatar
    Nadav Caridi

    Sure , maybe theres a better way to do this with B1UP , I'm not sure.

    Glad it worked. 

    Comment actions Permalink
  • Avatar
    Stuart Blackwell

    Thanks for the official comment Yaremi, but that is exactly what I was trying to do originally and it did not work for me.

    Comment actions Permalink
  • Avatar
    Yaremi Miranda Lopez

    Hello Stuart,

    Maybe the event is not triggering the universal function, I tested and worked for me, if the problem persists please contact your local support so we can investigate further. =)

    Comment actions Permalink

Please sign in to leave a comment.