on 07-23-2014 2:16 PM
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
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.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi, Asad.
This code, actually, I did not test it myself.
var occupationCode=identity.Person.CurrentCommon.Person.OccupationCode.GetDescription();
Can you test it and display in some test field?
Can you find out what the occupation code for the current user in debugging or using some dummy field?
Hope this helps.
Fred.
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
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
User | Count |
---|---|
82 | |
10 | |
10 | |
9 | |
6 | |
6 | |
5 | |
5 | |
4 | |
3 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.