Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Serge 12 posts 103 karma points
    Apr 15, 2016 @ 11:50
    Serge
    0

    CMSImport PRO 3.5 validating members

    Hi.

    I'm trying to validate imported members. I'm using FieldProviders to check columns values - set fieldProviderOptions.Break to true and throw an exception with detailed message. It works, I'm getting a list of fields errors, but members are still registered. Tried to validate records on RecordImporting, but there's impossible to generate errors list.

    So my questions:

    1. How can I prevent members with invalid fields from registering?
    2. Is it possible to validate fields depending on other fields(FieldProviders.Parse receives only one value)?
    3. Am I doing it right or there is another way to validate imported records?

    Thanks!

  • Richard Soeteman 4046 posts 12899 karma points MVP 2x
    Apr 16, 2016 @ 06:58
    Richard Soeteman
    0

    Hi Serge,

    Members are created before assigning values indeed. In case you want full control over data, it's best to write a DataProvider then you have full control over the data CMSImport will use for the import.

    Hope this helps,

    Richard

  • Serge 12 posts 103 karma points
    Apr 19, 2016 @ 11:12
    Serge
    0

    Hi Richard,

    Thank you for quick reply. Created a workaround for now: on RecordImporting event got needed data about currently imported record from RecordImportingEventArgs and stored it to request cache. So I have all needed data during validation and other events. Failed records are stored in request cache and related members are deleted on Imported event.

    Thanks for your help,

    Sergey.

Please Sign in or register to post replies

Write your reply to:

Draft