1

I have a problem with creation new APEX classes by using #Tooling API. In first scenario, I want to create one class: Steps:

  1. Create MetadataContainer
  2. By using MetadataContainer Id, create ApexClassMember (with Metadata, FullName, Body and MetadataContainerId)
  3. Create ContainerAsyncRequest, related to MetadataContainer Everything is works fine for create and update a class.

Second scenario, I want to create some classes:

  1. Create MetadataContainer
    1. By using MetadataContainer Id, create ApexClassMember (with Metadata, FullName, Body and MetadataContainerId)
    2. By using MetadataContainer Id, create additional ApexClassMember (with same set of fields)
  2. Create ContainerAsyncRequest, related to MetadataContainer

If the classes are exists, everything is fine, all classes are updated. BUT, if there some class(es) is(are) new, first class will be created but rest will fail with very strange error: "duplicate value found: <unknown> duplicates value on record with id: <unknown>".

Any help is appreciated

Your Answer

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

Browse other questions tagged or ask your own question.