Cannot figure out how to use "On property changed script" in request parameters

I am using 9.0LTS

I am creating request parameters as follows (for an IT Shop request):

paramTenant - Tenant name 

paramPartner - Partner name

paramFirstName - First name

What I have is that you can select an AAD tenant (paramTenant), and then select a user within that tenant (paramPartner).   What I would like to do, and not sure if it is possible, that if you select a paramPartner user, that it will use that UID_AADUser to populate paramFirstName with the value from the AADUser record.  Sounds easy.

I think I need to use the On property changed script on the paramPartner parameter. However, it seems that what I put it there does not work....

I have tried

ParameterSet("paramFirstName") = "test value"

$PC(paramFirstName) = "test value"

It keeps complaining that Class member declaration expected.

I did try this code from this post but get the same error:  RE: Request properties (new style): Change parameter type dynamically

At the moment I am just trying to set field values when paramPartner is changed before trying the more complicated requirement.

So, two questions

  1. How do I set another parameter field value on update of a property being changed?
  2. Am I able to achieve what I am wanting (or is it outside the scope of the request parameter)?
Parents
  • Yeah, so I have had complete headaches trying to do simple things like you (and 9.0 LTS is the worst - its pretty much a basic beta with lots of issues - do you have CU4 applied? That apparently has some fixes)....there are a couple of things I've noticed:

    • When setting another field's value, the UI can take time to update and often not until other fields have been onblur'ed - ridiculous and painful, but out of any control.
    • Take into account table security. In the new portal, DB table/column rights are far more important than they were in the old portal (pretty much all your properties work with the current user - not a system or the like - so need to map through to DialogGroup and determine required rights to select/insert/update/delete data.
    • I've found onChange not overly useful/unexpected behaviour - it also seemed to have limited coding options (seemed to me it was more UI interactions) - I was using Validation script more than anything (which seemed to be more aligned to DB interactions).
    • You were close with syntax, it is: ParameterSet("paramFirstName").Value = "test value"
    • If you're setting the value of the field you are in, then its simply Value = "test value".
  • Thank you.  Did you ever figure out how to hide fields programmatically.  Maybe instead of updating fields, I will just hide the fields if the paramPartner does not have anything in it and deal with it in process orchestration.

  • I believe there is a ParameterSet("paramFirstName").IsHidden (which seems to work hiding it " = True", but doesn't handle unhiding " = False") - this was similar behaviour I saw with .IsReadOnly as well.

  • Thanks Ben.  IsHidden does not seem to be a thing (at least in 9.0).  I started to play around with Valuation script, but it only seems to be called when starting the form, and not when any field updates.  Not sure of its purpose - unless it is just that - to set an initial value?

  • "Valuation" = what should the initial value be?

    "Validation" = is what is entered valid?

Reply Children
No Data