Skip to main content

Off Layout Field Value

Comments

5 comments

  • Bodie Minster

    Off layout fields will not be rendered in the page output, so they won't be accessible to a custom object. If you want to retrieve a value for an off-layout field, you can do it by using the current record id to pull the content record through the platform API. Then you can access the value you're looking for in the resulting FieldValues collection.

    Originally posted on March 3, 2025.

    0
  • Hatim Masamra

    Thank you for taking the time to reply to my question.

    The issue I'm having is that I'm able to access this off-layout field in all lower environments as seen in the screenshot below taken from developer tools, and the value is undefined since it has not been assigned yet at that moment:

    image 

    The same code deployed in pre-prod, and this is how it looks:

    image 

    Originally posted on March 3, 2025.

    0
  • Bodie Minster

    There must be something I'm missing. To confirm:

    • The JavaScript is contained inside a custom object
    • The field you are trying to access is configured as "off layout" in Application Builder
    • When the record page loads fully, the off layout field is visible in the DOM through developer tools?

    It's that last bullet I'm puzzling over, as I do not believe you should be able to find a field in the DOM at all if it's truly off layout.

    Originally posted on March 3, 2025.

    0
  • Hatim Masamra

    That's exactly what's happening here.

    In pre-prod, I'm not able to get the value of the off-layout field, and as you explained, I'm getting this error message:

    imageTo make sure I'm getting the same consistent behavior, I saved the record and this how it plays out

    I'm able to get the value of the off-layout field after saving the record in DEV as seen below.

    imageWhile still I'm not able to proceed in pre-prod since the next step depends on reading the value of the off-layout field.

    Originally posted on March 3, 2025.

    0
  • Bodie Minster

    The behavior you are observing in pre-prod is consistent with what I would expect. If it's off layout, you shouldn't be able to retrieve its value using getFieldById() because no field with a matching ID should be on the page.

    The behavior you are observing in DEV is puzzling to me, as Archer does not render off-layout fields. If it is truly the case that the field in question is off layout but somehow available in the DOM anyway, I'd recommend opening a support ticket, as that should not be the case.

    Originally posted on March 3, 2025.

    0

Please sign in to leave a comment.