• 2 replies
  • Latest Post - ‏2013-10-03T07:07:42Z by Babin_AG
2 Posts

Pinned topic Mandatory Attribute for Secondary Spec

‏2013-08-02T09:26:16Z |


I am writing java standalone application for creating items from a csv file, and mapping it to respective category based on attribute value provided in csv file.

The data enrichment for these items in their respective categories will be done in later stage in a workflow.

The problem occur when I map the items to their categories and go for save. I am getting validation error for these items stating mandatory attributes from secondary attributes are missing.

Please help me to fix this issue asap.




Updated on 2013-08-02T09:27:21Z at 2013-08-02T09:27:21Z by RamnishJaiswal
  • KaranBal
    108 Posts

    Re: Mandatory Attribute for Secondary Spec


    Then the solution seems to be obvious. Modify the spec map for the import to include the mandatory attributes and then populate those attributes in a csv file. For details, refer to the file spec and spec map section int he following link:

    The product will not and should not let you save an item unless all mandatory attributes are populated.

  • Babin_AG
    18 Posts

    Re: Mandatory Attribute for Secondary Spec


    Hello, RamnishJaiswal.


    To disable system validation while import, or webservice or report or another job, you can use this trick:

    When retrieving or creating an item disable all processing options, except sequence population:

    public static Item getItem(String itemPK, String catalogName, boolean processingOptionsEnabled) {

            Context ctx = PIMContextFactory.getCurrentContext();
            Catalog catalog = ctx.getCatalogManager().getCatalog(catalogName);
            if (catalog == null) {
                throw new IllegalArgumentException("Catalog not founded: " + catalogName);
            if (!processingOptionsEnabled) {
    Item res = catalog.getitemByPrimarykey(itemPK);
    if(res == null) {
    res = catalog.createItem();
    if(itemPK !=null 
    && !itemPK.isEmpty()) {

            return res;