UDF Form UID
Hi all.
Anybody knows how to get the UDF Form UID corresponding to any form???
UDF Form Type is "-" & FormUID but, is there corresponding between UIDs?
Really, i need it to reference an item in UDF Form by code, and I think this is the unique way
Thnk all
Ñ: Hola a todos¿Alguien sabe como averiguar el UID del UDF Form correspondiente a uno dado?
Es decir, de la misma manera que el tipo es el tipo del formulario con "-" delante, ¿como puedo saber el UID del UDF Form?
Realmente lo quiero para referenciar un Item del UDF Form por codigo, y pienso que esta es la unica manera
Gracias
Hi
if you want to read some data of a userfield try this
put this on itemevent, this code is only for reading, isn't permitted to use setvalue in a system form
If pVal.FormTypeEx = "nnn" Then
'nnn must be the number of your system form i.e 140 delivery
'SBO_App is your application object
Dim datos As DBDataSource
Set datos = SBO_App.Forms.ActiveForm.DataSources.DBDataSources.Item("XXXX") 'puede ser OINV, ORDR o lo que sea
Dim valor As String
valor = datos.GetValue("U_YourUserField", 0)
End If
Ñ:Hola
si quieres leer de la ventana de campos de usuario pon el codigo que te he puesto arriba en el itemevent y con eso conseguiras acceder al campo de usuario del documento que tengas activo en ese momento, no se puede asignar valor de este modo si el form principal es del sistema , esperemos que en el 2005 si se pueda.
Kind regards
Salvador Biot
Similar Messages
-
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 -
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 -
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. -
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 -
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 -
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 -
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, -
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. -
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 -
Repeating of udf form on ncount
Hi,
I have developed one UDF screen with SAP default buttons. I catched the following event filters
form laod, form activate, item pressed , menu click, key down and click event. when I opened my screen it worked fine for the first time. When I open the screen second tinme, the events are firing twice. when I opend for the 3rd time it events are firing thrice and so on.
How to control these events. How to stop multiple repeating of events.
Even I made all objects to nothing before closing the form during cancel button. How to control this ?
Thanks in Advance!
MadhuMadhu,
Please see this post as it may help you ...
Event Executing Itself Multiple Times
Eddy -
Hi All,
I have added some User Defined Fields to Sales Order window. Can I place a choose fromlist in one of these UDF fields. If can, please give the code.Hi Jisha,
Vasu is right, but you can update the Sales Orders form with a new tab that contains your user fields. And in these fields you can add the CFL has you would do in a standard user form (you can even add the CFL in the XML form).
Example of the user form:
<?xml version="1.0" encoding="UTF-16" ?>
<Application>
<forms>
<action type="update">
<form FormType="139" uid="">
<items>
<action type="add">
<item uid="_Family01" type="8" left="25" tab_order="0" width="80" top="160" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family01" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific caption="Familia 1"></specific>
</item>
<item uid="Family01" type="16" left="110" tab_order="0" width="150" top="160" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific TabOrder="0">
<databind databound="1" table="OITM" alias="U_Family01"></databind>
</specific>
</item>
<item uid="_Family02" type="8" left="25" tab_order="0" width="80" top="175" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family02" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific caption="Familia 2"></specific>
</item>
<item uid="Family02" type="16" left="110" tab_order="0" width="150" top="175" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific TabOrder="0">
<databind databound="1" table="OITM" alias="U_Family02"></databind>
</specific>
</item>
<item uid="_Family12" type="8" left="25" tab_order="0" width="80" top="325" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="Family12" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific caption="Familia 12"></specific>
</item>
<item uid="Family12" type="16" left="110" tab_order="0" width="150" top="325" height="14" visible="1" enabled="1" from_pane="99" to_pane="99" disp_desc="0" right_just="0" description="" linkto="" forecolor="-1" backcolor="-1" text_style="0" font_size="-1" supp_zeros="0" AffectsFormMode="1">
<AutoManagedAttribute></AutoManagedAttribute>
<specific TabOrder="0">
<databind databound="1" table="OITM" alias="U_Family12"></databind>
</specific>
</item>
</action>
</items>
</form>
</action>
</forms>
</Application>
Than you catch the Sales Order form Load and you load the above form:
1. Catch the Sales Order form load
2. Add the new folder by code and update the Sales Order form
Try
oForm.Freeze(True)
oForm.Resize(740, 480)
Dim PaneLevel As Integer = oForm.PaneLevel
Dim oNewItem As SAPbouiCOM.Item = oForm.Items.Add("FldFam", BoFormItemTypes.it_FOLDER)
Dim oItem As SAPbouiCOM.Item = oForm.Items.Item("3") '// 3 = Id of an existing folder in the form
oNewItem.Top = oItem.Top
oNewItem.Height = oItem.Height
oNewItem.Width = oItem.Width
oNewItem.Left = oItem.Left + oItem.Width
oNewItem.AffectsFormMode = False
Dim oFolderItem As SAPbouiCOM.Folder = oNewItem.Specific
oFolderItem.Caption = "NEW FOLDER"
oFolderItem.GroupWith("3")
'// Carregar o ficheiro XML com as modificações ao formulário normal.
UpdateFormByXML(oCompany, oApplication, pFILES & " rm150_" & GetLanguageCode(oApplication) & ".srf", oForm.UniqueID)
oForm.Items.Item("FldFam").Visible = True
oForm.PaneLevel = PaneLevel
AddFamilyFolder = True
Catch ex As Exception
oApplication.MessageBox("AddFamilyFolder(): " & oCompany.GetLastErrorCode.ToString & ", " & ex.Message)
End Try
End Function
Function to update a form
Public Sub UpdateFormByXML(ByRef oCompany As SAPbobsCOM.Company, ByRef oApplication As SAPbouiCOM.Application, _
ByRef FileName As String, ByRef FormUID As String)
Try
Dim xDoc As Xml.XmlDocument = New Xml.XmlDocument
xDoc.Load(sPath & FileName)
xDoc.SelectSingleNode("Application/forms/action/form/@uid").Value = FormUID
oApplication.LoadBatchActions(xDoc.InnerXml)
Catch ex As Exception
oApplication.MessageBox("UpdateFormByXML(): ", oCompany.GetLastErrorCode.ToString & ", " & ex.Message)
End Try
End Sub
Regards,
Vítor Vieira -
Hey All,
Can anyone tell me how I can properly read a UDF field from the UDF form on the purchase order screen?
Usually i just read the text value from the activeform but of course this does not work for the UDF form as it is not the active form.
A code example on how to do this would be really appreciated.Well yes... but it's ugly...
When you open a form it gets a unique uid like "F_139"... The sidebar also get a UID, and that UID it always one higher (Sidebar for F_139 would have uid "F_140")... So with some substrings, conversion to integer, integer++ and back to a string uid you should be able to get the uid of the sidebar... problem is that if the sidebare is not active "F_140" will not exist... You can handle that using try catch or more correct check if menuitem "6913" (Userdefined Fields) is checked...
Works... Think so... Ugly... Hell yes .. I would go with the dbdatasouce solution + active-item on the main form if it was me
Maybe you are looking for
-
I am trying to set up my computer to support 2 Ipods; one under my user name and the other under my wife's. I set up the iTunes folder as a shared resource but only my Windows account can access this, I'm getting an "access denied" error when trying
-
DHCP works, static does not.
When I enable DHCP in rc.conf, my little Netgear router gives an IP address to my Arch Linux machine - and also supplies the DNS value. When I try to manually set things, it seems my DNS values are not working. My AL box can ping itself, at both 12
-
Upon start up an error message that says: Unable to locate component. Application failed to start because file MSVCP110.dll was not found. Re-installing the the application may fix this problem. The message box will not close until I click the OK but
-
Nano A1320 will not sync,will not hard reset.
This is not mine, it's my 10 year old daughter's. I don't know what she has done, she doesn't know, I'm not yet convinced she has done something to contribute to this. When I plug it into the PC on her Win7 user profile, it sort of indicates it is s
-
"Assign to desktop" only showing up on standard account
I have two user accounts on my Mac mini with my account being the administrator and the other being standard. The standard account is automatic log in while mine is password protected. When I right click on an application in the dock of the standard