Community
Showing results for 
Search instead for 
Do you mean 
Reply

changing layout through SDk

Copper Contributor
Posts: 32
Country: United_Kingdom

changing layout through SDk

quick question - is it possible to change the layout file used programmatically?

I know the file name can be retrieved but i've failed at finding anything in the code reference that would allow me to change it, am I missing it?

 

Employee
Posts: 1,163
Country: USA

Re: changing layout through SDk

Looks like it's exposed: Act.UI.LayoutDesigner.LayoutPicker, but isn't intended for consumption via the SDK.

 

Sorry.

Matthew Wood
Act! SDK Support
Community Moderator
Copper Contributor
Posts: 32
Country: United_Kingdom

Re: changing layout through SDk

fair enough, thank you. Saw that but couldn't really find a method to use anyway. It was only for a small optional request so no big deal.
Copper Contributor
Posts: 32
Country: United_Kingdom

Re: changing layout through SDk

Figured it out. Just in case anyone is interested, it can be done using UILayoutDesignerManager.

 

this gets all the available opportunity layouts (replace .opportunity with whatever type of layout you need.

LayoutFileInfo[] layoutarray = application.UILayoutDesignerManager.GetAvailableLayouts(LayoutType.opportunity);

 

when you have the LayoutFileInfo for the layout you want displayed, you can set it with

 

 application.UILayoutDesignerManager.SetCurrentLayout(lfi);

 

here lfi is the LayoutFileInfo for the needed layout.