<h2>[SAMP] The Software Entitlement form doesn't load when clicking "Save/Update", if the Metric type is "Per Core" or "Per Core (with CAL)"</h2><br/><div style="overflow-x:auto"><article><div ><h3 >Issue </h3><section><ul><li>On the Software Entitlement form (alm_license), when License Metric is of type "Per Core" or "Per Core (with CAL)", the "Save/Update" action doesn't work. i.e. the form doesn't load/respond.</li></ul></section></div><div ><h3 >Release</h3><section><ul><li>Instance with Software Asset Management Professional for SAP (com.sn_samp_sap) plugin enabled.</li></ul></section></div><div ><h3 >Cause</h3><section><ul><li>When inspecting the page via the developer tool, the below error is returned while clicking on "Save"</li></ul> <p style="padding-left: 40px;"><span style="background-color: #ffff99;"><strong>ERROR: invalid field or missing message passed to g_form.showFieldMsg('rights_per_license_pack','Please enter a number greater than 0')</strong></span></p> <ul><li>This specific error "Please enter a number greater than 0" is triggered from the Client Script "<strong>Check purchased rights VS upgraded right</strong>"</li></ul> <p style="padding-left: 40px;">https://<<instance_name>>.service-now.com/nav_to.do?uri=sys_script_client.do?sys_id=04c71d4367522200e85a87cb5685efbf</p> <ul><li>Further inspecting, i.e. copying the "g_form.getDecimalValue('rights_per_license_pack')" value in developer console could see it returned value "0", though "rights_per_license_pack" for the specific record is > "1".</li><li>If this mandatory field "Rights per license pack" is not available on the "alm_license" form, the value that it gets assigned is "0" during "onsubmit" action and thus the form doesn't load during "Save/Update".</li><li>This is being validated in line #8 from the Client Script "Check purchased rights VS upgraded right".</li></ul> <p style="padding-left: 40px;"><strong>var rightsPerLicensePack = <span style="background-color: #ffff99;">g_form.getDecimalValue('rights_per_license_pack')</span>;</strong></p></section></div><div ><h3 >Resolution</h3><section><ul><li>For this Client Script to use the "<strong><span style="background-color: #ffff99;">rights_per_license_pack" </span></strong><span style="background-color: #ffffff;">available value on the Entitlement, add the "Rights per license pack" on the "alm_license" form from the "Configure >> Form Layout" slush bucket. </span></li></ul> <p style="padding-left: 40px;"><span style="background-color: #ffffff;"><img style="align: baseline;" src="sys_attachment.do?sys_id=334661a81bfb2010d01143f6fe4bcb0f" width="950" height="425" align="baseline" /></span></p></section></div></article></div>