Explore Courses Blog Tutorials Interview Questions
0 votes
in Salesforce by (11.9k points)

I am creating a Java API integration tool, that on start-up will create a new custom filed if it doesn't exist for Lead & Contact. After a bit of searching, I have found how to do this. Now the next bit on the list is to get the newly created field into the "Lead Information" or "Contact Information" layout.

I have looked in the metadata api docs and cannot find an example, either using Java or plain SOAP messages. I have searched online, in most of the forums, and sample codebases I can find, with no success.

So if anyone one is able to supply an example either through Java or SOAP, that would be fantastic.

1 Answer

0 votes
by (32.1k points)
edited by

You can't attach a field to a particular layout. You need to first get the current layout and then add the field to it and then update the layout. A layout is a complicated object made up of other objects symbolizing the sections and then the rows, etc. I suggest first reclaiming a layout via either the SOAP or Metadata API and once you've seen the result, it should be more distinct on how you can parse it and include your additional row and field.

Want to become a Salesforce Expert? join this Salesforce certification now!

Related questions

Browse Categories