on 08-22-2016 5:36 PM
Hello,
We just upgraded from Personas 2.0 to 3.0
We were able to use the Switch flavor functionality using the Parameter. I am not sure how to achieve this in 3.0
I found a link suggested by Tamas but not able to understand how to use it
Scripting Utility Methods - SAP Imagineering - SCN Wiki
My Scenario
In VA43 (Contract Display)
1. Overview screen has 3 Items
2. Double click on Item 10 -> Should switch the flavor to a new one where there is a tab with Billing Plan
3. Double click on other Items -> Should switch the flavor to a new one where there is no Billing Plan tab
These items can be created in any sequence.
Any help is appreciated.
Thanks,
Salil
Hi Salil,
You will need to create two flavors:
1. FlavorA(flavor with Billing Plan)
2. FlavorB (flavor without Billing Plan)
In FlavorA, create a script with the following contents and assign it to the OnLoad screen event:
// Put code here to check if the billing plan exists - one way to do this is to check the text of the tab page control since the IDs are index based.
if(<condition fails>){
// Switch to FlavorB only if there is no billing plan tab using the following. The GUID can be seen in the deep link (click on chain link button on the flavor manager)
session.utils.changeFlavor(<GUID of FlavorB>);
}
In FlavorB, on the overview screen, create an OnLoad script with the following contents:
session.utils.changeFlavor(<GUID of FlavorA>);
If you need to troubleshoot and want to change the script in FlavorB overview screen, you can use the suppressOnLoadEvents=X URL parameter. This will deactivate the execution of OnLoad scripts.
Best regards
Kranthi
SAP Screen Personas Team
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hello Salil,
Kranthi provided good instructions on how to go about it.
One little tip, the easiest way to create the flavor switching script is to record it.
Steps to do:
1) In scripting environment, click "Start Recording".
2) Switch to the desired flavor.
3) Stop recording
This should have produced: session.utils.changeFlavor("..."); // with the correct flavor ID
Cheers,
Clemens
Thanks Kranthi and Clemens.
I tried that option but not sure whats happening, the script is not showing any code. I tired many times.
Kranthi,
I also tried to use the following logic
if(<condition fails>){
// Switch to FlavorB only if there is no billing plan tab using the following. The GUID can be seen in the deep link (click on chain link button on the flavor manager)
session.utils.changeFlavor(<GUID of FlavorB>);
}
I tried to populate if(<condition fails>) but, not able to get to the correct condition.
I used the following script but when i validate the script, it says incorrect.
var tab_text;
session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP*/tabpT\\06").text = tab_text;
if tab_text = "Billing plan";
session.utils.changeFlavor ("0050569040F81EE69A8DA25D94091A59");
endif;
Salil, you will need to change your script to the following:
var tab_text = session.findById("wnd[0]/usr/tabsTAXI_TABSTRIP*/tabpT\\06").text;
if(tab_text !== "Billing plan"){
session.utils.changeFlavor ("0050569040F81EE69A8DA25D94091A59");
}
If there are any errors, kindly open the developer tools console and include the contents of the error.
Best regards
Kranthi
SAP Screen Personas Team
Message was edited by: Kranthi Kumar Muppala Changed the condition so, the switch happens if the tab's text is not 'Billing plan'. Change it to your requirement if different.
User | Count |
---|---|
93 | |
10 | |
10 | |
9 | |
9 | |
7 | |
6 | |
5 | |
5 | |
4 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.