cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

Set story filters api based on input control

Freddie
Explorer
0 Kudos
176

Hi SAC community,

Is it possible to set story filters based on input control selections in a prompt when opening the story?

If yes, can you please provide an example code?

Best regards,

Accepted Solutions (1)

Accepted Solutions (1)

JefB
SAP Champion
SAP Champion

Sure, something like this in the story prompt onButtonClick() event

console.log("StoryPopUp_1 - onButtonClick");

//Read Input Control Selection by User
var ipc1sel = InputControl_1.getInputControlDataSource().getActiveSelectedMembersWithUnbooked();

//Apply selection as Story Filter
var fds = Application.getFileDataSource("Ckili67ld2ovmu4rq3udd173n1u");
fds.setDimensionFilterWithHierarchy("Product",Alias.FlatHierarchy,ipc1sel);

//Close the Story Popup
this.close();

//Unpause the table (linked with script variable) to retrieve latest filtered data
tblplan.getDataSource().setRefreshPaused(PauseMode.Off);

//Enable Planning features (Data Entry)
tblplan.getPlanning().setEnabled(true);
Freddie
Explorer
0 Kudos
Thanks alot, JefB. However, the story popup won't open in view mode even though I have StoryPopUp_1.open on init page...
JefB
SAP Champion
SAP Champion
0 Kudos

hi @Freddie, weird. works for me.

console.log("Page_1 - onInitialization");
tblplan = Table_1;
StoryPopup_1.open();

 

Answers (0)