• Hartley
  • NEWBIE
  • 20 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 11
    Replies
Hey,

I can't seem to figure this out but I have a list of records that sort of looks like this
 
{
        "key_1": "25877",
        "key_2": "321565",
        "key_3": "0033600000NP8IAAA1",
        "key_4": "a0436000008XuS2AAK",
        "key_6": "London",
        "key_7": "a053600000AiAe5AAF",
        "key_8": -{
            "title": "Public Speaking",
            "code": "WI2016",
            "section": "LON1",
            "Id": "a0436000008XuS2AAK"
        }
},
{
        "key_1": "25877",
        "key_2": "321565",
        "key_3": "0033600000NP8IAAA1",
        "key_4": "a0436000008XuS2AAK",
        "key_6": "London",
        "key_7": "a053600000AiAe5AAF",
        "key_8": -{
            "title": "Public Speaking",
            "code": "WI2016",
            "section": "LON2",
            "Id": "a0436000008XuS2AAK"
        }
},

Essentially I want to restructure the List  into a new list grouped by code and section. All records with section LON1 are nested under the Key LON1 with all data form that record something like:
 
{
  "Lon1": {
    "key_1": "25877",
    "key_2": "321565",
    "key_3": "0033600000NP8IAAA1",
    "key_4": "a0436000008XuS2AAK",
    "key_6": "London",
    "key_7": "a053600000AiAe5AAF",
    "key_8": -{
        "title": "Public Speaking",
        "code": "WI2016",
        "section": "LON1",
        "Id": "a0436000008XuS2AA2"
    },
    {
      "key_1": "25877",
      "key_2": "321565",
      "key_3": "0033600000NP8IAAA1",
      "key_4": "a0436000008XuS2AAK",
      "key_6": "London",
      "key_7": "a053600000AiAe5AAF",
      "key_8": -{
          "title": "Data",
          "code": "WI2016",
          "section": "LON1",
          "Id": "a0436000008XuS2AA2"
      }
    }
  },
  "Lon2": {
    "key_1": "25877",
    "key_2": "321565",
    "key_3": "0033600000NP8IAAA1",
    "key_4": "a0436000008XuS2AAK",
    "key_6": "London",
    "key_7": "a053600000AiAe5AAF",
    "key_8": -{
        "title": "Data 2",
        "code": "WI2016",
        "section": "LON2",
        "Id": "a0436000008XuS2AA2"
    },
    {
      "key_1": "25877",
      "key_2": "321565",
      "key_3": "0033600000NP8IAAA1",
      "key_4": "a0436000008XuS2AAK",
      "key_6": "London",
      "key_7": "a053600000AiAe5AAF",
      "key_8": -{
          "title": "Data 2",
          "code": "WI2016",
          "section": "LON2",
          "Id": "a0436000008XuS2AA2"
      }
    }
  },
},

 
  • September 02, 2016
  • Like
  • 0
Hey,

Having an issue with attempting to use jsPDF as a library within my lightning component. I have uploaded the zip as a Static Resource, and am have properly included the file in my application.

The issue is when my page loads I get the followign error:

Uncaught ReferenceError: AcroForm is not defined throws at /resource/JSPDF101/jsPDF-1.2.60/dist/jspdf.min.js:238:8028

I've tried the minified and debug version of the file, both of which are giving me the same error message. 

I've been unable to find out why this is happening. Now I had imagined that all of this would be properly handled by the jsPDF file, but seems there are some reference problems. I even attempted to load the acroform.js file as a Static Resource separately but to no avail. 

Any help is greatly appreciated, thank you.
  • September 01, 2016
  • Like
  • 0
Hey,

I have a Custom object (custom_object__c) with a Lookup field for (Contact) from which I would like to get a field or custom field from a standard object (ie. Contact). If I understood correctly I then need to do a Child - Parent relationship which is in the form of dot notation.

So here is my code:

public static List<custom_object__c> getStudents(){
        LIST<custom_object__c> students = [SELECT 
                Id, 
                Name,
                Contact__r.custom_field__c,
                 custom_object__c__custom_field_1,
                custom_object__c__custom_field_1
                FROM custom_object__c
                LIMIT 100
                OFFSET 0];
        
        return students;
    }

And here is the error message:

Didn't understand relationship 'Contact__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Any explanation is greatly appreciated, thank you.
 
Hello,

Thanks for taking the time to help me or look into my issue.

I seem to be getting an error when attempting a simple SELECT query in my lightning App. I know the issue is with the Custom Object as if I change the table and List to a different object I can get the data.

The following is the code:

public class StudentRosterListController {
    @AuraEnabled
    public static List<custom_object__c> getStudents(){
        return [SELECT Id, Name FROM custom_object__c];
    }
}


And here is the error message:

"message": "An internal server error has occurred\nError ID: 1148389056-13703 (408822391)"

Again if I replace the custom_object__c with different objects it works for somes and doesn't for others. Any help is greatly appreciated, thank you.

 
Hey,

Having an issue with attempting to use jsPDF as a library within my lightning component. I have uploaded the zip as a Static Resource, and am have properly included the file in my application.

The issue is when my page loads I get the followign error:

Uncaught ReferenceError: AcroForm is not defined throws at /resource/JSPDF101/jsPDF-1.2.60/dist/jspdf.min.js:238:8028

I've tried the minified and debug version of the file, both of which are giving me the same error message. 

I've been unable to find out why this is happening. Now I had imagined that all of this would be properly handled by the jsPDF file, but seems there are some reference problems. I even attempted to load the acroform.js file as a Static Resource separately but to no avail. 

Any help is greatly appreciated, thank you.
  • September 01, 2016
  • Like
  • 0
Hey,

I have a Custom object (custom_object__c) with a Lookup field for (Contact) from which I would like to get a field or custom field from a standard object (ie. Contact). If I understood correctly I then need to do a Child - Parent relationship which is in the form of dot notation.

So here is my code:

public static List<custom_object__c> getStudents(){
        LIST<custom_object__c> students = [SELECT 
                Id, 
                Name,
                Contact__r.custom_field__c,
                 custom_object__c__custom_field_1,
                custom_object__c__custom_field_1
                FROM custom_object__c
                LIMIT 100
                OFFSET 0];
        
        return students;
    }

And here is the error message:

Didn't understand relationship 'Contact__r' in field path. If you are attempting to use a custom relationship, be sure to append the '__r' after the custom relationship name. Please reference your WSDL or the describe call for the appropriate names.

Any explanation is greatly appreciated, thank you.
 
Hello,

Thanks for taking the time to help me or look into my issue.

I seem to be getting an error when attempting a simple SELECT query in my lightning App. I know the issue is with the Custom Object as if I change the table and List to a different object I can get the data.

The following is the code:

public class StudentRosterListController {
    @AuraEnabled
    public static List<custom_object__c> getStudents(){
        return [SELECT Id, Name FROM custom_object__c];
    }
}


And here is the error message:

"message": "An internal server error has occurred\nError ID: 1148389056-13703 (408822391)"

Again if I replace the custom_object__c with different objects it works for somes and doesn't for others. Any help is greatly appreciated, thank you.