Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Adding Related_List__c object, minor fixes #3

Open
wants to merge 6 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/classes/CRL_MetaGeneratorCtrl.cls
Original file line number Diff line number Diff line change
Expand Up @@ -104,7 +104,7 @@ public with sharing class CRL_MetaGeneratorCtrl {
' <apex:pageBlock title="' + this.crl.name + '">\n' +
' <apex:pageBlockTable var="row" value="{!FilteredList}">\n' +
' <apex:column headerValue="Link">\n' +
' <apex:outputLink value="/{!row.Id}">{!row.id}</apex:outputLink>\n' +
' <apex:outputLink value="/{!row.Id}" target="_parent">{!row.id}</apex:outputLink>\n' +
' </apex:column>\n' +
' <apex:repeat value="{!qt.columnTitles}" var="col">\n' +
' <apex:column headerValue="{!qt.columnLabels[col]}">\n' +
Expand Down
5 changes: 4 additions & 1 deletion src/classes/TestFactory.cls
Original file line number Diff line number Diff line change
Expand Up @@ -31,6 +31,7 @@ public class TestFactory {
public static SObject[] createSObjectList(Sobject sObj, Integer numberOfObjects, String defaultClassName) {
SObject[] sObjs = new SObject[] {};
SObject newObj;
Boolean nameIsAutoNumber;

// Get one copy of the object
if (defaultClassName == null) {
Expand All @@ -43,12 +44,14 @@ public class TestFactory {
String nameField = nameFieldMap.get(String.valueOf(sObj.getSObjectType()));
if (nameField == null) {
nameField = 'Name';
nameIsAutoNumber = sObj.getSobjectType().getDescribe().fields.getMap().get('name').getDescribe().isAutoNumber();
}

// Clone the object the number of times requested. Increment the name field so each record is unique
for (Integer i = 0; i < numberOfObjects; i++) {
SObject clonedSObj = newObj.clone(false, true);
clonedSObj.put(nameField, (String)clonedSObj.get(nameField) + ' ' + i);
if (!nameIsAutoNumber)
clonedSObj.put(nameField, (String)clonedSObj.get(nameField) + ' ' + i);
sObjs.add(clonedSObj);
}
return sObjs;
Expand Down
148 changes: 148 additions & 0 deletions src/objects/Related_List__c.object
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
<?xml version="1.0" encoding="UTF-8"?>
<CustomObject xmlns="http://soap.sforce.com/2006/04/metadata">
<actionOverrides>
<actionName>Accept</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>CancelEdit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Clone</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Delete</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Edit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Follow</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>List</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>New</actionName>
<content>CRL_NewCRL</content>
<skipRecordTypeSelect>false</skipRecordTypeSelect>
<type>Visualforce</type>
</actionOverrides>
<actionOverrides>
<actionName>SaveEdit</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>Tab</actionName>
<type>Default</type>
</actionOverrides>
<actionOverrides>
<actionName>View</actionName>
<type>Default</type>
</actionOverrides>
<compactLayoutAssignment>SYSTEM</compactLayoutAssignment>
<deploymentStatus>Deployed</deploymentStatus>
<enableActivities>true</enableActivities>
<enableFeeds>true</enableFeeds>
<enableHistory>false</enableHistory>
<enableReports>true</enableReports>
<fields>
<fullName>Controller_Name__c</fullName>
<description>Provides an auto-incrementing standardized controller name for the visualforce page that will be generated.</description>
<displayFormat>CRL_Controller{00000}</displayFormat>
<externalId>false</externalId>
<label>Controller Name</label>
<trackTrending>false</trackTrending>
<type>AutoNumber</type>
</fields>
<fields>
<fullName>Criteria__c</fullName>
<description>Field holds the SOQL query where clause components used as criteria for the related list.</description>
<externalId>false</externalId>
<label>Criteria</label>
<length>32768</length>
<trackFeedHistory>false</trackFeedHistory>
<trackTrending>false</trackTrending>
<type>LongTextArea</type>
<visibleLines>3</visibleLines>
</fields>
<fields>
<fullName>Displaying_Object__c</fullName>
<description>This is the string version of the sobject name for the detail, or child object to be displayed in the related list</description>
<externalId>false</externalId>
<label>Displaying Object</label>
<length>255</length>
<required>true</required>
<trackFeedHistory>false</trackFeedHistory>
<trackTrending>false</trackTrending>
<type>Text</type>
<unique>false</unique>
</fields>
<fields>
<fullName>Fields_to_Display__c</fullName>
<description>Comma delimited string of field api names to be displayed.</description>
<externalId>false</externalId>
<label>Fields to Display</label>
<required>true</required>
<trackFeedHistory>false</trackFeedHistory>
<trackTrending>false</trackTrending>
<type>TextArea</type>
</fields>
<fields>
<fullName>On_Object__c</fullName>
<description>This field holds the API name of the object whose detail page will show this Foreign Relations List</description>
<externalId>false</externalId>
<label>On Object</label>
<length>255</length>
<required>true</required>
<trackFeedHistory>false</trackFeedHistory>
<trackTrending>false</trackTrending>
<type>Text</type>
<unique>false</unique>
</fields>
<fields>
<fullName>Relation_Field__c</fullName>
<description>field holds the reference to the relationship field</description>
<externalId>false</externalId>
<label>Relation Field</label>
<length>255</length>
<required>true</required>
<trackFeedHistory>false</trackFeedHistory>
<trackTrending>false</trackTrending>
<type>Text</type>
<unique>false</unique>
</fields>
<fields>
<fullName>uuid__c</fullName>
<caseSensitive>false</caseSensitive>
<description>Hidden field used to promote portability between orgs.</description>
<externalId>true</externalId>
<label>uuid</label>
<length>50</length>
<required>true</required>
<trackFeedHistory>false</trackFeedHistory>
<trackTrending>false</trackTrending>
<type>Text</type>
<unique>true</unique>
</fields>
<label>Custom Related List</label>
<listViews>
<fullName>All</fullName>
<filterScope>Everything</filterScope>
<label>All</label>
</listViews>
<nameField>
<label>Related List Name</label>
<trackFeedHistory>true</trackFeedHistory>
<type>Text</type>
</nameField>
<pluralLabel>Custom Related Lists</pluralLabel>
<searchLayouts/>
<sharingModel>ReadWrite</sharingModel>
</CustomObject>
6 changes: 5 additions & 1 deletion src/package.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,9 +16,13 @@
<members>*</members>
<name>ApexTrigger</name>
</types>
<types>
<members>*</members>
<name>CustomObject</name>
</types>
<types>
<members>*</members>
<name>StaticResource</name>
</types>
<version>33.0</version>
</Package>
</Package>