2013-03-20 11 views
3

我有一個基於具有非必需元數據字段ExtendedType的模式的組件。我可以查詢具有此領域具有一定價值的成分:Tridion查詢沒有確切元數據字段的組件

new CustomMetaValueCriteria(new CustomMetaKeyCriteria("ExtendedType"), "Highlight", Criteria.Equal))) 

我需要查詢有沒有這個字段填入一個組件如何可以查詢一個說。

在SQL我可以寫旁邊:

select * from t where t.ExtendedType IS NULL 

我怎樣才能做到這一點使用Trdion查詢?在共同我需要實現像查詢:

select * from t where t.ExtendedType = "Highlight" OR t.ExtendedType IS NULL 
+1

您可能需要考慮在http://tridion.stackexchange.com上使用Tridion專用堆棧交換站點來解決未來的SDL Tridion問題。 – 2013-04-16 20:56:18

回答

1

您或許能夠與NotInCriteria實現這一目標,如下所示:

new NotInCriteria 
(
    new CustomMetaValueCriteria 
    (
     new CustomMetaKeyCriteria("ExtendedType"), "%", Criteria.Like 
    ) 
) 

我沒有測試過這一點,這只是一個想法。即使它工作,一定要檢查它是否也執行!

PS:下一次,請使用tridion.stackexchange.com論壇Tridion相關的問題!

相關問題