2017-01-31 2 views
1

사람이 표현 나는이에 해결하는 것입니다 몇 가지가있는 것 같습니다Netsuite의 사례는 사용자 정의 검색 식을 "잘못된 표현"을 반환 할 때

case When ({item.locationquantitybackordered} > 0 AND {quantitycommitted} > 0) 
Then ({item.locationquantitybackordered}+{quantitycommitted}) 
Else 
when {item.locationquantitybackordered} > 0 
Then {quantitycommitted} = 0 
Else {item.locationquantitybackordered} = 0 
{item.locationquantitybackordered}+{quantitycommitted} 
End 
End 

답변

4

에 어떤 문제가 있는지를 도와 줄 수 있습니다.

먼저 앞에 ELSE이 필요하지 않습니다. 마지막 조건으로 CASE 문 끝에 WHEN 중 하나만 있어야합니다.

두 번째로 END 문은 필요하지 않습니다. CASE 문 하나당 하나만 필요합니다. 중첩 된 CASE 문이 있으면 하나가 필요할 수 있지만 그렇게하지 않아도됩니다.

마지막으로, ELSE 실제로 훨씬 이해가되지 않습니다 - 당신이 거기에 두 개의 문을 가지고 {item.locationquantitybackordered} = 0 적절한 값이며 {item.locationquantitybackordered} + {quantitycommitted}, (시험이 아닌 값이다), 그리고 당신과 동일 위의 첫 번째 경우.

나는 당신의 문을 다시 것 같은 :

CASE 
    WHEN ({item.locationquantitybackordered} > 0 AND {quantitycommitted} > 0) THEN ({item.locationquantitybackordered} + {quantitycommitted}) 
    WHEN {item.locationquantitybackordered} > 0 THEN 0 
    ELSE {item.locationquantitybackordered} + {quantitycommitted} 
END