depending on two variables I want to display different text boxes in a template generator which I assume is based on Delphi.
Selection of the text box will be depending of the receivers country (AVX['M_COUNTRYC']) and article category (artcategory). There are at least 4 categories named 'Lizenz', 'Digifit', 'Hardware' and 'Accessories'.
I wanted to generate the following outcome:
- OPTION 1: Country is D --> Default text box (DBMemoSchlusstext) appears
- OPTION 2: Country is not D and not CH and at least one of the items categories is Hardware or Accessories --> Textbox HardEU appears
- OPTION 3: Country is not D and none of the items has category Hardware or Accessories --> Textbox LizNotDE appears
- OPTION 4: Country is not D but CH and at least one of the items categories is Hardware or Accessories --> Textbox HardNotEU appears
I already tried different approaches but none of them work:
Approach 1:
if not (AVX['M_COUNTRYC'] = 'D') then begin
if (AVX['M_COUNTRYC'] = 'CH') and (AVX['P_ARTCATEGORY'] = 'Lizenz') or (AVX['P_ARTCATEGORY'] = 'DIGIFIT') then begin
DBMemoSchlusstext.visible := false;
LizNotDE.visible := true;
end
else if (AVX['M_COUNTRYC'] = 'CH') and (AVX['P_ARTCATEGORY'] <> 'Lizenz') and (AVX['P_ARTCATEGORY'] <> 'DIGIFIT') then begin
DBMemoSchlusstext.visible := false;
HardNotEU.visible := true;
end
else if (AVX['M_COUNTRYC'] <> 'CH') and (AVX['P_ARTCATEGORY'] = 'Lizenz') or (AVX['P_ARTCATEGORY'] = 'DIGIFIT') then begin
DBMemoSchlusstext.visible := false;
LizNotDE.visible := true;
end
else if (AVX['M_COUNTRYC'] <> 'CH') and (AVX['P_ARTCATEGORY'] <> 'Lizenz') and (AVX['P_ARTCATEGORY'] <> 'DIGIFIT') then begin
DBMemoSchlusstext.visible := false;
HardEU.visible := true;
end;
end else begin
DBMemoSchlusstext.visible := true;
end;
end;
Approach 2:
if (AVX['M_COUNTRYC'] = 'D') then DBMemoSchlusstext.visible := true;
else if (AVX['P_ARTCATEGORY'] = 'Lizenz') and (AVX['P_ARTCATEGORY'] <> 'Hardware') then LizNotDE.visible := true;
else if (AVX['M_COUNTRYC'] = 'CH') then HardNotEU.visible := true;
else HardEU.visible := true;
end;
Thanks in advance for any tips or recommendations