Dynamics Community Forum Thread Details (2024)

Hi,

I am getting error messag

e while loading option set.

"TypeError: Cannot read property 'length' of null

at Object.SDK.DependentOptionSet.filterDependentField"


Any idea on above error.

I have made a simple category (1,2) and subcategory.(1,2,3,4).

This is JS.

// ===================================================================== // This file is part of the Microsoft Dynamics CRM SDK code samples. // // Copyright (C) Microsoft Corporation. All rights reserved. // // This source code is intended only as a supplement to Microsoft // Development Tools and/or on-line documentation. See these other // materials for detailed information regarding Microsoft code samples. // // THIS CODE AND INFORMATION ARE PROVIDED "AS IS" WITHOUT WARRANTY OF ANY // KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE // IMPLIED WARRANTIES OF MERCHANTABILITY AND/OR FITNESS FOR A // PARTICULAR PURPOSE. // ===================================================================== //If the SDK namespace object is not defined, create it. if (typeof (SDK) == "undefined") { SDK = {}; } // Create Namespace container for functions in this library; SDK.DependentOptionSet = {}; SDK.DependentOptionSet.config = null; /** * @function SDK.DependentOptionSet.init * @param {string} webResourceName the name of the JavaScript web resource containing the JSON definition * of option dependencies */ SDK.DependentOptionSet.init = function (webResourceName) { if (SDK.DependentOptionSet.config == null) { //Retrieve the JavaScript Web Resource specified by the parameter passed var clientURL = Xrm.Page.context.getClientUrl(); var pathToWR = clientURL + "/WebResources/" + webResourceName; var xhr = new XMLHttpRequest(); xhr.open("GET", pathToWR, true); xhr.onreadystatechange = function () { if (this.readyState == 4 /* complete */) { this.onreadystatechange = null; if (this.status == 200) { SDK.DependentOptionSet.config = JSON.parse(this.response); SDK.DependentOptionSet.completeInitialization(); } else { throw new Error("Failed to load configuration data for dependent option sets."); } } }; xhr.send(); } else { SDK.DependentOptionSet.completeInitialization(); } }; /** * @function SDK.DependentOptionSet.completeInitialization * Initializes the dependent option set options when the form loads */ SDK.DependentOptionSet.completeInitialization = function () { //If the parent field is null, make sure the child field is null and disabled // Otherwise, call fireOnChange to filter the child options for (var i = 0; i < SDK.DependentOptionSet.config.length; i++) { var parentAttribute = Xrm.Page.getAttribute(SDK.DependentOptionSet.config[i].parent); var parentFieldValue = parentAttribute.getValue(); if (parentFieldValue == null || parentFieldValue == -1) { var childAttribute = Xrm.Page.getAttribute(SDK.DependentOptionSet.config[i].child); childAttribute.setValue(null); childAttribute.controls.forEach(function (c) { c.setDisabled(true); }); } else { parentAttribute.fireOnChange(); } } } /** * @function SDK.DependentOptionSet.filterDependentField * Locates the correct set of configurations * @param {string} parentFieldParam The name of the parent field * @param {string} childFieldParam The name of the dependent field */ SDK.DependentOptionSet.filterDependentField = function (parentFieldParam, childFieldParam) { //Looping through the array of all the possible dependency configurations for (var i = 0; i < SDK.DependentOptionSet.config.length; i++) { var dependentOptionSet = SDK.DependentOptionSet.config[i]; /* Match the parameters to the correct dependent optionset mapping*/ if ((dependentOptionSet.parent == parentFieldParam) && (dependentOptionSet.child == childFieldParam)) { /* * Using setTimeout to allow a little time between calling this potentially recursive function. * Without including some time between calls, the value at the end of the chain of dependencies * was being set to null on form load. */ setTimeout(SDK.DependentOptionSet.filterOptions, 100, parentFieldParam, childFieldParam, dependentOptionSet); } } }; /** * @function SDK.DependentOptionSet.filterOptions * Filters options available in dependent fields when the parent field changes * @param {string} parentFieldParam The name of the parent field * @param {string} childFieldParam The name of the dependent field * @param {object} dependentOptionSet The configuration data for the dependent options */ SDK.DependentOptionSet.filterOptions = function (parentFieldParam, childFieldParam, dependentOptionSet) { /* Get references to the related fields*/ var parentField = Xrm.Page.getAttribute(parentFieldParam); var parentFieldValue = parentField.getValue(); var childField = Xrm.Page.getAttribute(childFieldParam); /* Capture the current value of the child field*/ var currentChildFieldValue = childField.getValue(); /* If the parent field is null, set the Child field to null */ //Interactive Service Hub, CRM for Tablets & CRM for phones can return -1 when no option selected if (parentFieldValue == null || parentFieldValue == -1) { childField.setValue(null); childField.fireOnChange(); //filter any dependent optionsets // Any attribute may have any number of controls // So disable each instance childField.controls.forEach(function (c) { c.setDisabled(true); }); //Nothing more to do when parent attribute is null return; } //The valid child options defined by the configuration var validOptionValues = dependentOptionSet.options[parentFieldValue.toString()]; //When the parent field has a value //Any attribute may have more than one control in the form, // So iterate over each one childField.controls.forEach(function (c) { c.setDisabled(false); c.clearOptions(); //The attribute contains the valid options var childFieldAttribute = c.getAttribute(); //The attribute options for the Interactive Service Hub, CRM for Tablets & // CRM for phones clients do not include a definition for an unselected option. // This will add it if (Xrm.Page.context.client.getClient() == "Mobile") { c.addOption({ text: "", value: -1 }); } //For each option value, get the definition from the attribute and add it to the control. validOptionValues.forEach(function (optionValue) { //Get the option defnition from the attribute var option = childFieldAttribute.getOption(parseInt(optionValue)); //Add the option to the control c.addOption(option); }) }); //Set the value back to the current value if it is a valid value. if (currentChildFieldValue != null && validOptionValues.indexOf(currentChildFieldValue.toString()) > -1) { childField.setValue(currentChildFieldValue); } else { //Otherwise set it to null childField.setValue(null); childField.fireOnChange(); //filter any other dependent optionsets } } 
Dynamics Community Forum Thread Details (2024)

