cancel
Showing results for 
Search instead for 
Did you mean: 

Link button in grid column to UDO

Former Member
0 Kudos

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,

Mike

Accepted Solutions (0)

Answers (2)

Answers (2)

rasmuswulff_jensen
Active Contributor
0 Kudos

Hi.. had same problem a while back and did some studies and a message to SAP Srpport about it...

You can

- Create Choose From Lists to UDO...

You can not

- Create a linkbutton to an UDO...

If you think about it it make sense that it is not possible even though we would like it... What i linkbutton does is it open another window and find a specific record... How should the SDK EVER be able to do such a thing with a form that you create (remember that after creation you migth do all sorts of business logic filling comboboxes with values and such)... We can be mad at SAP, but not for note giving the impossible....

The above is the problem but also the solution... what you can do is simulate exactly the process above with a dummy linkbutton to another type and code that open your for and perform the search

One final question that elude me is why the SDK includes the LinkedObjectType as a string if it doesn't do what we think it does... Perhaps it work on UDO that use the standard form (making it SAP the have done the implementation of the UDO but I never got around to trying).... Also, why the missing support of lf_None as a linked object type....

Former Member
0 Kudos

Rasmus,

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 One’s 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

Former Member
0 Kudos

Hi Mike,

You must just enter the name of the User Defined Object that you have created.

Hope it helps,

Adele

Former Member
0 Kudos

I tried this and SAP just ignores it.

Former Member
0 Kudos

Hi Mike,

I have used the ChooseFromList example from the SDK To test this and it worked. You enter the name of the UDO in the object property and also remember to search for CardCode and CardType (the lookup field and filter value) and replace it with a valid field. Try running the sample and see if it works.

Adele

Former Member
0 Kudos

In the moment to create the UDO, don't forget to set the property CanFind to YES

See you the thread <i>Example: How to binding CFL to a UDO in a customized System Form</i>

It explains the complete process.

regards

Former Member
0 Kudos

Alphonso,

Thanks for your response. Sorry for the delay in mine. We did specify YES for the CanFind property.

I will look at your example and get back to you.

Mike