cancel
Showing results for 
Search instead for 
Did you mean: 

LinkedObjectType on Grid

Former Member
0 Kudos

just want to ask if it is possible to change the value of the textboxcolumn.

for example, in my CardName column. The display value is "Test BP" but when they click the link button it open the "C0001" which is the CardCode. is that possible in Grid?

Accepted Solutions (0)

Answers (1)

Answers (1)

pedro_magueija
Active Contributor
0 Kudos

Hi Gimo,

It is possible to have the link button display on the Grid. To link the link button the standard way you must link it to the key of the object you are linking to (in this case BusinessPartners).

You can also place a LinkButton on a column with the CardName, but this won't automatically open the correct BusinessPartner. You could capture the Click Event and then get the correct BP key (CardCode) from it's name and open the BP form using the application.OpenForm() function.

Good luck.


Best regards,

Pedro Magueija


View Pedro Magueija's profile on LinkedIn

Former Member
0 Kudos

thank you Pedro, do you have sample on this? how can I use application.OpenForm() .

ANKIT_CHAUHAN
Product and Topic Expert
Product and Topic Expert
0 Kudos

Hi Gimo,

If I am not getting Pedro wrong, then you can try this :

On Click Event of Link Button find the value of cardname or cardcode :

oApplication.ActivateMenuItem("2561");

SAPbouiCOM.Form oForm = (SAPbouiCOM.Form)oApplication.Forms.GetForm("134", 1);

Now if you have got the value of CardCode:

SAPbouiCOM.EditText oEdit = (SAPbouiCOM.EditText)oForm.Items.Item("5").Specific;

oEdit.Value = "CardCodeValue";

oForm.Items.Item("1").Click(BoCellClickType.ct_Regular);

Now if you have got the value of CardName:


SAPbouiCOM.EditText oEdit = (SAPbouiCOM.EditText)oForm.Items.Item("7").Specific;

oEdit.Value = "CardNameValue";

oForm.Items.Item("1").Click(BoCellClickType.ct_Regular);

Hope it helps.

Thanks & Regards

edy_simon
Active Contributor
0 Kudos

Hi,

Depends on your SBO version.

Check if your SBO_Application object has the method  'OpenForm'

If it does, all you need to do after catching the before matrix link pressed event :


string sCardCode = oGrid.DataTable.GetValue("CardCode", pVal.Row).ToString();

SBO_Application.OpenForm(BoFormObjectEnum.fo_BusinessPartner, "", sCardCode);

Where "CardCode" in the GetValue is the column name in which you keep the  CardCode value.

The OpenForm method is already there for a while now. at least 881.

Regards

Edy

Former Member
0 Kudos

hi edi, thanks for this. really appreciate, but how can I apply this on grid? I'm not using matrix though.

edy_simon
Active Contributor
0 Kudos

Hi Gimo,

The code I gave you is for Grid,

The event for link pressed is the same for matrix and Grid, so you would catch the matrix link pressed all the same for your grid object.

Regards

Edy

Former Member
0 Kudos

thanks edi. But I'm having an error "No matching records found  'Business Partner' (OCRD) (ODBC -2028)  [Message 131-183]" when I click the linkbutton, but it open the form. how can I hide that error?

Select Case pVal.EventType

                        Case SAPbouiCOM.BoEventTypes.et_MATRIX_LINK_PRESSED

                            Select Case pVal.ItemUID

                                Case "dgHdr"

                                    Select Case pVal.ColUID

                                        Case "DEALERCDE"

                                            SAP_APP.SBO_Application.OpenForm(SAPbouiCOM.BoFormObjectEnum.fo_BusinessPartner, "", oCardCode(dgHdr.DataTable.GetValue("DEALER", pVal.Row)))

                                    End Select

                            End Select

End Select

edy_simon
Active Contributor
0 Kudos

Hi Gimo,

SAP_APP.SBO_Application.OpenForm(SAPbouiCOM.BoFormObjectEnum.fo_BusinessPartner, "", oCardCode(dgHdr.DataTable.GetValue("DEALER", pVal.Row)))

Return False     '<--- add this line. Your error is because of the system event trying to open another BP form also. Since you have handle it your own, tell the system to not process anymore.

OR

Set the

BubbleEvent = false  'if you are not using B1DE

Regards
Edy