0
votes

I have a sharepoint list setup for employees to make reservations for a training session. There is also a linked list where count against each session is updated when someone books a session, which has been completed using Nintex Workflows. So in effect:

List A Cols Staff Name - Session Details

List B Cols Session Details - Session Booking Count

What I am trying to do is have the Session Booking Count shown on Newform of List A if user selects a specific session, and to write a validation to show error if Count > 10.

I have tried to setup a cascading dropdown option using jquery, and this does show the count of each session, however default value is coming as "(none)". User has to click on the drop down and select the count figure manually.

Is there a way to change this so that by default the count is shown?

<script src="https://team.global.hsbc/sites/GSCGMOpsComms/SiteAssets/jquery.min.js"></script>
<script src="https://team.global.hsbc/sites/GSCGMOpsComms/SiteAssets/jquery.SPServices.min.js"></script>
<script type="text/javascript">
$(document).ready(function ()
{
   $().SPServices.SPCascadeDropdowns(
   {
      relationshipList: "GCB6 Promo Process Counter List",
      relationshipListParentColumn: "SessionName",
      relationshipListChildColumn: "SessionCount",
      parentColumn: "Session",
      childColumn: "Session Bookings",
      debug: true
   });
});
</script>
1
Are you using nintex forms? if yes, these have ootb functionality to configure cascading dropdowns, if using regular jquery based custom form, make sure, you set up/select the value of session count based on selected session in $document.ready();Muhammad Murad Haider
are you working on a custom form using jquery, javascript/html?Muhammad Murad Haider
@MuhammadMuradHaider Unfortunately this particular site has not been enabled with nintex forms, only workflows. I have updated the code I have used in the original post. Could you have a look and advise how to update?jangovin
can't find the codeMuhammad Murad Haider
just added it injangovin

1 Answers

0
votes

if single value is returned from child list column e.g. booking count try making booking count (lookup) column as Required from list column settings in parent list. This should remove `none' option from your dropdown.

for decimal places issue, change the column settings to return zero decimal places: enter image description here