Is it possible to edit the page layout section of custom/standard objects using meta data API in Apex class? I have created new field using meta data api , now i have to add that field to page layout section, how can i do that? i have referenced this https://github.com/financialforcedev/apex-mdapi/blob/master/apex-mdapi/src/classes/MetadataServiceExamples.cls to create fields.
Looking at the version history of MetadataService.cls, it looks like some manual work is needed for each inner class (type of metadata). So it is possible that if you modify
MetadataService.Layout following the same pattern, you will be able to insert a layout.
And you could then go on to see if an update that is just the addition of a layout item is possible. At first sight that seems unlikely: AFAIK there is no way to read just the existing layout back (in the form of the inner classes) so that you could then add your field and update it back.
The best way forward would be to contact the author Andrew Fawcett and discuss this API implementation with him and whether newer API's such a the Tooling API are more promising.