Precisely Enterworks

 View Only
  • 1.  Validation Error For A Dynamic Attribute

    Posted 02-14-2022 11:53
    Hi.

    Is there a SQL query that can flag an attribute as an error if a value has been established and then a user sets the value to null? We don't want to flag the error if a value was never set for it though.

    Example:
    1. For our B2B system, we have a flag called Dealer Portal Displayable. This attribute is null by default. We don't want the system to flag this as an error.
    2. We set Displayable to "Display" so that it then goes online to our Portal.
    3. Once set, we'd like a validation rule that will flag an error for that staging record if somebody changes the attribute back to null; instead of the "Removed" value which is proper process.
    Many users don't understand that changing the value to null will not remove the record in the connected system. If I create the validation error, then that will flag the record as invalid and allow for the user to reconsider their edit.

    Thanks,
    -Jon

    ------------------------------
    Jon Varo | Manager, Product Information Management
    Fender Musical Instruments Corporation | 480-845-5823
    ------------------------------


  • 2.  RE: Validation Error For A Dynamic Attribute

    Posted 02-15-2022 08:27
    Hey Jon. The only way I can think of is if you search 'B_REPOSITORY_ITEM_HISTORY' to see if that record has a history record with a value for that attribute.

    ------------------------------
    -Sidd
    ------------------------------



  • 3.  RE: Validation Error For A Dynamic Attribute
    Best Answer

    Employee
    Posted 02-25-2022 03:16
    Jon,

    One way to accomplish this would be to define additional attributes in the repository, one for each discrete or set of attributes that would indicate whether those attributes have been populated.  Then define a validation rule on the original attribute that says it is required, but only if the flag attribute has been set.  Then define a VTL or Change Notification rule to set the flag when the original attribute is set to a value.  So when the record is first created, the required rule will be inactive, allowing for the original attribute to be empty.  But once a user populates the attribute, the flag will be set and then the required rule will be applied.  If the original attribute is subsequently cleared, it will be flagged with a validation rule.  The user could then use the history and rollback function to restore the value, which would make it valid again.

    If you have a large number of attributes an each needs to be managed separately, then you would end up with a lot of flag attributes (one for each of the original attributes) and a separate validation rule (with condition) for each.  If a set of attributes can be treated as a group where once one of the attributes is populated, then all are required, then a single flag attribute can be used and the same rule (with condition) can be assigned to each of the attributes in that group.

    The flag attributes can be placed on a hidden tab so they don't clutter up the UI, but they should not be hidden via security as that will eliminate the ability to populate them via VTL or Change Notification.

    -Brian

    ------------------------------
    Brian Zupke | Senior Technical Support Engineer
    Winshuttle North America | 909-900-9179
    ------------------------------