‎06-01-2022 01:30 PM
I have a Standard MetaAttribute 'Application URL'  of type String. I want to put a Validation Check on that MetaAttribute. The condition is that the user must not enter the space character in that field. It must be a continuous string without any spaces. Please help.
I thought of using the MetaAttributeUpdateTool but it is confusing.
Is there something similar out-of-the-box feature I can refer to? Or is there an alternate solution?
Solved! Go to Solution.
‎10-01-2022 09:46 AM
I'm not sure to understand your question... Now that you have the precise way to implement your macro, what is the problem to add a condition to the AttCtl_Update function ? Can you be more precise about what is not clear for you ?
‎10-01-2022 07:05 AM
Can we modify this to also check if the same URL has been entered previously for the same application?
‎06-01-2022 03:15 PM - edited ‎06-01-2022 03:16 PM
Hello,
I do not see any better ways then a metaAttributeUpdateTool.
Just code it the following way, and it should work :
'MegaContext(Fields,Types)
'Uses(Components)
Option Explicit
Function AttCtl_GetDefaultKind() As String 
End Function
Function AttCtl_Update(Context As MegaUpdateToolContext,Status As Integer,ErrorMessage As String) As Boolean
  Dim oRoot : oRoot = Context.GetRoot
  If Instr(Context.EditText, " ") > 0  Then
    ErrorMessage = "An URL must not contain space"
    Exit Function
  End If
End Function
Regards
Lionel