Why Id instead of Name?

  • 1
  • Question
  • Updated 6 years ago
  • Answered
I have a table with Accounts and a Row Action to create new Opps. The Row action is an URL like this: apex/skuid__ui?page=PipelineOppNew&AccId={{Id}} and the receiving page has a condition like this:

this works so that the lookup point to the correct account. However on the new page created when Id is blank the AccId parameter is passed but the field displays the id and not the Acccount Name. As soon as the page is saved it is updated to Account Name but it would be much better if the Name was shown form the start and the id hidden from the user. How can I do this?
Photo of Peter Baeza

Peter Baeza

  • 2,868 Points 2k badge 2x thumb

Posted 6 years ago

  • 1
Photo of Peter Baeza

Peter Baeza

  • 2,868 Points 2k badge 2x thumb
the condition is AccountId = (param) AccId
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
There are a couple ways to do this, but the recommended way is to create an Account model on your PipelineOppNew page that retrieves the Name for the Account whose Id was requested. THen, in your PipelineOppNew's page's Opportunity Model, have a Model Merge condition that gets the AccountId - and, implicitly, the Account's Name -- from your Account model. Doing it this way, Skuid will automatically pull over the Account's Name from the Account Model, and your users will always see Names instead of Ids.

1. Create a new Model on the Account object, pulling in the Account's Name field, and with a URL parameter condition on the Account Id field
-Fields: Name, Id
-Conditions: AccountId = (param) accid

2. Modify your Opportunity Model, so that it has a Model Merge condition instead of a URL Parameter condition
-Conditions: AccountId = (Account)(Id)



Photo of Peter Baeza

Peter Baeza

  • 2,868 Points 2k badge 2x thumb
Thanks Zach, works excellent as long as the Account Model is before the OpportunityModel
Photo of Zach McElrath

Zach McElrath, Employee

  • 49,056 Points 20k badge 2x thumb
Yes the Ordering of the models is important here --- for models reference each other's data, there must be a fixed sequential load order, otherwise a model might not have loaded yet when a dependent model is processed.