特定类型代码无效且方法调用 impex.exportItemsFlexibleSearch 错误

Specific type code is invalid and Method Invocation impex.exportItemsFlexibleSearch error

请求你的帮助,我不知道为什么我仍然收到这些错误:(

20.06.25 18:47:40:992   ERROR   line 3 at main script: Flexiblesearch error: type code 'StockLevel ' invalid
20.06.25 18:47:40:992   ERROR   line 3 at main script: query was 'SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} AS SKU, {p.name} AS Brand_Name, {aas.code} AS Approval_Status, {p.onlineDate} AS Online_From_Date, {p.offlineDate} AS Online_To_Date, {cv.version} as Catalog_Version, {sl.available} AS Available_Stocks, {sl.reserved} AS Reserved_Stocks FROM {StockLevel AS sl}, {Product AS p}, {ArticleApprovalStatus AS aas}, {CatalogVersion AS cv} WHERE {p.code}={sl.productCode} AND {aas.pk}={p.approvalStatus} AND {cv.pk}={p.catalogVersion} AND {cv.version}='online' AND {aas.code}='approved' ORDER BY {sl.pk}'
20.06.25 18:47:41:173   ERROR   line 3 at main script: error executing code line at 3 : Sourced file: inline evaluation of: ``impex.exportItemsFlexibleSearch("SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} . . . '' : Method Invocation impex.exportItemsFlexibleSearch

这是我用于导出数据的 Impex:

INSERT_UPDATE StockLevel;pk[unique=true];product(code);product(name[lang=en]);product(approvalStatus(code));product(onlineDate[dateformat=MM-dd-yyyy]);product(offlineDate[dateformat=MM-dd-yyyy]);product(catalogVersion(version));available[allownull=true];reserved[allownull=true]
"#% impex.exportItemsFlexibleSearch(""SELECT DISTINCT {sl.pk} AS PK, {sl.productCode} AS SKU, {p.name} AS Brand_Name, {aas.code} AS Approval_Status, {p.onlineDate} AS Online_From_Date, {p.offlineDate} AS Online_To_Date, {cv.version} as Catalog_Version, {sl.available} AS Available_Stocks, {sl.reserved} AS Reserved_Stocks FROM {StockLevel AS sl}, {Product AS p}, {ArticleApprovalStatus AS aas}, {CatalogVersion AS cv} WHERE {p.code}={sl.productCode} AND {aas.pk}={p.approvalStatus} AND {cv.pk}={p.catalogVersion} AND {cv.version}='online' AND {aas.code}='approved' ORDER BY {sl.pk}"");"

谢谢。 :)

我试图在我的本地机器上 运行 您的脚本并导出数据。您是否检查 StockLevel 类型是否存在?它是 basecommerce 扩展的一部分。

另外,试试这个重构的 impex。当没有结果时它会起作用:

INSERT_UPDATE StockLevel;pk[unique=true];product(code);product(name[lang=en]);product(approvalStatus(code));product(onlineDate[dateformat=MM-dd-yyyy]);product(offlineDate[dateformat=MM-dd-yyyy]);product(catalogVersion(version));available[allownull=true];reserved[allownull=true]
"#% impex.exportItemsFlexibleSearch(""SELECT DISTINCT {sl.pk} FROM {StockLevel AS sl JOIN Product AS p ON {p.code}={sl.productCode} JOIN ArticleApprovalStatus AS aas ON {aas.pk}={p.approvalStatus} JOIN CatalogVersion AS cv ON {cv.pk}={p.catalogVersion}} WHERE {cv.version}='online' AND {aas.code}='approved'"");"