Link Button to UDO in my Grid
hi,
is ther a way to implement a link button im my Grid Column and bind it to an existing UDO ?
I'm using SBO 2007A SP00 PL37.
the following code, shows the link button and links to an item
oGrid.Columns.Item(0).Type = SAPbouiCOM.BoGridColumnType.gct_EditText
oCol = oGrid.Columns.Item(0)
oCol.LinkedObjectType = 4
i tried to link to my udo by the following but without success:
oGrid.Columns.Item(0).Type = SAPbouiCOM.BoGridColumnType.gct_EditText
oCol = oGrid.Columns.Item(0)
oCol.LinkedObjectType = "UDO_VM_CONTRACT"
I'm looking for a way of direct linking. Now i try to do the following workaround, but maybe there is a better way to solve this problem:
Case SAPbouiCOM.BoEventTypes.et_MATRIX_LINK_PRESSED
If pVal.BeforeAction = False Then
BubbleEvent = False
moSboApplication.ActivateMenuItem("VmContract")
End If
best regards
Markus
Edited by: Markus Rewak on Jul 10, 2008 11:11 PM
Edited by: Markus Rewak on Jul 10, 2008 11:12 PM
Hi Madhu,
the udo object type is not working. To get the drill down functionality you have to use the item-object (4) and catch the matrix link pressed event and search the udo by your own logic.
' Add a link button to a column
oGrid.Columns.Item(0).Type = SAPbouiCOM.BoGridColumnType.gct_EditText
oCol = oGrid.Columns.Item(0)
oCol.LinkedObjectType = 4
Case SAPbouiCOM.BoEventTypes.et_MATRIX_LINK_PRESSED
If pVal.ColUID = "Vnr" And pVal.BeforeAction = True Then
BubbleEvent = False
Dim sLink As String
Dim oGrid As SAPbouiCOM.Grid
oGrid = oForm.Items.Item("Gcont").Specific
oGrid.DataTable = oForm.DataSources.DataTables.Item("DTcont")
sLink = oGrid.DataTable.GetValue(0, pVal.Row)
moSboApplication.ActivateMenuItem("VMarkus")
moSboApplication.Forms.ActiveForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE
moSboApplication.Forms.ActiveForm.ActiveItem = "txtdocnum"
moSboApplication.Forms.ActiveForm.Items.Item("txtdocnum").Specific.value = sLink
moSboApplication.Forms.ActiveForm.Items.Item("1").Click(SAPbouiCOM.BoCellClickType.ct_Regular)
End If
End Select
This works very well.
have fun
Markus
Similar Messages
-
Link button for udo in the xml
Hi all ,
I know how to link a system object like this.
<column AffectsFormMode="1" backcolor="-1" description="" disp_desc="0" editable="1" font_size="12" forecolor="-1" right_just="0" text_style="0" title="Code" type="116" uid="202" visible="1" width="80">
<databind alias="U_ItemCode" databound="1" table="@APS1"/>
<ExtendedObject linkedObject="4"/>
</column>
but how can I link a UDO ? if My UDO' name is MUDO ,I write the XML like this,
<ExtendedObject linkedObject="MUDO"/>
and I always got error . who know ?
thanksHi Wei,
That's because you can't link to UDO's. There is no object type for an UDO. You should use onject type NONE and make the logic behind it yourself. (Capture the linked button press event and handle all actions)
Hope this helps,
Rowdy -
Link button in grid column to UDO
Hi,
I read through the posts regarding linking to user-defined objects, but I found it very confusing. Some posts say that it is not possible to create a link button to a UDO; others say you need to use the extended-object property.
Does anyone have code that I could use to designate a grid column as a link to a UDO?
The code I'm using is:
oGrid.Columns.Item(1).Type = SAPbouiCOM.BoGridColumnType.gct_EditText
txtColumn = oGrid.Columns.Item(1)
txtColumn.Width = 83
txtColumn.LinkedObjectType = ???
I need to fill in the "???".
If I designate an SAP B1 object type it works.
Thanks,
MikeRasmus,
Thanks for taking the time to provide a detailed explanation. I think though that SAP needs to solve these kinds of problems. It is my understanding that the main design goal of Business One is to provide an infrastructure that would reliably enable customization around it. There is no such thing as accounting software that does not need some kind of adaptation to make it work for specific kinds of business models. So a design that makes customization easier makes a great deal of sense.
If it is necessary to improvise in order to do what you need, then this design goal has not been met. It also means that Business One is not what is managing the process because you are effectively going around it. This in my view is actually worse than if Business One made these links work. By forcing us to go around it, we effectively loose the data protection that Business One should be providing. This is my take on it anyway.
We solved the problem by opening the appropriate form with the appropriate data in it by using the double-click event. The reason we have to do it this way is because the SDK will not even display the link button in a grid if its target is a UDO. This brings up another reason for the SDK to be more cooperative with these efforts. SAP has provided a detailed document describing the need to not deviate from Business Ones look and feel. Perhaps SAP needs also to provide an SDK that more reliably and easily enables that caveat.
If Business One had been designed from the ground up using SOA, its original design goal would be a lot easier to meet. Maybe this is the real problem.
Thanks,
Mike -
Hai To All,
Iam creating reports for my module. For that iam using grid to display the fields. Now my issue is i want to place the link button(Orange arrow) for specific fields.
For Example,
For Supplier Code iam placing the following code so that i can able to get view the link button and if i click i can able to open the Business Partner.
Grid.Columns.Item(0).Type = SAPbouiCOM.BoGridColumnType.gct_EditText
Dim oCol As SAPbouiCOM.GridColumn
oCol = Grid.Columns.Item(0)
oCol.LinkedObjectType = 2
Similar to that i want to create link button for my user defined screen that is my screen.I registered as UDO as "PI_UDO"
Grid.Columns.Item(0).Type = SAPbouiCOM.BoGridColumnType.gct_EditText
Dim oCol As SAPbouiCOM.GridColumn
oCol = Grid.Columns.Item(0)
oCol.LinkedObjectType = "PI_UDO"
If i give "PI_UDO" as my linked object it is not accepting.No error display also....
If i use none option for linked button,
Grid.Columns.Item(0).Type = SAPbouiCOM.BoGridColumnType.gct_EditText
Dim oCol As SAPbouiCOM.GridColumn
oCol = Grid.Columns.Item(0)
oCol.LinkedObjectType = -1
I cant able to view the link button......
Weather we can able to create link button for our screen???
In Forum someone told that we can....But some told as cannot??
What is the solution for this???
Its an urgent requirement can anyone help me.......
Regards,
Anitha
Edited by: ani nazir on Jul 30, 2008 11:06 AMThanks Petr,
If i use like that i can able to open the screen but there is an error
"No Matching Records found in Business Partner"
In Matrix Item Link press event i made bubbleevent=false
Regards,
Anitha -
Link Button to open an UDO Object Form
hi
I was trying to open my udo form using a link button in a data grid. But i just cannot link the object.It is working fine with system forms.But i just want to know how to link an UDO Object.hai Manish,
you just catch the row you clicked and get the data with your linkbutton which you have clicked then activate your UDF (by activating menu event) and then perform the find action according to the data.......
i hope this helps .....
Regards.....
Chethan B.E.
9342504047
[email protected] -
Link button to User Defined Object in Grid
Hi,
I'm using SAP B1 8.81 with B1DE.
I have added a grid which is populated from a DataTable to a form.
One of the columns in the grid contains the DocEntry of a User Defined Object.
How can I display a link button on the grid ?
Regards,
BenHello Ben,
You need to set the column object type.
Dim oGrid As SAPbouiCOM.Grid = oForm.Items.Item("MyGrid").Specific
oGrid.Columns.Item("DocEntry").Type = BoGridColumnType.gct_EditText
Dim oEditCol As SAPbouiCOM.EditTextColumn = oGrid.Columns.Item("DocEntry")
oEditCol.LinkedObjectType = "2" 'The SDK documentation says you should use the value 0, but in previous versions it didn't work, so I recommend you user a value other than -1 or 0
You then need to catch the et_MATRIX_LINK_PRESSED event and other your user form...
From the SDK Help File regarding the BoLinkedObjectType enum
lf_None -1 No target object
lf_UserDefinedObject 0 User-defined object
lf_GLAccounts 1 G/L account object
lf_BusinessPartner 2 Business Partner object
lf_Items 4 Item object
lf_SalesEmployee 53 Sales employee object
Regards,
Vítor Vieira -
hi friends,
I am trying to insert a link button in my grid (column1)
I created a user form with a grid.
Now in that grid (first column) i want to insert a link button,which will call a system form(like sales order screen)
i'm pasting piece of code (vb.net)related to my grid
so plz send me code how to get link button in my grid and where i can insert that code
' Add a Grid item to the form
oItem = oForm.Items.Add("MyGrid", SAPbouiCOM.BoFormItemTypes.it_GRID)
' Set the grid dimentions and position
oItem.Left = 20
oItem.Top = 100
oItem.Width = 520
oItem.Height = 300
' Set the grid data
oGrid = oItem.Specific
oForm.DataSources.DataTables.Add("MyDataTable")
oForm.DataSources.DataTables.Item(0).ExecuteQuery("select DocNum from [@SALCO_H]")
oGrid.DataTable = oForm.DataSources.DataTables.Item("MyDataTable")
' Set columns size
oGrid.Columns.Item(0).Width = 50
'oGrid.Columns.Item(1).Width = 60
'oGrid.Columns.Item(2).Width = 130
' Get the added form object by using the form's UID
oForm = SBO_Application.Forms.Item("frmGrid")
Thanks & Regards
SARANThenks for u r reply , i gone through that link it is helpful for me but still i have a problem,
now i'm getting linkbutton but it is not performing any function,though i gave the code for that link button and related screen id like <b>2</b> for business partner or like <b>bplist</b>
and <b>one more problem</b> i was facing with grid is
i created a grid in my user screen and i want to get the <b>form settings</b> for that grid(if i click <b>(tools--->form settings)</b>.then it display form settings screen for perticular userscreen.
is it possible to get form settings for a screen having grid
Thanks & regards
SARAN -
Linked button in a Grid (SBO 2005)
Hy,
Is it possible to add a linked button in a grid? I saw some posts for linked buttons in a matrix but this doesn't work for me.
The code that I use to fill the grid is:
Item GOrder = form.Items.Item("GOrder");
Grid gOrder = ((Grid)(GOrder.Specific));
int intCountDatatable = 0;
try
form.DataSources.DataTables.Item("TOrder").ExecuteQuery(strSQL);
catch
return;
gOrder.DataTable = form.DataSources.DataTables.Item("TOrder");
If you (all) need more info, just let me know. Hope you can help...
JoeriHey Joeri!
My guess it isn't possible; if you look through the UI-API, you'll see that there isn't a BoLinkedObject property, and no possibility to set a column to a linkedbutton type...
Good luck,
Rowdy
PS: Waar was je afgelopen donderdag op de SAP Partner Dag? Behoorlijk interessante/leerzame sessie smiddags met betrekking tot de SDK... -
How to add linked button in grid?
Hi,
Does anyone know how to add linked button in a grid? I can't find it but i saw someone ask similar question but seems none of them works.
Thanks a lot!
P.S. For some reason, i can't use matrix because the data is from a SQL query.
LanHi,
as far as I know it is not possible, since this adjustment is made for the whole column. I have created a grid and I open the shown document by double clicking the row header. In the grid I can see if it is sales or purchase and so I use a workaround by opening the specific system form (e.g. sales invoice) in find mode and search the document by document number (also shown in the grid).
Sample:
oSBOapp.ActivateMenuItem("2053"); //sales invoice
oForm = oSBOapp.Forms.ActiveForm;
oForm.Mode = SAPbouiCOM.BoFormMode.fm_FIND_MODE;
oEdit = (SAPbouiCOM.EditText)oForm.Items.Item("8").Specific;
oEdit.Value = Convert.ToString(dNum);
oForm.Items.Item("1").Click(SAPbouiCOM.BoCellClickType.ct_Regular);
By the click event, you get the specific row number. Hope it helps...
Regards
Sebastian -
Hi,
I have my custom designed form.
Can I add a 'Orange Link arrow' for an UDO in it?
I could do it for the system objects.
When I tried it in the screen painter, I got the error 'Invalid Numeric Value'.
Thanks in advance.
Regards,
GeethaHi Geetha,
I don't think UDOs are supported for link buttons (or should I say, I can't get it to work ) so you'll need to code it yourself. If you trap the event of the user clicking on the link button, you can open your UDO form in Find mode, populate the key field and click the Find button.
Kind Regards,
Owen -
SP01 PL03: Click on Grid Link button, add-on disconnected error occured
Hi Frank,
I upgrade my add-on to SP01, there is an error when click Link button which in a UDT bound grid, the error shows 'System Message' with three option buttons, [Restart Add-on],[Log off the current company] and [Continue working without this Add-on], this error does not occur on SAP 2005 PL7,PL8, PL9 & PL10, but occurred on SP01 and SP01 PL03.
The grid Link button link to master like BP, G/L Accout and Item.
Hope there is a workaround way.
Thanks.What version / PL was your Add-On compiled with before?
Was it done with 2005A SP00 PL?? ?
Anyway, I am happy to hear that it works now...
regards,
Frank -
Hi everybody:
Just I'd like to know if I can have a link button in a grid object, such as it exists in the matrix object, an how i can get it.
Thanks in formward
Regards.
Misael Reséndiz.Misael,
If you use the Search feature in this forum on "link button on grid", you should find many helpful posts such as this one ...
Link button in Grid
Eddy -
Link Button In Grid or Matrix ?
Hello,
I'm trying to populate a grid with data from a SQL query, using a datatable datasource, but I don't know how to specify which fields are to have drill-down(link buttons). After looking at this thread :
Linked button in a Grid (SBO 2005)
I'm left wondering how the Business One Report Generator can generate a grid with link buttons attached to the appropriate fields, when it is only given a SQL query.
I'm thinking I might have to use a matrix, but how can i populate the matrix when if i don't know what the SQL query will be in advance?, also can I achieve the grouping using a matrix that the grid automatically does ?Hello Welch,
Both Matrix and Grid can work with LinkButton. And regarding Grid, first of all, you need to define the gridcolumn type as gct_EditText, then in EditTextColumn Object, there is a property named LinkedObjectType, please set the property as in Matrix column.
' First define the column as EditText type
oCol = oGrid.Columns.Item("Col1")
oCol.LinkedObjectType = 4
Hope this helps,
Nick -
hi
Can anyone tell me why the click action is not working when
the link button is placed in datagrid.
<mx:DataGridColumn dataField="edit" headerText="">
<mx:itemRenderer>
<mx:Component>
<mx:LinkButton label="edit" click = "click1();">
</mx:LinkButton>
</mx:Component>
</mx:itemRenderer>
</mx:DataGridColumn>
even if button is placed in the datagrid it is not working.When you use the <mx:Component> tag you create a new
scope. Its as if all of the content of the <mx:Component>
were in another file. If you used a separate file for your renderer
you wouldn't expect click() function to be recognized, right?
You can modify your renderer like this to make it work:
<mx:LinkButton label="edit" click =
"outerDocument.click1();">
Another option is to take advantage of the bubbling feature
of the click event. Instead of putting the click handler on the
LinkButton, put it on the DataGrid itself. Any click on the
DataGrid will then trigger the event handler.
The drawback to that is that EVERY click will call the event
handler - either the LinkButton's click on a click on the header.
Your event handler just has to examine the event data to determine
what control originated the event.
In this case, using outerDocument.click() is far easier, but
you might need the bubbling property of the event at some point in
the future. -
Is it possible to have a linked button (drill down) in a gird object?
Hi,
Can you put this code too:
SAPbouiCOM.EditTextColumn oEditCol;
oEditCol = ((SAPbouiCOM.EditTextColumn)(oGrid.Columns.Item("Column Name")));
oEditCol.LinkedObjectType = "X";
For example, in C# :
SAPbouiCOM.EditTextColumn oEditCol;
oEditCol = ((SAPbouiCOM.EditTextColumn)(oGrid.Columns.Item(0)));
oEditCol.LinkedObjectType = "2";
Maybe you are looking for
-
Just get my new iPod touch 5 from my local's apple store
Pre-orders are shipped today and arrive tomorrow (one-day shipping).. Next time I will not pre-order..just go to apple store and buy it.. just a waste of time..
-
Basis: need umount for some cds
hello. I need to install a few cds in a machine, and I need to umount the cds to go on. Unfortunately, I have the awaited message: umount: /mnt busy impossible to umount so. How could I do, because I really need it (there's a gui launched from the fi
-
How to know that my cache is disttributed (i mean partitioned or replicated
How to know that my cache is distributed or replicated.. if it is not distributed then how can we make it as distributed(where do we need to change.) Thanks --Krishna..
-
Please tell the right tool for managing the Version of JSP pages
Hello Friends We are developing a software for hospital, we need to maintain versioning of the software. Can you give information about the open source version management software Thanking You Ajit Saha
-
Problem while issueing from batch
Dear Gurus Suppose I have got a finished product x for this I have maintained a bom of suppose a, b,c all three roh.Out of these 3 I have say c batch managed. Through mb1c suppose I recieved roh c in different batches and kept them in the store.Now