Request properties (new style): Change parameter type dynamically

Hi,

In v92 I have a request property with a "User prompt" parameter that shows a selectable list of organizations the recipient belongs to when requesting a specific product.

A change has been approved that this selection should be skipped if the recipient belongs to only one organization. So I'm using the OnPropertyChangedScript to get a list of organizations for the recipient and try to  set the parameter to "Calculated" should this list had only one element. 

Problems I need help on:

  1. I'm unable to get the UID_PersonOrdered in the script. I've been browsing the forums and found this Provider.GetValue(Of string)("UID_PersonOrdered") object (not in the documentation) but that is not returning any value at all.
  2. I don't know how to set the parameter to "Calculated". I know how to set it to readonly (ParameterSet("param").IsReadonly) or mandatory, but I cannot find how to alter the ParameterType.
  3. Juan Carlos, forget it, that's not the way at all.

Any ideas?
Thanks.

Parents
  • Hi Juan Carlos,

    just to be sure, are we talking about 9.2.0 or 9.2.1?
    If 9.2.0, do you have any hotfixes installed for the angular web?

  • Hi Florian,

    It's 9.2.0 and ,yes, the latests commits have been applied to the qbm and qer libraries. There are customizations in my code, but none that affect the itshop. Anything I should check?

    What I've noticed is that the OnPropertyChangedScript is executed several times. I know it should run during initialization and when the parameter value has changed, but logs indicate that even at startup that gets done more than once.

    Now I wonder.. if the parameter is changed by this script , wouldnt that start an deadlock loop?

  • Just out of my head from my observation:

    On startup (create a new request) initialization is called twice, once for the loaded parameter of the parameter set assigned to AccProductParamCategory (the definition or base parameter if you like) and once for the initialization of the new parameter of the new parameter set for the new ShoppingCartItem.

    You need to keep that in mind.

Reply
  • Just out of my head from my observation:

    On startup (create a new request) initialization is called twice, once for the loaded parameter of the parameter set assigned to AccProductParamCategory (the definition or base parameter if you like) and once for the initialization of the new parameter of the new parameter set for the new ShoppingCartItem.

    You need to keep that in mind.

Children
  • Thanks, Markus. Yes, it's run twice as you said.

    Things I've noticed in v920: The OnPropertyChangedScript is executed even when you try to edit the request property in Manager. So be careful to add controls to avoid malfunction or you might find yourself deleting the whole request property. Also, if I set a value for the parameter on that script, I enter an infinite loop. 

    I need to dig more. And I'll try to run it in v93 to see how it behaves.