we created a custom unsubscribe page using the AMPscript and html/css combination. We have 3 consent types: (general) OptIn, OptIn_Products, and OptIn_Services. All 3 are type boolean. Now, since it's an unsubscribe page, we only have one form field - OptIn. After subscriber clicks on this option, this gets passed on to the confirmation page where all the back-end processing with AMPscript is done. This works well. However, we would like to add in the final UpdateDE AMPscript's arguments the 2 other consent lines, meaning, although not specifically mentioned, the 2 optins (products and services) would also get boolean: false in the target DE. When I tried to add this into updateDE (i.e. hard-code the boolean updates), the page stops working. Here's the code from second, processing page relevant to this case:
SET @rowsMaster=LookupRows("Master_Contacts","Contact_Key", @ContactKey)
IF RowCount(@rowsMaster)>0 THEN
SET @rowMaster=Row(@rowsMaster,1)
SET @Email=Field(@rowMaster,"Email_Address")
ENDIF
SET @ll_sub = CreateObject("Subscriber")
SetObjectProperty(@ll_sub,"EmailAddress", @Email)
SetObjectProperty(@ll_sub,"SubscriberKey", @ContactKey)
SET @client = CreateObject("ClientID")
SetObjectProperty(@client, "ID", BU-Id left blank on purpose)
SetObjectProperty(@client, "IDSpecified", "true")
SetObjectProperty(@ll_sub, "Client", @client)
Set @options = CreateObject("UpdateOptions")
Set @save = CreateObject("SaveOption")
SetObjectProperty(@save,"SaveAction","UpdateAdd")
SetObjectProperty(@save,"PropertyName","Status")
AddObjectArrayItem(@options,"SaveOptions", @save)
IF @checkboxO=="Optout" THEN
SET @checkboxO=0
SetObjectProperty(@ll_sub,"Status", "Unsubscribed")
SET @prodCheck=0
SET @servCheck=0
ENDIF
VAR @updateStatusMessage, @updateErrorCode, @updateOptions
SET @updateStatusCode = InvokeUpdate(@ll_sub, @updateStatusMessage, @updateErrorCode, @options)
updateDE("Master_Permission",1,"Contact_Key", @ContactKey, "OptIn",@checkboxO,"OptIn_Products",@prodCheck,"OptIn_Services",@servCheck)
]%%