cancel
Showing results for 
Search instead for 
Did you mean: 

Change BusinessPartner on Sales Orders form

Former Member
0 Kudos

Hi, all.

I need to customize the Sales Orders creation in order to do some initialization on the form when the user changes the Business Partner.

The SDK does not seems to provide an event that notify for the user selection change on the BP item. How can I do that?

Thanks in advance.

Accepted Solutions (0)

Answers (1)

Answers (1)

former_member183373
Active Participant
0 Kudos

Hello Daniele,

As I understand you want to customize the Sales Orders form according to user's Business Partner selection. You can use the ChooseFromListAfter event to catch that.

Here is a sample code block.

private SAPbouiCOM.EditText EditText0;

public override void OnInitializeComponent()

        {

            this.EditText0 = ((SAPbouiCOM.EditText)(this.GetItem("4").Specific));

            this.EditText0.ChooseFromListAfter += new SAPbouiCOM._IEditTextEvents_ChooseFromListAfterEventHandler(this.EditText0_ChooseFro             mListAfter);

            this.OnCustomInitialize();

        }

private void EditText0_ChooseFromListAfter(object sboObject, SAPbouiCOM.SBOItemEventArg pVal)

        {

            Application.SBO_Application.MessageBox("Choose From List After Trigerred");

        }

Note: You can also use KeyDownAfter event in case user enters name of the business partner manually.

Regards,

Atilla

Former Member
0 Kudos

Thank you very much Atilla for your quick response.

I've tried the way you suggested but after the event SAP B1 can warn about exceeding the credit limit and the system could cancel the BP chosen skipping events on the EditText if the user press "NO" on the MessageBox.

I've obtained something working around on a combination of events with lost focus + CFL after + form activate after, forcing the focus lost at the return of CFL but this solution is very tricky and hard to stomach.

Regards,

Daniele