New style request properties: Calculated read-only property displayed in web form

Scenario

Consider three request properties:

--- Request property 1 ---
Name: EmailAddressSuffix
Parameter type: User prompt
Data Type: String
Data Source: Table

--- Request property 2 ---
Name: EmailAddressFreeTextPart
Parameter type: User Prompt
Data Type: String
Data Source: None

--- Request property 3 ---
Name: ResultingEmailAddress
Desired behaviour: Should be dynamically calculated depending on the other two properties in the format <EmailAddressFreeTextPart>.<EmailAddressSuffix>@domain.com and displayed as a read-only property within the web form, so the user can check the resulting email address before submitting the request.


With the obsolete request property definition, this was easily achievable by defining an according value template script for request property 3 and setting the read-only flag (AccProductParameter.IsReadonly)

Does somebody can give me a hint how to achieve this with the new style request properties?


Regards,
Manuel

  • On the valuation script for the attribute you want to make read only, you can set the IsReadOnly property to true. 

    ParameterSet("ResultingEmailAddress").IsReadOnly = true

    In the OnPropertyChangedScript for the request property 1 and 2 you can provide code that would update the ResultingEmailAddress.

    Dim strVal = Convert.ToString(Value)
    If Not String.IsNullOrWhiteSpace(strVal) Then
    	ParameterSet("ResultingEmailAddress").Value = String.Format("{0}.{1}@domain.com", ParameterSet("EmailAddressFreeTextPart").Value,ParameterSet("EmailAddressSuffix").Value)
    End If