#LOCAL("SelectedUserID",#UNDEF)#LOCAL("UserBillingAddress",#UNDEF) #IF(#DEFINED(#INPUT.SelectedUserID)) #REM#ENDREM #SET("SelectedUserID",#INPUT.SelectedUserID) #LOOP(#Users) #IF(#ID EQ #SelectedUserID)#IF(#DEFINED(#BillingAddress))#SET("UserBillingAddress",#BillingAddress)#ENDIF#ENDIF #ENDLOOP #ELSE #REM#ENDREM #LOOP(#Users) #IF(#ItemNo==0)#SET("SelectedUserID",#ID)#IF(#DEFINED(#BillingAddress))#SET("UserBillingAddress",#BillingAddress)#ENDIF#ENDIF #ENDLOOP #ENDIF

{Notification}

{HowToCompare}
#IF(#COUNT(#Users)>1)


#ENDIF
#LOCAL("HasUS", 0)#LOCAL("HideUSStates",0)#LOCAL("HideBing",1) #LOOP(#Shop.RegistrationSet) #IF((#IsVisible AND #DEFINED(#Attribute.AttributeClass.Alias) AND #Attribute.AttributeClass.Alias EQ "Address") OR (#HasUS AND #Attribute.Alias EQ "State")) #LOCAL("UserBillingAddressAA",#GET("UserBillingAddress.".#Attribute.Alias)) #LOCAL("BillingAddressAA",#GET("BillingAddress.".#Attribute.Alias)) #ENDLOCAL#ENDLOCAL #ENDIF #ENDLOOP #ENDLOCAL#ENDLOCAL#ENDLOCAL

{CustomerData}

#Attribute.NameOrAlias #IF(#IsMandatory)*#ENDIF #BLOCK("WITH_FORM_ERROR", #FormError)#LOCAL("ErrorItemNo",0) #LOCAL("Value", #BillingAddressAA) #LOCAL("ObjectClass","Customer") #INCLUDE("INC-AddressAttributes") #ENDLOCAL #ENDLOCAL#ENDLOCAL #ENDBLOCK {ApplyToUserAddress}
#LOCAL("HasUS", 0)#LOCAL("HideUSStates",0)#LOCAL("HideBing",1) #LOOP(#Shop.RegistrationSet) #IF((#IsVisible AND #DEFINED(#Attribute.AttributeClass.Alias) AND #Attribute.AttributeClass.Alias EQ "Address") OR (#HasUS AND #Attribute.Alias EQ "State")) #LOCAL("UserBillingAddressAA",#GET("UserBillingAddress.".#Attribute.Alias)) #LOCAL("BillingAddressAA",#GET("BillingAddress.".#Attribute.Alias)) #ENDLOCAL#ENDLOCAL #ENDIF #ENDLOOP #ENDLOCAL#ENDLOCAL#ENDLOCAL

{UserData}

{ApplyToCustomerAddress} #BLOCK("WITH_FORM_ERROR", #FormError)#LOCAL("ErrorItemNo",0) #LOCAL("Value", #UserBillingAddressAA) #LOCAL("ObjectClass","User") #INCLUDE("INC-AddressAttributes") #ENDLOCAL #ENDLOCAL#ENDLOCAL #ENDBLOCK
#ENDLOCAL
{MandatoryFields} #ENDLOCAL