• Introducing Dark Mode! Switch by clicking on the lightbulb icon next to Search or by clicking on Default style at the bottom left of the page!

Dynamically set data source on Form or UBE section

BOster

Legendary Poster
Is there a way to programatically, at run-time, set the data source for a Business View on a form or a UBE section?
 

craig_welton

Legendary Poster
Hi Brian,

I have not seen a way to do this within an app or UBE context. Of course, you can override the datasource in JDB_OpenTable etc. and have your app/UBE communicate through BSFNs. But the loss of built in APPL/UBE functionality is obvious. Perhaps hacking around with OCM at a user level would work? Caching would be a hurdle, I suppose.

Craig
 

peterbruce

Legendary Poster
Brian,

There is a BSFN that overrides the data source when access the WSJ (Work with submitted jobs). Would it be possible to copy and modify the c code for that BSFN to do what you want?
 

BOster

Legendary Poster
Hi Brian,

I have not seen a way to do this within an app or UBE context. Of course, you can override the datasource in JDB_OpenTable etc. and have your app/UBE communicate through BSFNs. But the loss of built in APPL/UBE functionality is obvious. Perhaps hacking around with OCM at a user level would work? Caching would be a hurdle, I suppose.

Craig
Thanks. I guess I will have to use JDEBASE then. That is what I am using to write to the tables. I just have a very simple reporting requirement where a data bound ube section/grid works the best... but I guess I can work around it. Just didn't want to write a bunch of code and then find out I could have just made some sys function call to set the data source with one line of code.
 

BOster

Legendary Poster
Brian,

There is a BSFN that overrides the data source when access the WSJ (Work with submitted jobs). Would it be possible to copy and modify the c code for that BSFN to do what you want?
Are you talking about SetF986110DS? This calls a very specific C API JDB_SetF986110 (which, I believe, is the key piece that sets data source) so I think it is very specific to just F986110.
 

peterbruce

Legendary Poster
Brian,

I think that is the bsfn. I realise that it is very specific to the F986110 data source. However I was thinking that it might be possible for something could be learned from how it does it. However if the code that actually changes the data source is not accessible then it's probably not possible.
 

johndanter

Legendary Poster
You want to change the datasource your UBE gets data from?

Same as R98403XA and XB. Have a look how R98403XA handles PO szSourceDataSource as it will get data from PY even if being run in DV.

GetTargetDataSource(B9840E.GetTargetDataSource) It uses the API JDB_OpenTable
JDEDB_RESULT JDB_OpenTable(HUSER hUser, NID szTable, ID idIndex, NID *lpColSelect, unsigned short nNumCols, JCHAR * szOverrideDS, HREQUEST * hRequest);

So have a gander at how they handle it all

I did write a UBE that listed PO differences across environments? So we can do it. I just can't remember how I did it
 

BOster

Legendary Poster
You want to change the datasource your UBE gets data from?

Same as R98403XA and XB. Have a look how R98403XA handles PO szSourceDataSource as it will get data from PY even if being run in DV.

GetTargetDataSource(B9840E.GetTargetDataSource) It uses the API JDB_OpenTable
JDEDB_RESULT JDB_OpenTable(HUSER hUser, NID szTable, ID idIndex, NID *lpColSelect, unsigned short nNumCols, JCHAR * szOverrideDS, HREQUEST * hRequest);

So have a gander at how they handle it all

I did write a UBE that listed PO differences across environments? So we can do it. I just can't remember how I did it
Thanks. I will take a look.
 

BOster

Legendary Poster
Brian,

I think that is the bsfn. I realise that it is very specific to the F986110 data source. However I was thinking that it might be possible for something could be learned from how it does it. However if the code that actually changes the data source is not accessible then it's probably not possible.
It was a good suggestion. Unfortunately Oracle hid the implementation from us. I actually used this BSFN before but it was one of those "I don't know why I have to call this BSFN, and I don't know how it works, but when I call it everything seems to work so I will use it" type of things.
 
Top