Topic
2 replies Latest Post - ‏2012-06-27T08:37:17Z by SystemAdmin
SystemAdmin
SystemAdmin
648 Posts
ACCEPTED ANSWER

Pinned topic Showing validation errors in PIM UI

‏2012-06-26T13:03:25Z |
Hi,

Is there any particular JAVA API available to show the attribute level validation error on the particular field itself. I have got a pre-developed validation framework which does the validation and send down the response object which has got the error message.
Any clue how to show that error message on the attribute field? The item shouldn't be saved as well.

Thanks,
Abhijeet
Updated on 2012-06-27T08:37:17Z at 2012-06-27T08:37:17Z by SystemAdmin
  • babinag
    babinag
    91 Posts
    ACCEPTED ANSWER

    Re: Showing validation errors in PIM UI

    ‏2012-06-27T05:24:53Z  in response to SystemAdmin
    Hi Abhijeet.M.

    Attribute level validation is a prepostprocessing validation.
    Java API for item snippet:
    
    @Override 
    
    public 
    
    void prePostProcessing(ItemPrePostProcessingFunctionArguments inArgs) 
    { AttributeInstance attrInstance = getYourInstanceToValidate(inArgs); inArgs.addValidationError(attrInstance, Type.VALIDATION_RULE, 
    "Bad, bad validation error"); 
    }
    

    If validation error occurs, item will not be saved.
    • SystemAdmin
      SystemAdmin
      648 Posts
      ACCEPTED ANSWER

      Re: Showing validation errors in PIM UI

      ‏2012-06-27T08:37:17Z  in response to babinag
      Thanks for the reply. It worked! )

      ~Abhijeet