cancel
Showing results for 
Search instead for 
Did you mean: 

Quotation Adjustments

Former Member
0 Kudos

Hi Guys, hope u have some idea to stop this,

I'm making a Sales Quotation, i want to catch when the Sales Quotation is created i could leave the user his last document made.

I'm catching in the FORM_DATA_ADD of the form "149" in actionsuccess=true this, then i put the form mode in search mode, put the docnum created and make a click to the button "1" to search the document, this is working fine until Business One shots an event that clears the document again.

this is my function

Dim oDocXml As New Xml.XmlDocument

oDocXml.LoadXml(Evento.ObjectKey)

Dim oDoc As SAPbobsCOM.Documents = oCompany.GetBusinessObject(SAPbobsCOM.BoObjectTypes.oQuotations)

Dim DocNum As Long = oDocXml.InnerText

Dim oFormC As SAPbouiCOM.Form = Pappl.Forms.Item(Evento.FormUID)

oFormC.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE

oFormC.Items.Item("8").Specific.string = DocNum.ToString

oFormC.Items.Item("1").Click(SAPbouiCOM.BoCellClickType.ct_Regular)

Once i do this click event B1 shots a FORM_DATA_LOAD and loads my document, I tried to let a bubbleevent=false after my function but still in some place B1 shots the clear event, can u help me how to stop this? if anyone knows..

Thanks in advance

NOTE: SB1 2005A PL36

Gabriel

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

use this procedure [SBO_SP_TransactionNotification] and change as per the ur requirement .

u can stop any thing using this procedure.

Former Member
0 Kudos

Thanks, i'll try, as far as i know this must have the same behavior as the form_dataevent, the problem is that the bubbleevent=false in the actionsucess=true does absolutely NOTHING, if this work i'll be happy, i'll try this, thanks for your support.

Answers (1)

Answers (1)

former_member201110
Active Contributor
0 Kudos

Hi Gabriel,

Perhaps you could open a new instance of the sales order form, use this to find the document that has just been created and then close the original form. In this way, you don't have to worry about the original form clearing.

Kind Regards,

Owen

Former Member
0 Kudos

I can do this, but i think is waisted time for the user, at least i can make visible or not visible the forms, if nothing works i'll try this for last. Thank u for ur support.

If i make the order different, first try the standar and the pen the another one, when i close a standar window in the form_dataevent i get a dump error, this happens to you too?

Former Member
0 Kudos

I tried to do it in the StatusBarEvent to catch a success message from that form in the specific mode and i do my function to search for the last quotation but still the clear process of the create shoots, anyone have any more ideas? do i must report this to sap?

Because for my point of view the bubbleevent=false after the actionsuccess=true of the FormDataEvent doesn't works for me. It MUST stop anything that comes after the process and it does not.

Gabriel

Former Member
0 Kudos

Dear Gabriel,

I looked in the help files and found the following facts about the "BubbleEvent".

*****************************************************

A boolean value specifying whether or not the application will continue processing

this event. Available only when BeforeAction=True.

True - Default. The application continues processing this event regularly.

False - The application stops handling this event.

This lets you insert your own event handler before returning control to the application event handler, instead

of the application event handler, or after returning control to the application event handler.

******************************

Can I suggest you to try and use the BubbleEvent when BeforeAction=True and see if it helps your cause.

There is also another way to get the document number via the "GetNewObjectCode Method". Which is actually the recommended way of getting the last docuemnt that was added.

Let us know if the above does or does not help you.

Regards

Arshdeep

Former Member
0 Kudos

Hi Arshdeep, my problem is not to find the last document created, i'm okey with that, my problem is that i need to cancell the "Clear" form process that runs when a document is created.

IF its official that BubbleEvent just works in the BeforeAction=True, that is maybe for the FormDataEvent because i can use BubbleEvent=False in the ActionSuccess=True of an ItemEvent.

I need to stop the clear process, but i can't do it in the beforeaction=true of the DATA_ADD because the document is still not created, my solution was when i catch that document is created (ActionSuccess=True) i search for this document created by this user.

I have used the GetNewObjectCode but try this, two clients pressing the add button for the same kind of document at the same time, try it 3 times, maybe one u'll get the quotations inverted, i know because we tried this, the clean way to do this search i believe is in the FORM_DATA_ADD of the FormDataEvent because that event was shooted by that user (at least for the example i gave u never inverted the documents)

Thank you for your help, if u see anything new please let me know.

Gabriel