cancel
Showing results for 
Search instead for 
Did you mean: 

Set a default layout for all users via DIAPI

trevor_schug
Discoverer
0 Kudos

Hello everyone,

I am attempting to set a default report for all users/business partners using the DI-API. 

I can accomplish this in the B1 application via Tools> Layout Designer...>Set as Default

If there are entries in the RDFL table for this layout, I am prompted to delete these entries and set this layout as the default for all users/BP's

Based on the SDK Documentation, the following code should accomplish the same thing via the DI-API

(stripped down for clarity)


Dim oDefaultReportParams As DefaultReportParams

oDefaultReportParams = oLayoutService.GetDataInterface(ReportLayoutsServiceDataInterfaces.rlsdiDefaultReportParams)

oDefaultReportParams.LayoutCode = sMyLayoutCode

oDefaultReportParams.ReportCode = sMyReportCode

Me.oLayoutService.SetDefaultReport(oDefaultReportParams)

Code executes fine, but it doesn't have the expected impact on settings.  The above code adds an entry to the RDFL table rather than changing the DfltReport field in the RTYP table like I expected, so instead of setting the default report globally for all bps/users, its adding an entry to the RDFL table to set the value for a specific user/bp

I experimented by including and setting the following properties to every combination I could think of with the same results


        oDefaultReportParams.UserID = 'tried 1, 0, -1

        oDefaultReportParams.CardCode = 'tried "", "0", "-1"

Am I misunderstanding the API, or using the wrong objects/calls...? If all else fails I could accomplish this via the UI-API instead, but the application was intended to be a stand alone app that didn't rely on SAP B1 application running, so any help or suggestions would be much appreciated.

Thanks!

Accepted Solutions (1)

Accepted Solutions (1)

kothandaraman_nagarajan
Active Contributor
0 Kudos

Hi,

Please repost at SDK forum to get quick response. Close this thread here with helpful answer.

Thanks.

Answers (0)