Action stopped message during Form Data Event in SAP B1 - sapb1

I make some validations in Form Data Event on Update data button and
I set the bubbleEvent to false when validation returns false.
I am getting the error on Form data event:
Action stopped by add-on (UI_API -7780) [Message 66000-152]
Is there any suggestions how to prevent this issue?

I don't think this is an issue, this is the intended functionality. If you don't want the user to get the error, just catch that Exception message and suppress it.

Related

How can I trap an error when Access starts up, before the first form is loaded?

I have an Access database with linked back end tables that I relink at runtime, depending on user input. My problem is that at startup they have the wrong link and I get an error message. I just want to stop the error message coming up. It happens as soon as Access starts, before any form is loaded, so trapping it in the form load event is too late! Any suggestions, please?

Microsoft Access VBA on open error

Basically I am populating my form with data from a database. For this I have an onopen event with just this code inside:
Me.Requery
Everything worked perfectly fine until yesterday, were out of the sudden an error occured. The error states:
The expression OnOpen you entered as the event property produced the following error: Instruction invalid outside of a type-block.
Aditional it says in the Discription:
The expression may not result in the name of a macro, the name of a user-defined function, or [Event Procedure]
There may have been an error evaluating the function, event or macro.
When I go to show help it says:
This error occurs when an event has failed to run because the location of the logic for the event cannot be evaluated. For example, if the OnOpen property of a form is set to =[Field], this error occurs because a macro or event name is expected to run when the event occurs.
However, when I click the message away, everything loaded correctly.
I am using:
-Microsoft Access 2013
Q&A:
Does your code compile successfully?
Yes, the rest works fine. It also loads everything into the form correctly. But Every time I start it, this info filed pops up.
EDIT: I just noticed that all my on click events throw the same error now.
Could you show the whole code?
I actually have everything else commented out to troubleshoot the error. If I delete the onopen event the info box disappears.
As mentioned in the comments, compilation can fix the problem by finding errors like wrong access modifiers
When compilation goes fine, one should delete the Form_Load function and let IDE recreate it. This fixed my problem thought apparently no change in code was observed.
Many thanks
My problem was naming a label with a Farsi name. After correcting it in English, the problem was solved

Event in outlook application object model to know when the first click happens on message body box?

I am developing a add-in to perform some actions when the first click happens on the message box in outlook (2013 version). I want to capture the Outlook.MailItem.Recipients as soon as the first click happens on message body box.
Possible approach to do this (just did a quick test, seems to work for 2013):
Register to NewInspector event of the Application object:
Application.Inspectors.NewInspector += ....;
In the event handler, register to the following event:
var editor = newInspector.WordEditor as Word.Document;
editor.Application.WindowSelectionChange += ....;
The handler fires when the selection changes, which is also happening when the user clicks the window.
Please note that you must keep references to all objects in this sample, else the event registrations will get lost.

Error Closing a Form Through a User Control

In the program I'm writing, there is just one form. I've made a user control visible and it contains several buttons. One of the buttons is supposed to close the form when clicked. I can't find any way to do this without getting the error: "Cannot access a disposed object. Object name: 'ShapeContainer.'" I'm pretty sure I understand the problem; after the form has been closed, the user control no longer exists, so there's an error when Form.Close() (I've tried Form.Dispose() too) has completed and it tries to go back to the code inside the button click event. Does anyone know how I could accomplish closing the form through this user control's button without getting the error?
Okay I'm pretty new to vb but I think if you get rid of the Form.Dispose() & Form.Close then try Me.Close() as you are referring to the current Form that the button control is located on.
You Should have got this error:
(Error 1 'NameSpace_.Form1' cannot refer to itself through its default instance; use 'Me' instead.)

Attach javascript confirmation dialog to a linkButton/form in Repeater ItemCommand

I have a repeater and in its ItemCommand code, I need to do a database check if some records deleted and if yes, ask if the user wants to continue. Something like this
If e.CommandName="Clone" Then
'Do the database check to see if records deleted and if yes
'show a confirmation dialog and if user answers "yes" continue, if "no" stop
End If
The command "Clone" is coming from a LinkButton. Also, I want to do this in ItemCommand instead of ItemCreated or DataBound because I do not want the check to be added for every record. It only executes when I click the Linkbutton
Is this possible? Thanks.
You could do this a couple of ways.
One way would be to instead of doing a full post back when the link button is clicked make an ajax call to the server to see if the record is deleted. Then you could display the javascript confirmation dialog after the ajax request is complete. If the user answers 'yes' then you could make another ajax request or trigger a full postback via __doPostBack to a clone event handler with the appropriate arguments.
Here is a simple way to make an ajax call: Calling a webmethod with jquery in asp.net webforms
An alternative method would be to do the initial full post back to the server, do the database check, and then return some javascript to the client which would cause the confirmation messsage to display. Then you would handle the result of the confirmation via javascript and do an ajax/full post back as necessary to perform the clone.
gl