How to make a custom Quick Create from EC/TI work in iPad (C4C)
(all credits go to Stefan Krauth)
1 – You need to check the “Expose as OBN BO” option in your thing-type file. This enables calling screens via OBN navigation, so you can call screens individually.
– Open your thing-type.
– Go to Controller tab.
– Click on “Thing Type Data” folder.
– Check the option.
2 – Create an OBN Navigation via Wizard on your EC
– Select a name, check the “Thing-based Navigation” option, and pick your custom Thing Type.
– Select “QuickCreate”.
– Select an outport name, Navigation Style “inplace”, PortType Package “/SAP_BYD_UI/SystemPortTypes.PTP.uicomponent” and PortType Reference “ThingNavigation”. Select also your Parameters if any.
3 – Configure Add button
- Open your EC and select the Add button. On the “Thing Type” property underneath (“Properties” tab), do the following:
OutPort to Quick Create: select the outport generated on the previous step.
Quick Create Inport: type the name of your QC’s InPort CORRECTLY!
If you’ve done everything correctly, now it will work in iPad!
However, there is still a problem… we are now forcing to call the OBN-navigation along the Thing-Navigation… iPad player will consider only the OBN, and it will work. But if you trigger it in desktop, you’ll see two Quick Create dialogs!
We need to make sure this is only triggered in iPad!
4 – Create an Event Handler on your EC to call the iPad OutPort only in iPad player.
- Create new Event Handler with a Condition operation.
- Select “Expression”, and select the data field responsible for checking whether scenario is Desktop or not (For more info please read: http://scn.sap.com/thread/3477605)
- Create a Select operation, Compare Type “Constant” and let “Value” empty.
- It means that, if it’s not desktop, then we need to trigger the iPad OutPort!
- Create a new “FireOutport ”operation inside this Select and pick the iPad OutPort
- Create a “Default” operation below the “Select” one and let it empty, with no value or operations.
- Go to your Add button properties (“Thing Type” property underneath) and add this Event Handler to the “Before QuickCreate Navigation” property.
Now the OutPort is only called in iPad player!
If you don’t have the thing-based UIs generated, and you use your custom BO just on an EC, then you can use a similar approach: the only difference is that you need an additional “helper” BO, with an association to the Object you want to create an instance of, so you can build the Quick Create UI based on your “helper” BO. Finally, you create the instances manually via ABSL.
Hope this helps.