FAQs

What is a thread in a forum? ›

Within a forum's topic, each new discussion started is called a thread and can be replied to by as many people as they so wish. Depending on the forum's settings, users can be anonymous or have to register with the forum and then subsequently log in to post messages.

How to create a forum thread? ›

After clicking the Forum tab, you'll see a “Create thread” button on the right. Give your thread a subject, write your post, and select a category. Click “Create thread” to post it.

How do you plan a community forum? ›

Gather data about target audience interest in forum topic (e.g., focus groups, street polls, surveys). Invite speakers known to and respected by your target audience. Choose speakers who are members of your target audience. Provide contact number that individuals can call to ask questions.

What is Microsoft Dynamics? ›

Dynamics 365 is a portfolio of intelligent business applications that delivers superior operational efficiency and breakthrough customer experiences enabling businesses to become more agile and reduce complexity without increasing costs.

What is the difference between a forum thread and a post? ›

Each posting is automatically logged and organized. The name given to this organization is threading, and it provides a mechanism to automatically group the postings and all related replies, i.e., follow-up comments. Tags are text labels that act like bookmarks.

How do threads work? ›

About Threads
  1. Threads is an app from Instagram where you can view and share public conversations. ...
  2. People can also follow you to see your threads and replies in their feeds and from your profile. ...
  3. Start a thread.
  4. You can start a new thread and choose who can reply to it.
  5. Learn how to start a new thread.
  6. Reply to a thread.

How to create a thread example? ›

