Giter VIP home page Giter VIP logo

salesforce-code-examples's Introduction

The problem: We want to display some records using JavaScript datatable, but in case of some records we have to display in one row data that comes from two different related objects (where the parent is the "main" object).

In this specific case we are using 4 objects.

  • Zoo - here we want to display JS datatable that contains related Animal records
  • Animal - here we have a Lookup to the Zoo and Animal Template objects
  • Animal Origin - here we have a Lookup to the Animal object

The relation between the Animal and Animal Origin objects is one to many, so obviously one Animal can have 0 or many related Animal Origin records. But in this specific case we are assuming that the backend logic of the application always delivers only ONE unique Animal Origin (or 0 if there is no existing related record) record related to the Animal.

We want to achieve something like this:

The problem here is that the "main" object that we are using to fill the datatable is Animal and it is a parent for the Animal Origin object. So we cannot just use the "dot notation" to access fields of the related object (we could do this if the Animal object were a child of the Animal Origin object).

This example presents the way to use the wrapper class that wraps Animal and Animal Origin records that are related to each other.

salesforce-code-examples's People

Contributors

adriankurek avatar artysta avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.