Home Analyst Portal

How to enable the "Create Request On Behalf Of" field to end users for selected Request Offerings

Afzal_MalekAfzal_Malek Premier Partner IT Monkey ✭
Hello Cireson Community,

Is there a way to enable the "Create Request On Behalf Of" field to end users for selected Request Offerings only? Currently, the field is visible to SM Admins. I know also that we can set this in the 'Settings Item' to allow end users to view this field, however that will be shown to all Request Offerings. I want to limit end users to see this "Create Request On Behalf Of" field to maybe 1 or 2 request offerings. is this possible?

I added this script to the custom.js file, but it doesn't seem to work:

<div>var url = window.location.href;</div><div><br></div><div>function getLastPart(url) {</div><div>&nbsp; &nbsp; var parts = url.split("/");</div><div>&nbsp; &nbsp; return (url.lastIndexOf('/') !== url.length - 1 ? parts[parts.length - 1] : parts[parts.length - 2]);</div><div>}</div><div>//Request Offering - User Onboarding</div><div>if (getLastPart(url) === "a4baca28-a336-4259-0430-360f394eb43f,8ae08b6f-d9d4-680e-2182-552b894888f2" || (getLastPart(url) === "2d24b825-d622-7387-ef4e-dd0f8a8314e6,41b253c7-a9fa-959e-5ee6-8eab191dee2f")) {</div><div>&nbsp; &nbsp;// Show your overlay</div><div>&nbsp; &nbsp;//alert("User Onboarding");</div><div><br></div><div>$(document).ready(function() {</div><div>&nbsp; &nbsp; // jQuery code goes here</div><div>$('body').append('<style> div.panel.ro-request-on-behalf { display: block;}</style>');</div><div><br></div><div>});</div><div>}</div>


Am I doing it right, or there are something else that I'm missing?

Looking forward to hearing from you guys. Thanks in advance!

Best Answer

Answers

  • james_kleinschnitzjames_kleinschnitz Cireson Dev, Product Owner Advanced IT Monkey ✭✭✭
    Your jQuery to hide the "Create Request On Behalf Of" field is not correct.  You need to use jQuery to actually hide the element. Try:

    $('div.panel.ro-request-on-behalf').hide();
  • David_AllenDavid_Allen Partner Advanced IT Monkey ✭✭✭
    HI James,

    Thanks for showing the code to hide the field, however do you know if there is a feature request to select whether the Create on Behalf Of field is available or not for a request offering?

    Most of our offerings to end users require the Create on Behalf Of field as each department has a nominee that will fill submit the requests on behalf of the users, however we do have some offerings where we don't want this functionality for security reasons.

    It would be nice if it was a selectable option, rather than having to update the custom.js file!

    Thanks, David.
  • Adam_DzyackyAdam_Dzyacky Product Owner Contributor Monkey ✭✭✭✭✭
    edited September 2017
    I'm with @David_Allen, it'd be great to be able to use that control within a request (ARO perhaps?). This also reminds me a bit of the Use Create on Behalf of to Drive Query Results feature request. That aside, I'm actually using Advanced Request Offering to address this scenario and built a series of inputs that lead the person filling the request out into...

    Who is this for?
    • Me
    • A direct report
    • Someone else
    Then using Advanced Request Offering, those Query Results are either hidden or flipped accordingly. In the last two options, the selected user is always related to the same object in the backend template. Using SCO and/or SMA runbooks, the Affected User is dynamically updated based on if this Relationship Object is found on said template.

    Even without ARO, this can be achieved by simply making an optionally selectable Query Result to the effect of "If this is for someone else, pick them here. Otherwise don't pick anything." It could be argued this is not as clean from a layout perspective, but still can leverage the aforementioned runbooks.
  • Afzal_MalekAfzal_Malek Premier Partner IT Monkey ✭
    edited September 2017
    Hi @james_kleinschnitz,

    Thanks for the script. Unfortunately, I didn't get it to work. What I want is to show the 'Create Request on Behalf' field for that particular Request Offering. Using the script that you provided, I changed the 'hide' to 'show':

    $('div.panel.ro-request-on-behalf').show();

    I then opened the Request Offering as an end user, but that field still wasn't displayed.

    Hi @David_Allen.

    Thanks for raising the feature request. I've voted to have this feature available as well.

  • james_kleinschnitzjames_kleinschnitz Cireson Dev, Product Owner Advanced IT Monkey ✭✭✭
    @Afzal_Malek
    For this to work the  'Create Request on Behalf' field has to be available.  So if your settings are such that the field does not show by default there is no way to add it via code.  You need to work your logic in reverse and hide the field when needed.

    Thanks
Sign In or Register to comment.