3) Using the Thread Class: Thread(String Name)
  1. public class MyThread1.
  2. {
  3. // Main method.
  4. public static void main(String argvs[])
  5. {
  6. // creating an object of the Thread class using the constructor Thread(String name)
  7. Thread t= new Thread("My first thread");
  8. // the start() method moves the thread to the active state.

What is a sticky thread in a forum? ›

A sticky post (or sticky thread) is a feature of many online forum and bulletin board tools. This allows a post to be stuck or pinned to the top of the screen. If it wasn't pinned in this way then it would slowly be displaced by more recently posted items that are moved to the top to indicate activity.

How do I post a new thread on a forum? ›

Click on “Post Topic.” If you can't find an existing thread to post your comment, or if your post is unique, you can create a new thread by clicking “Post Topic.” This is usually near the page numbers in the corners of the forum itself.

How do you structure a discussion forum? ›

Tips for writing a good discussion thread
  1. Part 1: State what your thought or recommendation might be. In other words, answer the question, “What do you think?”
  2. Part 2: State why you think what you think. ...
  3. Part 3: State what you wish you knew or directly solicit the opinion of classmates (in other words, ask a question!)

How do you manage a community forum? ›

Forum management is a vital part of keeping forums friendly and productive.
  1. Establish forum rules and encourage quality posts. Forum rules don't need to be too complicated nor should they be too lengthy. ...
  2. Keep out the spam. ...
  3. Stay active and involved in the community. ...
  4. Monitor forum traffic.

What is the purpose of a community forum? ›

At its root, a community forum is a dedicated space where online users can raise questions, concerns, and ideas about a shared interest and expect a good amount of engagement from like-minded individuals and brands.

Is Microsoft Dynamics end of life? ›

On the 14th of April 2024, version 21 of Microsoft Dynamics Business Central (2022, wave 2) will be going end of life. This means that this version won't receive any more security updates, patches, or technical support from Microsoft.

What is Dynamics CRM called now? ›

Microsoft Dynamics 365 Customer Engagement (formerly Microsoft CRM).

How hard is Microsoft Dynamics? ›

One of the strengths of Microsoft Dynamics 365 lies in its adaptability. Organizations can customize the software to suit their unique needs and workflows. However, this flexibility comes with a price — a higher learning curve. Understanding the customization options and effectively configuring them can be challenging.

What is a thread in a conversation? ›

A thread is a series of similar messages or posts on a specific topic, with a sequential order of comments that make way for a conversation or debate. Threads provide an organized and linear way to initiate, participate, and follow a discussion.

What is a thread in a group chat? ›

Threads help you create organized discussions around specific messages. They let you discuss a topic in more detail without adding clutter to a channel or direct message (DM) conversation.

What does it mean to thread a comment? ›

Threads typically begin with an initial post or comment and are followed by additional posts or comments from other users, creating a chain of related content. Threads are commonly used on Twitter and Reddit, where users can reply to posts and comments to continue the conversation.

What is a thread in an article? ›

Simply, threads are topics. They are found by compiling, in order, the (grammatical) subjects of neighboring sentences and clauses. For example, if you underline all the subjects within a paragraph, this assemblage will group into topics.

Top Articles
Latest Posts
Article information

Author: Madonna Wisozk

Last Updated:

Views: 5490

Rating: 4.8 / 5 (68 voted)

Reviews: 91% of readers found this page helpful

Author information

Name: Madonna Wisozk

Birthday: 2001-02-23

Address: 656 Gerhold Summit, Sidneyberg, FL 78179-2512

Phone: +6742282696652

Job: Customer Banking Liaison

Hobby: Flower arranging, Yo-yoing, Tai chi, Rowing, Macrame, Urban exploration, Knife making

Introduction: My name is Madonna Wisozk, I am a attractive, healthy, thoughtful, faithful, open, vivacious, zany person who loves writing and wants to share my knowledge and understanding with you.