7 Replies Latest reply on Sep 28, 2015 12:09 PM by GaryLyon

    "Name" attribute has "wrong data type"

    erik.marple Expert

      I was attempting to create a new attribute on the User Group business object but received this error:

       

      Error on saving changes:

      Name attribute of Class Type UserGroup has the wrong data type. Name attributes must have a String or Integer data type.

       

      Since there is no "Name" attribute, maybe it means the attribute that is marked as Is Name in the database, which looks the linked "User" attribute which I can't change. Has anyone run across this before and found a way around it? Since I can't create any new objects due to this error, I'm pretty much stuck with this object as it is.

        • 1. Re: "Name" attribute has "wrong data type"
          erik.marple Expert

          As a follow up, when I attempt to add a new attribute and set it as Is Name in the details, I get this:

           

          Error on saving changes:

          Cannot modify the name attribute of Class Type 'System.UserGroup' because it is a System or Application-defined Class Type. You can only modify the name attribute of a User-defined Class Type.

          • 2. Re: "Name" attribute has "wrong data type"
            GaryLyon SupportEmployee

            Hello Erik,

             

            I do receive the same error when attempting but I would like to know a little bit more about what you would like to accomplish. This is a system table for the User and Group Relationships with no editable window. We might have more luck placing the attributes in another table.

             

            Best of luck,

            Gary

            • 3. Re: "Name" attribute has "wrong data type"
              erik.marple Expert

              Hi Gary - Thanks for the response. We allow users to manage their own group notifications through a query gadget that displays their group membership info from System>User Group. It shows the group name, the team leader, and whether notifications are on or off (using the Receive Group Messages boolean attribute). When they click a group, they're presented with a User Group window where they can check or uncheck the box for Receive Group Messages. It's odd you say it doesn't have an editable window because it seems like an OOTB window...the window Name doesn't have an underscore before it, it's just "UserGroup2011".

               

              The "Receive Group Messages" attribute is just a boolean check box, so it displays "true" and "false" where we have Notifications listed in the query template for the gadget. True/False is sort of clunky looking, so I was attempting to add a little polish by creating a calc attribute that would display as "on" and "off" or even show an image.

               

              I managed to get it working in a sandbox environment (see below), but only after manually editing the database to get around that error (marking something else as the Name attribute). It's a pretty minor feature so we'll just skip it if it requires manipulating the database.

               

              In the screenshot below, what we currently have is "Notification:true/false" where the image is displayed.

              Capture.PNG

              • 4. Re: "Name" attribute has "wrong data type"
                GaryLyon SupportEmployee

                Good Evening Erik,

                 

                Sorry I must have hit correct answer on accident and you are very much correct about there being a window (I don't know what I was thinking.)

                 

                I was able to go into object designer and set the true and false text:

                True-False.jpg

                 

                This then changed the Check Box to Drop down on the web:

                DropDown.jpg

                 

                If you remove the Text in True and False it will turn back into a check box on the web:

                Checkbox.jpg

                 

                Alternatively, you can also change the text to On/Off if you choose.

                 

                Let me know if this helps,

                Gary

                • 5. Re: "Name" attribute has "wrong data type"
                  erik.marple Expert

                  Thanks, that's probably the closest we'll get. Appreciate the help!

                  • 6. Re: "Name" attribute has "wrong data type"
                    erik.marple Expert

                    Ooh I just got it working with images by using image files named true.png and false.png in the report template like this:

                     

                    <img src="/ServiceDeskResources/{ReceiveGroupMessages}.png" height="11">

                     

                    I guess that eliminates the need for the calc and adding another attribute, which solves everything. Thanks again

                    • 7. Re: "Name" attribute has "wrong data type"
                      GaryLyon SupportEmployee

                      Good Morning Erik,

                       

                      You are more than welcome. I know that it could be done with some SQL triggers, Window Copy Rules, and another Business Object (without modifying the DB as we cannot make any other changes to this business object.) I will send this off to the Development team to see why this is the case (to properly be fixed.)

                       

                      If you need anything else please let us know,

                      Gary.