0

我有下面的代码,但它抛出了错误,说 If 语句没有用 EndIf 关闭。我尝试了一些不同使用 () 的变体,但没有运气。非常感谢您的帮助。谢谢!

%%[

SET @CurrentCourse = Item_Group__c
SET @Location = Location__c

IF IndexOf(@Location, "Melbourne") > 0 AND @CurrentCourse == "Course 1" THEN 
SET @NextCourse = "Course A" 
SET @CurrentPermit = "Permit 1"

ELSEIF IndexOf(@Location, "Sydney" > 0 AND @CurrentCourse == "Course 1" THEN 
SET @NextCourse = "Course B" 
SET @CurrentPermit = "Permit 1"

ELSEIF IndexOf(@Location, "Perth") > 0 AND @CurrentCourse == "Course 1" THEN 
SET @NextCourse = "Course C" 
SET @CurrentPermit = "Permit 2"

ENDIF
]%%
4

2 回答 2

0

在陈述 If 语句之前,我似乎已经通过为 IndexOf 设置变量来解决这个问题。所以...

%%[

SET @Melbourne = IndexOf(@Location, "Melbourne")
SET @Sydney = IndexOf(@Location, "Sydney")
SET @Perth = IndexOf(@Location, "Perth")

IF @Melbourne > 0 AND @CurrentCourse == "Course 1" THEN 
SET @NextCourse = "Course A" 
SET @CurrentPermit = "Permit 1"

ELSEIF @Sydney > 0 AND @CurrentCourse == "Course 1" THEN 
SET @NextCourse = "Course B" 
SET @CurrentPermit = "Permit 1"

ENDIF
]%%
于 2019-03-31T09:32:25.103 回答
0

如果在“Sydney”之后,您的第一个 else 似乎缺少括号</p>

ELSEIF IndexOf(@Location, "悉尼" >

于 2019-06-25T21:58:08.607 回答