2

So I know that tag is not supported in salesforce1 and thats really inconvenient. I currently have a master-detail relationship object that I create a visualforce page for so that users on desktop don't have to click to navigate to the master.

So my visualforce page currently has

<apex: details subject="{!child__c.master}" />

and it shows everything that's needed and I can just drag it onto a section in the layout. Is there a similar approach to this in salesforce1 or am I going to have to list everything specifically (which I'm avoiding because the master has 23+ fields)?

2

You have at least four choices here, probably more. I leave your choices up to you, but I'll put them all in one answer.

Field Set

You can make field sets, then use them to generate fields using an iterator. There's examples of this in the docs.

Pros

Easy to code. Can use different order and/or omit fields to be more mobile friendly.

Cons

Page layout won't drive the mobile layout. You'll have to modify the field set independently of the layout.

Use a Visualforce Generator

There's an app on the app exchange that gives you the ability to generate pages based on layouts.

Pros

Easy to use.

Cons

Changing the layout won't change the page. You'll be forced to regenerate the code each time a layout change occurs.

Apex Code Metadata

There's yet another app that clones your configurations into data on a custom object. I believe layouts are included, but I'm not 100% on this, as I've never used it personally.

Pros

No code changes necessary. The app can be scheduled.

Cons

There is a delay on changes, since it only runs on a schedule or is manually invoked.

Mobile Rendering

You can use the API to determine the fields from the layout, then render this data. You may choose to either enumerate all the fields, then have the script dynamically show the fields (more bandwidth), or perform a query based on the describe result (more round trips, API calls).

Pros

Less work server side, and can immediately detect changes.

Cons

Lots of JavaScript. May use more bandwidth and may take longer to render because of round trips.

Personally, I think using a server side solution may be preferable in this case, but the last option has the potential to be the fastest if done right.

2
  • hmm nice. Didn't think about that last one. That's a perfect option. I'm way more efficient in javascript then apex=]
    – Oakage
    Jun 6 '14 at 18:17
  • 1
    A well implemented design could be faster than native Visualforce anyways. Is say to with your strengths.
    – sfdcfox
    Jun 6 '14 at 18:40

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.