Error when use function document()

Certified Associate Developer

In my interface, I user function document.

if(
                            document(tofolder(local!documentId), "size") > 0,
                            true,
                            false
                          )

  Discussion posts and replies are publicly visible

Parents
  • 0
    Certified Lead Developer

    Create a rule with the below to check whether the document is valid or not.

    a!localVariables(
      local!document: 46,/*ID for any document */
      local!contentData: if(
        isnull(local!document),
        null,
        getcontentobjectdetailsbyid(local!document)
      ),
      if(
        isnull(local!document),
        false(),
        and(
          not(
            exact(
              local!contentData,
              "No object with this ID has been found"
            )
          ),
          find("Type: Document", local!contentData)
        )
      )
    )

Reply
  • 0
    Certified Lead Developer

    Create a rule with the below to check whether the document is valid or not.

    a!localVariables(
      local!document: 46,/*ID for any document */
      local!contentData: if(
        isnull(local!document),
        null,
        getcontentobjectdetailsbyid(local!document)
      ),
      if(
        isnull(local!document),
        false(),
        and(
          not(
            exact(
              local!contentData,
              "No object with this ID has been found"
            )
          ),
          find("Type: Document", local!contentData)
        )
      )
    )

Children