Home Analyst Portal

Adding a Custom Button to RelatedUserInfo

James_JohnsonJames_Johnson Customer Advanced IT Monkey ✭✭✭
We are going to use the Notes field on Users to store some information and would like the ability to edit that from a user page on the portal.  I've changed the notes area to a long string so it can be typed in but I'm not sure how to go about creating a button to actually save that data back to the db.

Does anyone know of some good examples of that or would be willing to help out?



  • Options
    Ingrid_GlatzIngrid_Glatz Customer Adept IT Monkey ✭✭

    Did you modify the UserProfile.js to add the Notes field? We have modifications in this file to show more information for the user on the User Settings page, but do not allow to edit. By default, this page can be saved. You could change the parameter "Disabled: true" to "Disabled: false" to allow the Notes field to be edited and be saved using the default button on this page.

    The file can be found in inetpub\CiresonPortal\Scripts\forms\templates, changes have to be done in section "name: "Profile"". I hope this is what you're looking for.


  • Options
    James_JohnsonJames_Johnson Customer Advanced IT Monkey ✭✭✭
    edited December 2018
    I had edited the RelatedUserInfo.js not user profile. I'm trying to update the notes of other users from the RelatedUserInfo page. There is a nice Community Upload about editing user info from Adrian Peach and I think his update function is close to what I need but I'm not sure how to pull the information from the page instead of his kendo window.

    That code was: (not sure why the code block is only doing the first line, works fine in preview)  
    <div>function UpdateUserProperties (objUser, objUserUpdated) {</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;var strData = { "formJson":{"original": objUser, "current": objUserUpdated}}</div><div>        //console.log (strData);&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;$.ajax({</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;url: "/api/V3/Projection/Commit",</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;type: "POST",</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;contentType: "application/json; charset=utf-8",</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;dataType: "json",</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;data: JSON.stringify(strData),</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;success: function (d) {</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;console.log("Successfully updated user details for '" + objUserUpdated.DisplayName + "'!");</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;},</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;error: function (d) {</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;}</div><div>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;});</div><div>&nbsp;&nbsp;&nbsp;&nbsp;}
Sign In or Register to comment.