Forum Stats

  • 3,827,551 Users
  • 2,260,791 Discussions
  • 7,897,297 Comments

Discussions

BUG In using Substitution Strings inside Faceted Search button actions

PPytlak
PPytlak Member Posts: 1 Green Ribbon

Hi.

firstly I do not know where is the place to confirm about possible bugs in Apex so I decided to write here

I've created my first faceted search. I've added two buttons on each CARD (2 columns presentation). Between button actions I have a subtitle action (maybe it's important to inform).

One of the button is primary, one secondary. Both of them are connected with redirect to URL and javascript:apex.confirm is call. Both of them I've created with &MSG_CONFIRM. declaration of the question text. so it looks like that:

javascript:apex.confirm(&MSG_CONFIRM., {request: 'XXX' ...

Only one action works. On Chrome console I see an error about missing ")", but I'm sure string is correct. Especially that when I delete one of the button, other works correctly (that one with didn't work before).

Of course - I can not use substitution strings, just write it inside - then it works correctly, but I like to use substitution strings ;). Maybe U heard about that kind of issue or maybe someone did the same and didnt have hat kind of problem?

PS MSG_Confirm has some Polish special characters

Tagged:

Best Answer

  • fac586
    fac586 Senior Technical Architect Member Posts: 20,980 Red Diamond
    edited Jan 20, 2022 10:44AM Answer ✓

    Please update your community profile with a recognisable username instead of "User_ZL2Y6".

    Both of them I've created with &MSG_CONFIRM. declaration of the question text. so it looks like that:

    javascript:apex.confirm(&MSG_CONFIRM., {request: 'XXX' ...
    

    What type of component is MSG_CONFIRM? When, where, and how is its value set?

    It is a bug, but in your code, not APEX. &MSG_CONFIRM. is a lexical substitution string, not a variable. It must be enclosed in quotes and JavaScript escape filtered to produce valid JavaScript syntax:

    javascript:apex.confirm('&MSG_CONFIRM!JS.', {request: 'XXX' ...
    

Answers

  • fac586
    fac586 Senior Technical Architect Member Posts: 20,980 Red Diamond
    edited Jan 20, 2022 10:44AM Answer ✓

    Please update your community profile with a recognisable username instead of "User_ZL2Y6".

    Both of them I've created with &MSG_CONFIRM. declaration of the question text. so it looks like that:

    javascript:apex.confirm(&MSG_CONFIRM., {request: 'XXX' ...
    

    What type of component is MSG_CONFIRM? When, where, and how is its value set?

    It is a bug, but in your code, not APEX. &MSG_CONFIRM. is a lexical substitution string, not a variable. It must be enclosed in quotes and JavaScript escape filtered to produce valid JavaScript syntax:

    javascript:apex.confirm('&MSG_CONFIRM!JS.', {request: 'XXX' ...