How to debug a modal dialog
As introduced in http://scn.sap.com/community/crm/webclient-ui-framework/blog/2015/12/26/logic-for-f4-help–1, F4 input help shows help values in a modal dialog. Without special tools, It is not possible to set breakpoint and make JS debug from this popped up modal dialog. In this document, I will show you how to debug using a workaround.
- Firstly, we need to get the URL link for requesting help values: make a httpwatch trace when clicking F4 help icon.
- From the httpwatch trace, find the line for ‘CRM_THTMLB_UTIL/f4_help2.do’ request. Right click and select menu ‘Copy https://….’.
- Paste the url into another IE tab and Enter, a help values will be shown as a normal page.
- Click F12, Developer tool will be launched. We can search ‘thtmlbF4PickRow’ and set a JS breakpoint.
- Then select any entry, the JS bk will stop.
- If I select the 2nd entry, it will go into function dynshlp_sel_2.
- Inside function SetInput, thtmlbF4SetInput is called. Notice the callstack and the values for SelValue and keyInputfieldId.
- In function thtmlbF4SetInput, win is ‘undefined’. This is because this value help screen has no parent window.
- In order to get through more codes, we make a change for ‘win’ manually — input any string to make ‘win’ a defined object.
- Here is the farthest place where we can debug. We cannot debug further because our ‘win’ is just a string object instead of a window object. But from here we can see ‘visible’ is object for ‘C35_W162_V163_marketing_classific_text’ which is the ‘rating description’ input field.
- This is the place to set value.