UI Only Reference Fields - Documentation??

  • 1
  • Question
  • Updated 1 year ago
  • In Progress
This is probably just a Friday miss on my part but I've seen the UI-Only Models for 10.0 but I'm not at all understanding how Reference types are used for UI only fields. The closest I see is "Referential Data Access" but those steps look nothing like the Reference UI.

I haven't figured out if these UI only fields solve my use case, I think so, for a Java snippet I now have but want to remove.

Essentially we have picklist on multiple Account fields. (field1, field2, etc.). When a user is adding a new Contact I want the picklists from field1 to show. User then selects a value from that which is stored on the Contact. Same for field2, etc.

Once I can get the data to display and be selected by user I'm probably ok using the action framework to store the data on Contact. But displaying is perplexing me.
Photo of ddeveaux

ddeveaux

  • 1,202 Points 1k badge 2x thumb

Posted 1 year ago

  • 1
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
Hi, DDeveaux,
I think a little more clarity on your use case may be helpful...

So you have a Ui-only picklist field (currently built with a JS snippet) that you're using to populate data on a new Contact record, and it sounds like the options for this field are being sourced from multiple Account fields? Are these multiple Account fields what "field1, field2, etc." correspond to?

What field type are the fields on the Account object? Picklist, reference, string, etc...?

Are you trying to bring all field options from the Account fields into a single picklist field for the user to select from (i.e. Bring values from field1, field2, etc. into a single picklist field), or multiple picklist fields (i.e. Show one field to the user for all values from field1, another field for all values from field2, etc.)?

Hope those questions make sense.
Thanks!
Emily
Photo of ddeveaux

ddeveaux

  • 1,202 Points 1k badge 2x thumb
But use case aside, I was just trying to find information on how to use the UI only "Reference" option. I am trying to understand how to use that and how it differs from using a formula on the model.
Photo of Emily Davis

Emily Davis, Employee

  • 3,502 Points 3k badge 2x thumb
DDeveaux,
I see what you're saying. Using the MODEL_LOOKUP function in a Ui-only Formula Field (the "Referential Data Access" section you're referring to) is really more to look up the field value of a row in a model, generally from a different model on the page. 

You're right, we don't have a lot of documentation on Ui-only Reference Fields right now. I'll bring that to the attention of our docs team as a future addition. For now, here is some information that might be helpful...

A Ui-only Reference Field is used as a way to look up a specific record. Because it behaves as model field, there are specific benefits to using it (being able to add Lookup Filters, being able to tie into Action Framework with it). Common use cases I can think of are:
  1. Using the field as a filter (e.g. when a particular Salesforce Account is selected, run actions to filter a model of Salesforce Contacts and requery the model). It provides a different visual way of presenting a filter, and certain granular control that you don't get with a standard Skuid filter.
  2. Using the field to prepopulate some data (e.g. when an Account record is selected, run actions to update a Contact record with values from that Account)
That being said, for your particular use case, it sounds like you really need a way to access Account metadata (picklist field options) rather than Account data (values from a particular Account record)? In this case, I would explore another option. The most straightforward option might be to create a "New Account" model (Account model where "Load Model data on page load" property = false and "Create default row if Model has none" = true). You can then include the Account picklist fields in this model, show them in the page, and run actions on this model that update the Contact record when an Account field is updated.

Does that help?
Emily