UDF Form et_KEY_DOWN event.
Hi all,
Has anyone had problems with the above event? I cannot seem to trap it on a UDF form, it works fine on a standard form. Using SBO 6.5 SP1 P7. For example:
- This code works fine.
Set oFilter = oFilters.Add(et_CLICK)
oFilter.Add -139 'Sales Order UDF form.
If pVal.FormType = -139 And pVal.EventType = et_CLICK Then
oApp.MessageBox "hello"
End If
- This doesn't work.
Set oFilter = oFilters.Add(et_KEY_DOWN)
oFilter.Add -139 'Sales Order UDF form.
If pVal.FormType = -139 And pVal.EventType = et_KEY_DOWN Then
oApp.MessageBox "hello"
End If
Any suggestions?
Regards,
Andrew.
Hi,
SBO catches the KEY_DOWN event only if one of controls of the form has focus
Regards,
Mark
Message was edited by: Mark Gulyansky
Similar Messages
-
Hi all
i wish to open the Side form which shows the UDF fields for a given system form. question is how can i open the form through code?
once i've opened the form i wish to set the visibility of the UDF fields appearing in the UDF form.
question is how do i obtain the from's object in order to set the appearance of the UDF items within it?
appreciate the help
Yoav
Message was edited by:
YECHIEL SCHUSSEIMHi Yoav,
If Not SBO_Application.Menus.item("6913").Checked Then
SBO_Application.SendKeys "^+U"
End If
6913 is user defined field menu item id.
you can see user defined form is opened everytime you open a certain form with that code samples in form_load event.
hope this can help you.
Regards,
Hyunil. -
How to know if a UDF form is opened else then using a TRY CATCH ?
I'm looking for any way to find out if the UDF form is visible
else then trying to open it in a try catch and if it's not sending a key. This if very ugly, slow and not really my kind.
I tried to iterate through all the forms in SBO_Application.Forms but it's not there. All I see is the main form
I just need to make sure the UDF form is visible when Inventory form is loaded so I can put a value in one of the UDF
If there's a better way I'm buying itHi Marc,
Rather than putting your data in the UDF in the UDF side form, you can add a control to the main form (during the load event of the form) and bind this to the UDF through the DBDataSource that is already available on the main form. This means that you don't need to worry about whether the UDF form is open or not because you can always read or write to your UDF data from the main form.
Alternatively, the UDF form TypeEx property is always the same as the main form but with a minus sign in front. Therefore, if you know the TypeEx and FormTypeCount of the main form then you can use the GetForm method of the Application object to get the UDF form.
oForm = _sboApp.Forms.GetForm("-" + oMainForm.TypeEx, oMainForm.TypeCount);
You'd still need a try/catch around this and if it raises an error then activate the 6913 menu to open the UDF form.
Kind Regards,
Owen -
Hi All,
We have observed a strange behaviour in SAP UDF , ie; whenever the control goes to any of the UDF field the main form and the UDF form are getting refreshed many times. or in more acurate terms, the FORM_ACTIVATE and FORM_DEACTIVATE events are triggerred at least 30 -40 times on both the forms.
The problem is that , the same is very much visible if the UDF is a edit text field and not a combo field and there is a formatted search obn that field . If the user selects the values from the formatted search screen ( from a list of valus) , after the value is selected the field flicker many times...
Is there any way to get aroud this problem . Our clients are not accepting this behaviour of SAP.
Regards,No. Even if no SDK is running also the same problem happens. Is it the normal SAP behavour.? Can this be changed?
Regards, -
Updating UDFs in the UDF form of a sales order
I got the UDF form of a corresponding main sales order form.
I am trying to set a value for one of the UDFs there, but I get a 'General Failure' exception (Simply trying to set the edittext's UDFItem.Value or UDFItem.String properties)
I know I have the right form and item, since I can change the item's BackColor.
The DBDataSource.GetValue works, so I can read the existing values.
The DBDataSource.SetValue doesn't work, but I'm used to it
Any ideas?Avi,
We cant use Setvalue directly in Predefined for u better to use
Frm.items.item("").Specific.Value= ""
Regards,
Anitha -
How to run recordset SQL query in FORM DATA event
How can I run recordset SQL query in FORM DATA event upon clicking on Add button in the document?
Hi Slamet,
When you receive a form data event you have a class containing inside it a ObjectKeys xml info regarding the object added/modified,...
With the objects keys you can then use the DI API method called GetByKeys to obtain the DI Object.
There is some information about it in the SDK Help file, mainly in the "FormDataEvent" class definition:
<i>The event provides the unique ID (BusinessObjectInfo.ObjectKey) of the modified business object. You can use the value of this property as an input parameter in the DI API DataBrowser.GetByKeys method to get a DI object.</i>
Pay attention you don't have this information in the Before=True event of the Add as it is not yet in the database.
Hope it helps
Trinidad. -
Check Weather UDF Form Exist or Not ?
hi,
I have to work on UDF Fields and problem is that i have to check weather UDF Form (right hand side form which is visible only when we click VIEW>User Defined Field)
is visible or not.
Do any one know such method/varible by which i would be able to know that UDF form is visible / not visible....
Regards ,
GaneshHi Ganesh,
You can check the status of the menu visible and/or checked to see if the UDF form is visible.
Regards
Ad -
Handling TackOn form or UDF Form
HI all,
Can we make any single field disable in Tack-On form (UDF form with -ve form id) for system forms. So that users can able to see but can't change.
Is there any way found without using categories.
regards:
sandyHello
On Form You may press CTRLSHIFTB which is the UDF form settings ,then uncheck the editable flag.
You can also you the columnpreferences object to set it visible and disabled. Please note, the column preferences is saved when B1 is exiting.
Regards
János -
How to Execute a code in form postSubmit event
Dear all,
I have a simple code which is executed perfectly when I put it in form :preSubmit: event but when i moved it to the :postSubmit: event it doesn't work at all .
Please let me know where to put my code if I need it just to be executed once the form submitted ??
Thanks in advanced,
Mohammed Al-MoslehTry using this code:
var vMsg = ""; //message to display for the missing required fieldsvar successflag = 1; //flag to determine if any required field is null
//validate all required text fields
for (var nPageCount=0; nPageCount<xfa.host.numPages; nPageCount++) {
var oFields = xfa.layout.pageContent(nPageCount,"field");
var nNodesLength = oFields.length;
for (var nNodeCount=0; nNodeCount<nNodesLength; nNodeCount++) {
if (oFields.item(nNodeCount).mandatory == "error" ){
if (oFields.item(nNodeCount).rawValue=="" || oFields.item(nNodeCount).rawValue==null){ vMsg += oFields.item(nNodeCount).name + ", ";
successflag = 0;
---------write your code
if (successflag == 1)
execute the insert into database code
else
xfa.host.messagebox(vmsg); //displays the missing field names
Regards,
Chaitanya -
Invalid Item in Form Load Event
Hello,
i have a problem to access items in Form Load Event. If I use a form created with screen painter and I want to set some values to items (EditText, Grid, ComboBox) in FormLoad event. I get a message "invalid item". Same if I use the event FormActivate. Is it a bug? And if yes, when do you fix it?
Best regards,
AlexanderHi Alex,
I haven't try the code, but I think there are just one things to try.
I think, is convenient to use the FormUID params to retrive the form instead the use of Forms.GetForm() method.
Please try this one and let us know the result.
Private Sub moSBOApplication_ItemEvent( _
ByVal FormUID As String, _
ByRef pVal As SAPbouiCOM.ItemEvent, _
ByRef BubbleEvent As Boolean) Handles sboApplication.ItemEvent
Try
If Not (pVal.FormTypeEx = "frmPlan") Then Exit Sub
Select Case pVal.EventType
Case BoEventTypes.et_FORM_LOAD
If pVal.BeforeAction = True Then Exit Sub
oForm = sboApplication.Forms.Item(FormUID) ' try this one
oForm.EnableMenu("1288", True)
oForm.EnableMenu("1289", True)
oForm.EnableMenu("1290", True)
oForm.EnableMenu("1291", True)
initGridAD(oForm)
Case BoEventTypes.et_FORM_ACTIVATE
If pVal.BeforeAction = True Then Exit Sub
oForm = sboApplication.Forms.Item(FormUID) ' try this one
initGridAD(oForm)
End Select
Catch ex As Exception
sboApplication.SetStatusBarMessage(ex.ToString(), BoMessageTime.bmt_Short, True)
End Try
End Sub
Private Sub initGridAD(ByVal oForm As Form)
Dim oGrid As Grid = oForm.Items.Item("gridAD").Specific ' *here I'm gettig an error*
Dim oDataTable As SAPbouiCOM.DataTable = oForm.DataSources.DataTables.Item("DTgridAD")
If not oDataTable.Rows.Count = 0 Then Exit Function
oGrid.DataTable.ExecuteQuery("Select '' as 'Choose', SlpCode as Code, SlpName as 'Name' From OSLP")
oGrid.Columns.Item("Choose").Type = BoGridColumnType.gct_CheckBox
End Sub
Is this code hosted in a module or in a class?
If is in a class, how many instancens of class exist when you get the error?
Hope this helps.
Carmine -
To disable close button of the UDF form
Hi,
I need to disable the close button of a UDF form. Can anyone help me pls.
Manu.Hi Manu,
Herewith a code example... This would disable the close button on the Sales Order window (and only the first window)
Dim oform As SAPbouiCOM.Form
<i>'loop through all the forms here if you need</i>
<i>'i am using "-FormType" here as the UDF window has the same UID as the normal form, but with negative sign</i>
oform = oApplication.Forms.GetForm("-139", 0)
Dim oItem As SAPbouiCOM.Item
<i>'Close button is 4</i>
oItem = oform.Items.Item("4")
<i>'Disable button</i>
oItem.Enabled = False
Hope it helps,
Adele -
How to handle form close event or escape key press event for user defined f
Experts,
Please let me know how to handle form close event or escape key press event for user defined form...
Thanks & Regards,
Pravin.Hi
You can catch the form close event like this
If ((pVal.FormType = 139 And (pVal.EventType = SAPbouiCOM.BoEventTypes.et_FORM_CLOSE)) And (pVal.Before_Action = True)) Then
Try
SBO_Application.SetStatusBarMessage(pVal.EventType.ToString())
Catch ex As Exception
SBO_Application.SetStatusBarMessage(ex.Message)
End Try
End If
Hope this helps
Regards
Arun -
Hi all,
Do you know where in the database is the information about whether or not to display the UDF form for a given standard form and a given user?
Thanks in advance,Hi Cyril,
I think it is stored in the OUSR table, in the UserPrefs field. But the field is binary and you can´t get understandable data from there.
Sorry,
Ibai Peñ -
Obtaining UDF form type and ID
Hi all
i want to obtain the ID and Type of a UDF form which opens as a side form for a given SBO form. question is how can i obtain the ID and Type of the UDF form thourgh code?
appreciate the help
YoavHi Yechiel
Trying with the following code:
Get ID of Item : pVal.ItemUID
Get Type of Item: oForm.Items.Item(pVal.ItemUID).Type.ToString
I hope useful for you!!
Regards -
hello everybody
i wanted to get a reference of the used defined field form which is associated with the active system form
can someone suggest me what the best way to do it???I wrap a try block around the attempt to retrieve the udf form & if that
fails I activate the UDF form.
try
Form UFForm = B1Connections.theAppl.Forms.GetForm("-" + form.TypeEx, form.TypeCount);
catch
B1App.ActivateMenuItem("6913") 'display udf screen
Form UFForm = B1Connections.theAppl.Forms.GetForm("-" + form.TypeEx, form.TypeCount);
end try
I think I mixed C# & VB code in there, but I'm sure you get the idea.
Maybe you are looking for
-
Advantages of new iTunes account over sharing mine for child?
Hi - I've tried to read through the previous discussions but there are so many and many were before iOS 5 - here's the situation: My husband got a new iphone 4s so we disabled the AT&T contract on his 3GS and want to give it to our daughter. She cur
-
Old mail has reappeared in grey?
Help! On Saturday we had a clean inbox on Sunday 1,842 old emails from January 2006 to the present showed up in our inbox and drafts folder. They're all greyed out and can't be deleted. My IP says it's not their deal. In our Mail Preferences, our mes
-
I have a minute long video where I am following a person walking and filming his back. The person stops and when he turns around I want to blur out his face. How do I go about doing this. I have tried using the fast blur effect but it blurs the whole
-
Hello, a wonderful Apple employee encouraged me to post my question(s) here. Right after I got my first Mac computer ever, Macbook Pro 15'' I installed the trail version of Adobe Photoshop, CS3 or CS5. Used it, loved it, but didn't buy it. I also tri
-
Suitcase hangs when Retrospect is installed
Can anyone please help me? I just installed the backup-application Retrospect from Dantz, first on my Powerbook G4, running OS 10.3.9. From that day on I had great problems with the font-application Suitcase from Extensis (even if Retrospect wasn't r