Hi
I want to implement that a reason must be mandatory when prolongating or unsubscribing an order.
I tried diffrent approaches but nothing works. Following what I tried:
Firstly, I set the minimum character to 1 on the <OrderReason> column on the PersonWantsOrg table. That only worked for the initial order. After that it didn't work anymore. I think that is because if the new reason is "empty" (when prolongating or unsubscribing) the system does take the existing reason and uses it for the prolongation. On this premise, I tried this code below on the <OrderReason> column in the formatting script section. I tried to check if the reason is empty, null or white space. I also tried to check if the "new" reason is equal to the existing one since I thought that OneID does take the existing value if the user doesn't set a new reason in the webshop. All this failed, too.
Dim str As String = Convert.ToString(Value) If String.IsNullOrWhiteSpace(str) Throw New ViException("Bitte geben Sie eine Begründung ein (Null or White Space).", ExceptionRelevance.EndUser) ElseIf String.IsNullOrEmpty(str) Throw New ViException("Bitte geben Sie eine Begründung ein (Null or Empty).", ExceptionRelevance.EndUser) ElseIf str = $OrderReason$ Then Throw New ViException("Eingabe entspricht alter Begründung. Bitte geben Sie eine neue Begründung ein.", ExceptionRelevance.EndUser) End If
Furthermore, I tried to set the minimum character to 1 in the webdesigner. That also failed. Lastly, I tried to make it mandatory through request properties. That also only works for the initial order.
I somehow think that OneID does take the old value as a reason if none is given but then I don't understand why my check (as shown above --> str = $OrderReason$) doesn't throw an exception. Did someone implement a mandatory reason field when prolongating or unsubscribing or have some tips?
Thanks for your help.