Skip to main content
mollyn6512
Known Participant
Sep 16, 2022 3:44 AM UTC
Question

Is there anyway to call an interface into another interface which is using a!cardLayout function?

Hi everyone,

I just created one interface which queries data from a record type, to build a dashboard. 

I want to call that interface into a bigger interface, in which if I click the card field, the dashboard will show up. This existing interface is using a!cardLayOut for displaying other field, and I couldn't find any solution to call the new interface into it, as the a!cardLayOut link parameter only accepts  a!documentDownloadLink(), a!dynamicLink(), a!newsEntryLink(), a!processTaskLink(), a!recordLink(), a!reportLink(), a!safeLink(), a!startProcessLink(), a!submitLink(), a!userRecordLink(), or a!authorizationLink().

Is there any way I can work around with it?

    6 replies

    Inspiring
    Sep 16, 2022 3:52 AM UTC

    you can use dynamic link and in that you can set the flag to a local variable and set the show when functionality of the subinterface WRT to local variable.

    mollyn6512
    Known Participant
    Sep 16, 2022 4:10 AM UTC

    Sorry I don't quite get you here, so I set a local variable as false, then when click the field, the local variable change value and show the interface?

    Inspiring
    Sep 16, 2022 4:27 AM UTC

    a!localVariables(
      local!showNewInterface: false,
      {
        a!cardLayout(
          style: "STANDARD",
          link: a!dynamicLink(
            saveInto: {
              a!save(
                local!showNewInterface,
                not(local!showNewInterface)
              )
            }
          ),
          contents: {
            a!richTextDisplayField(
              value: a!richTextItem(
                text: "Click to " & if(local!showNewInterface, "Hide", "Show")
              )
            )
          }
        ),
        a!cardLayout(
          showWhen: local!showNewInterface,
          contents: {
            a!richTextDisplayField(
              value: a!richTextItem(text: "New Interface")
            )
          }
        )
      }
    )

    Inspiring
    Sep 16, 2022 4:17 AM UTC

    Hi

    As Deepak mentioned, you can use dynamic link to achieve your use case. See sample code below

    a!localVariables(
      local!showNewInterface: false,
      a!cardLayout(
        style: "STANDARD",
        link: a!dynamicLink(
          saveInto: {
            a!save(local!showNewInterface, not(local!showNewInterface))
          }
        ),
        contents: {
          a!sectionLayout(
            contents: {
              a!textField(
                label: "Example Filed",
                value: "Any Value",
                readOnly: true
              )
            }
          ),
          /*Here you can call your interface*/
          a!sectionLayout(
            showWhen: local!showNewInterface,
            contents: {
              a!textField(
                label: "Show this Interface when link clicked",
                value: "Any Value",
                readOnly: true
              )
            }
          )
        }
      )
    )

    Participating Frequently
    Oct 25, 2022 11:06 PM UTC

    Hey Naresh?

    Are you referring to call interface in the text field?

    Participating Frequently
    Oct 26, 2022 2:13 AM UTC

    No, Here as we can clearly see that he is calling the interface in the contents of the card layout and applying for show when condition on it.