Skip to Content
author's profile photo Former Member
Former Member

XBO based on User role.

Hi Everyone

I have extended an Xbo "Customer" with the following element "UI field".

element TCDataLocked : Indicator = false;

The use case is that once the UI field is selected the "Other fields" on the UI will get locked (Read only). it is achieved using binding in "Adjust properties" operation.

This function is working perfect but now I want this UI field to be executed only by some users e.g. Managers.

I am struggling to come up with required AfterModify script. Please any guidance will be greatly appreciated.

kind regards

Asad

Add a comment
10|10000 characters needed characters exceeded

Related questions

2 Answers

  • Best Answer
    Posted on Jul 24, 2014 at 02:46 AM

    Hi Asad,

    You need to use another Indicator field for TCDataLocked .

    element isManager:Indicator;

    var identity = Identity.Retrieve(Context.GetCurrentIdentityUUID());

    var occupationCode=identity.Person.CurrentCommon.Person.OccupationCode.GetDescription();

    if(occupationCode=="Manager")

    {

    this.isManager=true;

    }else{

    this.isManager=false;

    }

    Hope this helps.

    Fred.

    Add a comment
    10|10000 characters needed characters exceeded

  • Posted on Jul 24, 2014 at 07:57 AM
    Add a comment
    10|10000 characters needed characters exceeded

    • Former Member

      Hi Alessandro

      Thanks for your reply I am aware of the UI switches and at least the ones for Standard fields. But I was looking for one about "Non Standard use" and your blog about that is really useful. I will be trying it very soon.

      For this current issue our customer wants this field to be based on some script and since I don't have a lot of experience here I have posted this question. I need some script help here. thank you

      Regards

      Asad

Before answering

You should only submit an answer when you are proposing a solution to the poster's problem. If you want the poster to clarify the question or provide more information, please leave a comment instead, requesting additional details. When answering, please include specifics, such as step-by-step instructions, context for the solution, and links to useful resources. Also, please make sure that you answer complies with our Rules of Engagement.
You must be Logged in to submit an answer.

Up to 10 attachments (including images) can be used with a maximum of 1.0 MB each and 10.5 MB total.