• Alberto Brioschi
  • NEWBIE
  • 0 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 2
    Replies
Hi,
I m getting the following error when checking challenge in module above.

"Challenge not yet complete in My Trailhead Playground 2
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: FIJICTJR"

I have already created a new DE but getting the same error. Also tried in Classic but no luck.
Any advice is appreciated.

Thank you,
A.
Hi everyone,
I hope you can help me. I need to generate a JSON but the format i get it's not like I require.

I get:
"portalReformasNecesariasEdificio" : false,
"portalReformasNecesarias" : false,
"porcentajePropiedad" : 100.00,
"plazoContratoDatosOcupacionales" : null,
"plantas" : [ {
    "attributes" : {
      "type" : "HAY_Informe_Mediadores_Planta__c",
      "url" : "/services/data/v44.0/sobjects/HAY_Informe_Mediadores_Planta__c/a1G3E0000014zl0UAA"
    },
    "Id" : "a1G3E0000014zl0UAA",
    "HAY_Informe_Mediadores__c" : "a1i3E000000PvmrQAC",
    "HAY_Floor_Number__c" : 0,
    "HAY_Room_Type__c" : "01",
    "HAY_Room_Number__c" : 3
  }, {
    "attributes" : {
      "type" : "HAY_Informe_Mediadores_Planta__c",
      "url" : "/services/data/v44.0/sobjects/HAY_Informe_Mediadores_Planta__c/a1G3E0000014zl1UAA"
    },
    "Id" : "a1G3E0000014zl1UAA",
    "HAY_Informe_Mediadores__c" : "a1i3E000000PvmrQAC",
    "HAY_Floor_Number__c" : 0,
    "HAY_Room_Type__c" : "02",
    "HAY_Room_Number__c" : 1
  }],
//more fields

I need:
//fields
"plantas": [
        {
          "roomtype": "01",
          "roomnumber": "3",
          "floornumber": "0"
        },
        {
          "roomtype": "02",
          "roomnumber": "1",
          "floornumber": "0"
        },
        //etc
//more fields
I dont know how to get the result I need. I'm using a wrapper with the fields of the parent object and a list to save the child records and the JSON.SerializePretty method
class wrapper{
   //fields of the parent object {get; set;}
   List<Child__c> childs {get; set;}

   public wrapper(Parent__c parent, List<Child__c> listChilds){
     //parent fields = parent.field
     childs = listChilds
   }
}

class AnotherClass {
  //Logic to get parent data
  //Logic to get list of childs
  public method{
      String jsonBody = JSON.prettySerialize(new wrapper(parent, child),false);
  }
}

I hope you can help I'm not able to solve this.
Thanks in advance.
 
Hi,
I m getting the following error when checking challenge in module above.

"Challenge not yet complete in My Trailhead Playground 2
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: FIJICTJR"

I have already created a new DE but getting the same error. Also tried in Classic but no luck.
Any advice is appreciated.

Thank you,
A.