Some variable is not showing in SOW and native view.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
2 hours ago - last edited 2 hours ago
I have a catalog where i have some variable 4 variables are: applicable timeline->Select box->with values Yearly, Quarterly, Monthly. when each value is selected appropriate variable will get visible : applicable year -> Single text ->current year applicable month ->Select box-> with months applicable quarter->select box with q1, q2, q3, q4. varibles are hidden false intially. i am using onload and on change catalog client script: When filling the form everything is working as expected. After submission when checked the additional details in ESC then also everything is fine, but when i opened the RITM SOW/ native view i can't see any on the sub variables (applicable month, year, quarter according to selection). when i deactivated the client script then it was visible but then the form is behaving as expected. i checked and confirmed that the values are captured in sc_item_option_mtom as expected. pls help me to fix this:
On LOAD Script:
function onLoad() { var timeline = g_form.getValue('applicable_timeline'); // Hide all fields g_form.setDisplay('applicable_year', false); g_form.setDisplay('applicable_month', false); g_form.setDisplay('applicable_quarter', false); // Remove mandatory from all g_form.setMandatory('applicable_year', false); g_form.setMandatory('applicable_month', false); g_form.setMandatory('applicable_quarter', false); // Show & make mandatory if (timeline == 'Yearly') { g_form.setDisplay('applicable_year', true); g_form.setMandatory('applicable_year', true); g_form.setDisplay('applicable_month', false); g_form.setDisplay('applicable_quarter', false); g_form.setMandatory('applicable_month', false); g_form.setMandatory('applicable_quarter', false); g_form.clearValue('applicable_month'); g_form.clearValue('applicable_quarter'); } else if (timeline == 'Monthly') { g_form.setDisplay('applicable_month', true); g_form.setMandatory('applicable_month', true); g_form.setDisplay('applicable_year', false); g_form.setDisplay('applicable_quarter', false); g_form.setMandatory('applicable_quarter', false); g_form.setMandatory('applicable_year', false); //g_form.clearValue('applicable_year'); g_form.clearValue('applicable_quarter'); } else if (timeline == 'Quarterly') { g_form.setDisplay('applicable_quarter', true); g_form.setMandatory('applicable_quarter', true); g_form.setDisplay('applicable_month', false); g_form.setDisplay('applicable_year', false); g_form.setMandatory('applicable_year', false); g_form.setMandatory('applicable_month', false); g_form.clearValue('applicable_month'); // g_form.clearValue('applicable_year'); } }
ON CHANGE:
function onChange(control, oldValue, newValue, isLoading) { if (isLoading || newValue == '') { return; } // Hide all fields g_form.setDisplay('applicable_year', false); g_form.setDisplay('applicable_month', false); g_form.setDisplay('applicable_quarter', false); // Remove mandatory from all fields g_form.setMandatory('applicable_year', false); g_form.setMandatory('applicable_month', false); g_form.setMandatory('applicable_quarter', false); // Show the selected field and make it mandatory switch (newValue) { case 'Yearly': g_form.setDisplay('applicable_year', true); g_form.setMandatory('applicable_year', true); g_form.setDisplay('applicable_month', false); g_form.setDisplay('applicable_quarter', false); g_form.setMandatory('applicable_month', false); g_form.setMandatory('applicable_quarter', false); g_form.clearValue('applicable_month'); g_form.clearValue('applicable_quarter'); break; case 'Monthly': g_form.setDisplay('applicable_month', true); g_form.setMandatory('applicable_month', true); g_form.setDisplay('applicable_year', false); g_form.setDisplay('applicable_quarter', false); g_form.setMandatory('applicable_quarter', false); g_form.setMandatory('applicable_year', false); //g_form.clearValue('applicable_year'); g_form.clearValue('applicable_quarter'); break; case 'Quarterly': g_form.setDisplay('applicable_quarter', true); g_form.setMandatory('applicable_quarter', true); g_form.setDisplay('applicable_month', false); g_form.setDisplay('applicable_year', false); g_form.setMandatory('applicable_year', false); g_form.setMandatory('applicable_month', false); g_form.clearValue('applicable_month'); //g_form.clearValue('applicable_year'); break; } }