• Brian Kessler
  • NEWBIE
  • 133 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 4
    Likes Received
  • 1
    Likes Given
  • 19
    Questions
  • 67
    Replies
Hey team. While doing Trailhead modules I definitely found that Lightning Components are a huge weak point in my ability to fully grasp. As such I'm struggling to even get started on the Superbadge.

Are there additional resources outside of Trailhead that are available to try and help get a better grasp on the concepts? Thanks.
Hi,

I'm currently working on the App Customization Specialist Lightning Superbadge.
I'm stuck on Challenge 4 with the reported error of:
 
Challenge Not yet complete... here's what's wrong: 
The 'My Top Volunteer Organizations' report is not sorting by the correct field.

However, I have summarized the shift hours and the report is sorted by Sum of Shift Hours, as seen below:

Report Builder:User-added image


Report:User-added image

Could this error description be incorrect and misleading?
If so, what else might be wrong on this report?
(Am I even correct to believe it is a problem with this report?)
Hi,

I'm currently working on the App Customization Specialist Lightning Superbadge.
I'm stuck on Challenge 4 with the reported error of:
 
Challenge Not yet complete... here's what's wrong: 
The 'My Top Volunteer Organizations' report is not using the correct IsShiftVolunteer filter.

However, my IsShiftVolunteer filter IS set to:
 
IsShiftVolunteer equals "True"
I've tried (nonsensically) to make this equals "False" or to lock the filter, but neither of these changes helped.

Could this error description be incorrect and misleading?
If so, what else might be wrong on this report?
(Am I even correct to believe it is a problem with this report?)

Here is a screenshot of the report builder:
My Top Volunteer Organizations Report Builder

Here is a screenshot of the report:
My Top Volunteer Organizations Report

Thanks in advance,
-Brian.
I'm currently trying to Create a Connected App and Link to Alexa.

When I click "Link Account", I get a new tab which displayes an "OAuth Error":
 
We can't authorize you because of an OAuth error. For more information, contact your Salesforce administrator.

OAUTH_APPROVAL_ERROR_GENERIC : An unexpected error has occured during authentication. Please try again.

The result page URL offers a little more information:
 
error=invalid_scope&error_description=the+requested+scope+is+not+allowed

These are the Selected OAuth Scopes for the Alexa Skill Connected App in SFDC:
Access and manage your data (api)
Provide access to your data via the Web (web)

Any ideas what is wrong or how to fix it?


 
I'm currently trying to finish the Advanced Apex Specialist, on challenge 8.

Yesterday when I tried to submit, I received the error:
Ensure that you haven't deleted the product2Trigger_UnitTest in orderTests.
... Which didn't make much sense since it Product2Trigger_UnitTest doesn't belong in OrderTests, but rather in Product2Tests.
Whatever, I copied it there, but it still failed with the same error.

I decided to call it a night.

Today, I figured I'd go back to hacking away at this, but now, the check takes forever to execute before finally invariably displaying:
Looks like something went wrong, please try again later.

Note, there haven't been actually any changes between yesterday's and today's non-passing code.
 
Hi.
I'm back to working on the Superbadge Advanced Apex Specialist Superbadge, Step 4.

Putting aside my disagreement with a singular TestDataFactory god-object in general and a big WTF at the "InsertTestData" (weren't these supposed to be for UNIT tests!?!), I've populated the specified methods, but am now getting the following error when I submit:
 
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []

Here is my TestDataFactory class:
 
/**
 * @name TestDataFactory
 * @description Contains methods to construct and/or validate commonly used records
**/
public class TestDataFactory {

	private static final Id STANDARD_PRICEBOOK_ID = (Test.isRunningTest())
			? Test.getStandardPricebookId()
			: [SELECT id FROM PriceBook2 WHERE isStandard = true LIMIT 1].id;

    /**
     * @name constructCollaborationGroup
     * @description
    **/
    public static CollaborationGroup ConstructCollaborationGroup(){ 
    	return new CollaborationGroup(
    		Name = 'TEST' + Constants.INVENTORY_ANNOUNCEMENTS,
    		CanHaveGuests = false,
    		CollaborationType = 'Public',
    		IsArchived = false,
    		IsAutoArchiveDisabled = false
    	);
    }

    /**
     * @name CreateProducts
     * @description constructs a List of Product2 records for unit tests
    **/
    public static List<Product2> constructProducts(Integer cnt){
    	List<Schema.PickListEntry> familyValueList = Product2.Family.getDescribe().getPickListValues();
    	Integer possibleFamilyValues = familyValueList.size();
    	
    	List<Product2> productList = new List<Product2>();
    	for (Integer i = 0; i < cnt; i++) {
    		productList.add(new Product2(
    			Name = 'Product ' + (i + 1),
    			Family = familyValueList[Math.mod(i, possibleFamilyValues)].getValue(),
    			Initial_Inventory__c = 10,
    			IsActive = true
    		));
    	}
    	return productList;
    }

    /**
     * @name CreatePricebookEntries
     * @description constructs a List of PricebookEntry records for unit tests
    **/
    public static List<PricebookEntry> constructPricebookEntries(List<Product2> productList){
    	List<PricebookEntry> pbes = new List<PricebookEntry>();
    	for (Product2 product: productList) { 
    		pbes.add(new PricebookEntry(
    			Pricebook2Id = STANDARD_PRICEBOOK_ID,
    			Product2Id = product.id,
    			IsActive = true,
    			UnitPrice = 1
    		));
    	} 
        return pbes;
    }

    /**
     * @name CreateAccounts
     * @description constructs a List of Account records for unit tests
    **/
    public static List<Account> constructAccounts(Integer cnt){
    	List<Account> accts = new List<Account>();
    	for (Integer i = 0; i < cnt; i++) {
    		accts.add(new Account(
    			Name = 'Account ' + (i + 1)
    		));
    	}
    	return accts;
    }

    /**
     * @name CreateContacts
     * @description constructs a List of Contacxt records for unit tests
    **/
    public static List<Contact> constructContacts(Integer cnt, List<Account> accts){
    	Integer possibleAccountValues = accts.size();
    	
    	List<Contact> contactList = new List<Contact>();
    	for (Integer i = 0; i < cnt; i++) {
    		contactList.add(new Contact(
    			LastName = 'Contact ' + (i + 1),
    			AccountId = accts[Math.mod(i, possibleAccountValues)].id
    		));
    	}
    	return contactList;
    }

    /**
     * @name CreateOrders
     * @description constructs a List of Order records for unit tests
    **/
    public static List<Order> constructOrders(Integer cnt, List<Account> accts){
    	Integer possibleAccountValues = accts.size();
    	
    	List<Order> ords = new List<Order>();
    	for (Integer i = 0; i < cnt; i++) {
    		ords.add(new Order(
    			Name = 'Order ' + (i + 1),
    			AccountId = accts[Math.mod(i, possibleAccountValues)].id,
    			EffectiveDate = Date.today(),
    			Pricebook2Id = STANDARD_PRICEBOOK_ID,
    			Status = 'Draft'
    		));
    	}
    	return ords;
    }

    /**
     * @name CreateOrderItems
     * @description constructs a List of OrderItem records for unit tests
    **/
    public static List<OrderItem> constructOrderItems(Integer cnt, List<Pricebookentry> pbes, List<Order> ords){
    	Integer possiblePricebookEntryValues = pbes.size();
    	Integer possibleOrderValues = ords.size();

    	List<OrderItem> orderItemList = new List<OrderItem>();
    	for (Integer i = 0; i < cnt; i++) {
    		orderItemList.add(new OrderItem(
    			OrderId = ords[Math.mod(i, possibleOrderValues)].id,
    			PriceBookEntryId = pbes[Math.mod(i, possiblePricebookEntryValues)].id,
    			Quantity = Constants.DEFAULT_ROWS,
    			UnitPrice = 1
    		));
    	}
    	
        return orderItemList;
    }

    /**
     * @name SetupTestData
     * @description Inserts accounts, contacts, Products, PricebookEntries, Orders, and OrderItems.
    **/
    public static void InsertTestData(Integer cnt){
    	insert constructCollaborationGroup();
    	
    	List<Product2> productList = constructProducts(cnt); 
    	insert productList;
    	
    	List<PricebookEntry> pbes = constructPricebookEntries(productList);
    	insert pbes;
    	
    	List<Account> accts = constructAccounts(cnt);
    	insert accts;
    	insert constructContacts(cnt, accts);
    	
    	List<Order> ords = constructOrders(cnt, accts);
    	insert constructOrderItems(cnt, pbes, ords);
    }
}

Any idea(s) what is wrong and how to fix this?
Thanks.



 
I have an elegant working save() method for step 3:
 
public PageReference save(){
    	SavePoint savePoint = this.databaseHelper.setSavePoint();
    	Map<PriceBookEntry, Product2> productByPriceBookEntryMap = this.buildProductByPriceBookEntryMap();
    	
    	String errorMessage = this.saveProductList(productByPriceBookEntryMap.values());
    	if (String.isBlank(errorMessage)) {
    		errorMessage = this.savePriceBookEntryList(productByPriceBookEntryMap);
    	}

    	if (!String.isBlank(errorMessage)) {
    		this.databaseHelper.rollback(savePoint);
    		visualForceHelper.addErrorMessage(Constants.ERROR_MESSAGE + errorMessage);
    	} else {
    		resetForm();
    	}
    	
        return null;
    }

But, of course this won't work because Trailhead tests implementation details rather than results.

(For the love for all that is holy or unholy or completely irrelevant to holiness, can somebody please teach the trailhead challenge developers  how to write good tests and stop checking my implementation details?)

So, now I am trying to turn this into something Trailhead will recognize instead of telling me:
 
Challenge Not yet complete... here's what's wrong: 
Ensure that the save method inserts only Products and Pricebooks for rows that have all fields populated.

Now, my save() method is looking like this:
 
public PageReference save(){
    	SavePoint savePoint = Database.setSavePoint();
    	Map<PriceBookEntry, Product2> productByPriceBookEntryMap = new Map<PriceBookEntry, Product2>();
    	for (ProductWrapper productWrapper : this.productsToInsert) {
    		if (
    			productWrapper.productRecord.Name != null && productWrapper.productRecord.Name != ''
				&& productWrapper.productRecord.Family != null && productWrapper.productRecord.Family != ''
				&& (productWrapper.productRecord.Family != Constants.SELECT_ONE)
				&& productWrapper.productRecord.Initial_Inventory__c != null && productWrapper.productRecord.Initial_Inventory__c > 0
				&& productWrapper.productRecord.IsActive
	
				&& productWrapper.priceBookEntryRecord.UnitPrice != null && productWrapper.priceBookEntryRecord.UnitPrice > 0
			) {
    			productByPriceBookEntryMap.put(productWrapper.pricebookEntryRecord, productWrapper.productRecord);
    		}
    	}
    	
    	String errorMessage;
    	try {
	    	errorMessage = this.saveProductList(productByPriceBookEntryMap.values());
	    	if (String.isBlank(errorMessage)) {
	    		errorMessage = this.savePriceBookEntryList(productByPriceBookEntryMap);
	    	}
	    	if (!String.isBlank(errorMessage)) {
	    		throw new Product2ExtensionException(errorMessage);
    		}
    		resetForm();
    	}
    	catch (Exception ex) {
    		Database.rollback(savePoint);
    		visualForceHelper.addErrorMessage(Constants.ERROR_MESSAGE + errorMessage);
    	}
        return null;
    }

This is advanced in all the ways of a five year old who doesn't know when to start new paragraphs or even divide sentences.
If I had a senior developer give me this code, I'd move to have him fired immediately.
But yet, I'm sure it will need to become much worse before I can pass this step.

It works, but doesn't pass.

Please tell me what cockimanie details are probably being badly described by this error.

 
Hi,

I'm currently struggling with Lightning Component Framework Specialist Challenge 10.

The map is behaving as expected, but when I submit, I get the error:
Challenge Not yet complete... here's what's wrong: 
MapController.js must have an event handler named onPlotMapMarker that uses the latitude and longitude that were passed through the event to update the boat’s location.

This is my onPlotMarker() method:
onPlotMapMarker: function(component, event, helper) {
    	var id = event.getParam('sObjectId');
    	var latitude = event.getParam('lat');
    	var longitude = event.getParam('long');
    	var label = event.getParam('label');

		var leafletMap = helper.getLeafletMap(component, latitude, longitude);
		L.tileLayer('https://server.arcgisonline.com/ArcGIS/rest/services/World_Street_Map/MapServer/tile/{z}/{y}/{x}', {
		    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
		}).addTo(leafletMap);
		
		L.marker([latitude, longitude]).addTo(leafletMap)
		    .bindPopup(label)
		    .openPopup();
    }
This is the helper:
({
	getLeafletMap : function(component, latitude, longitude) {
		var leafletMap = component.get('v.leafletMap');
		
		if (!leafletMap) {
	    	var mapContainer = component.find('map').getElement(); 
		    leafletMap = L.map(mapContainer, {zoomControl: false, tap: false})
		    	.setView([latitude, longitude], 13);
		    component.set('v.leafletMap', leafletMap);
		}

		return leafletMap;
	}
})
This is the aura:attribute for leafletMap:
<aura:attribute access="private" name="leafletMap" type="Object" />

Any help will be appreciated!






 
Hi,

I'm currently struggling with Lightning Component Framework Specialist Challenge 10.

I'm successfully using an event to pass values into the Map's client side controller, and Leaflet seems to be doing something, but:

1. The marker is displayed on a grey area, not a map.
2. When I click a second boat, instead of updating the map, an error pops up informing me "Uncaught Action failed: c:Map$controller$onPlotMapMarker [Map container is already initialized.]"

This is my onPlotMapMaker method:
 
onPlotMapMarker: function(component, event, helper) {
    	var id = event.getParam('sObjectId');
    	var lat = event.getParam('lat');
    	var long = event.getParam('long');
    	var label = event.getParam('label');

    	var mapContainer = component.find('map').getElement(); 
	    var map = L.map(mapContainer).setView([lat, long], 13);

		L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
		    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
		}).addTo(map);
		
		L.marker([lat, long]).addTo(map)
		    .bindPopup(label)
		    .openPopup();
    }

What's wrong with it?


 
Hi,

I'm currently working on the Lightning Component Framework Specialist Superbadge.

When I click "New", at least as I've interpretted the requirements, the "Friends with Boats" pages is behaving as expected, but Trailhead complains:
Challenge Not yet complete... here's what's wrong: 
The BoatSearchForm component's "New" button should launch the default boat record create page using logic in its controller.

Have I misunderstood a requirement?

Here is my markup:
 
<aura:component controller="BoatSearchFormAuraCtrl" >
	<aura:attribute access="private" name="boatList" type="BoatType__c[]" default="[]" />
	<aura:attribute access="private" name="showNewButton" type="Boolean" default="false" />
	<aura:attribute access="private" name="selectedBoat" type="BoatType__c" />
	
	<aura:handler name="init" value="{!this}" action="{!c.doInit}" />
	
	<h2 class="slds-page-header__title">Find a Boat</h2>
	<form>
		<lightning:layout horizontalAlign="center">
		    <lightning:select name="select" value="{!v.selectedBoat}">
		        <option value="">All Types</option>
		        <aura:iteration items="{!v.boatList}" var="boat">
		            <option value="{!boat.Name}" text="{!boat.Name}"></option>
		        </aura:iteration> 
		    </lightning:select>
		    <lightning:button name="Search" label="Search" variant="brand" />
		    <aura:if isTrue="{!v.showNewButton}">
		    	<lightning:button name="New" label="New" variant="neutral" onclick="{!c.createBoat}"/>
		    </aura:if>
		</lightning:layout>
	</form>	
</aura:component>
And here is my controller:
({
	doInit : function(component, event, helper) {
		component.set('v.showNewButton', $A.get('e.force:createRecord'));
		helper.setBoatTypeList(component);
	},
	
	createBoat : function(component) {
		var createRecordEvent = $A.get('e.force:createRecord');
		createRecordEvent.setParams({
			'entityApiName' : 'BoatType__c',
			'defaultFieldValues': {
				'Name': component.get('v.selectedBoat')
			},
		});
		createRecordEvent.fire();
	}
})





 
Presently, I'm trying to work my way through the "React Native" Trailhead.
I've updated my environment to use the latest Android Studio and it even can work with either a VS emulator or Nox.
I also updated the forcedroid npm plugin.

It is no problem to do a forcedroid create.

But when I execute "npm run-script start-windows", npm complains of a missing script.
   * I can, however, get the expected result if I execute "npm start" instead.

However, once I've logged into SFDC within an emulator (it doesn't matter which), the Android application complains "Could not get BatchedBridge, make sure your bundle is packaged correctly".  If I try to reload the page, I get more verbose, but not helpful suggestions.

Then I went to look at, or rather, for, the code, but there is no index.ios,js file, no index.andoid.js file, no app.js file.... in fact, no *.js files in the entire project directory....

Any ideas why I missing things and to fix my environment so I can work through this trailhead?
 
I'm currently on the last challenge for the Business Administration Specialist Superbadge.
I've uploaded both a photo for left of the header and a photo for the banner above the header.

Yet when I submit, I get this error:

Challenge Not yet complete... here's what's wrong: 
Couldn't find a photo assigned to the Chatter group.

What do I need to do to pass this challenge?

Thanks in advance,
-Brian.


 
This unit is being pushed as intermediate even though it is missing critical steps towards making use of the material it is presenting, such as step-by-step information how to successfully push the metadata we create and make use of the permissions we are uploading.

As far as I can tell, I am successfully uploading the Customer_interaction_Big_Object.permissionSet through ForceIDE, as I get no errors after save to server, but then this permission set isn't available for me to assign to anyone when I look in the SFDC setup UI for permission sets.

And then I can't upload the data because the object isn't writable, presumably because I don't have permissions.

Morever, the sample "Apex" script isn't even valid Apex.  For examples:
* There shouldn't be any angle brackets in: <Customer_Interaction__b> bo = new Customer_Interaction__b();
* Strings should use single quotes, not double quotes: bo.Account__c = "001R000000302D3";
* Play_Duration__c was defined as a number, not text (and again, double quotes!): bo.Play_Duration__c = "25";

Doesn't anyone give these articles a test drive before publishing them to people who will rely on them?
Hi,

I'm currently working on the Process Automation Specialist Superbadge and I'm struggling with Challenge #5.

Specifically, I'm currently getting the following error:
 
Challenge Not yet complete... here's what's wrong: 
An Opportunity with the Stage 'Negotiation/Review' and the Amount greater than $100,000 was not successfully submitted for approval upon creation.

I've created an approval process:
Screenshot of approval process

And I've included "Submit for Approval" as an action for the 3rd node of my process:
Opportunity Negotiation Node


Submit for Approval Settings

Any ideas what I'm doing wrong and how to fix it?

Thanks,
-Brian.
I'm currently working my way through the Build an IoT Integration with Electric Imp trailhead.
This requires an "Electric Imp Developer Kit".
I don't have one.

At this time, I'm not so serious about IoT that I would like to waste both my money and earth's limited physical resources for a device for which I have no long term use for, but will merely use for a few minutes to complete a trailhead.

Is there any possiblity to run a virtual device emulating the kit on my computer instead?
(Or, if not, could some environmentally responsible person create that possibility?)
I'm presently doing the Work with GeoJSON and Create the Map unit of Create a Custom Map for Wave Charts.
 
Because I'm an SFDC developer, and because my computer isn't presently set up for Python, I'd like to replace the "quick-and-dirty Python script" with an SFDC/Apex solution.

I've created this GeoJsonService class:
 
public class WAVE_GeoJsonService {
    DB_ContentDocumentSelector contentDocumentSelector;
    DB_ContentVersionSelector contentVersionSelector;
    
    public WAVE_GeoJsonService(DB_ContentDocumentSelector contentDocumentSelector, DB_ContentVersionSelector contentVersionSelector) {
    	this.contentDocumentSelector = contentDocumentSelector;
    	this.contentVersionSelector = contentVersionSelector;
    } 

    public WAVE_GeoJsonService() {
    	this(new DB_ContentDocumentSelector(), new DB_ContentVersionSelector());
    }

    public String zipCodeAreaReformat(String fileName) {
    	Id documentId = contentDocumentSelector.selectByTitle(fileName)[0].id;
    	Blob versionData = contentVersionSelector.selectByContentDocumentId(documentId)[0].VersionData;
    	return this.zipCodeAreaReformat(versionData);
    }
    
    @testVisible
    private String zipCodeAreaReformat(Blob jsonBlob) {
    	Map<String, Object> root = (Map<String, Object>) JSON.deserializeUntyped(jsonBlob.toString());
    	List<Object> featureFromJsonList = (List<Object>) root.get('features');
    	List<WAVE_GeoJsonFeatureModel> featureModelList = new List<WAVE_GeoJsonFeatureModel>();
    	for (Object featureFromJson : featureFromJsonList) {
    		WAVE_GeoJsonFeatureModel featureModel = new WAVE_GeoJsonFeatureModel(featureFromJson); 
    		featureModelList.add(featureModel);
    	}
    	root.put('features', featureModelList);
    	return JSON.serialize(root);
    }
    
    public ContentDocument createNewFile() {
    	// TODO:
    }
}

This can be executed like so:
String json =  (new WAVE_GeoJsonService()).zipCodeAreaReformat('la-zip-code-areas-2012');

As I've determined through System.debug statements (not included), this works as expected UNTIL SFDC needs to serialize root, at which time I get an error like:
 
DEBUG LOG
UNKNOWN_EXCEPTION: An unexpected error occurred. Please include this ErrorId if you contact support: 524981494-154011 (1095241484)

This also happens if I try to serialize root implicitly in a System.debug statement.

Any ideas what is going wrong and how to fix it?


If it helps, here are the dependencies:
 
public class WAVE_GeoJsonFeatureModel {
	public String type {get; private set;}
	public Object properties {get; private set;} 
	public Object geometry {get; private set;}
	public String id  {get; private set;}
	
	public WAVE_GeoJsonFeatureModel(Object featureFromStandardGeoJson) {
		Map<String, Object> attributes = (Map<String, Object>) featureFromStandardGeoJson;
		this.type = (String) attributes.get('type');
		this.properties = attributes.get('properties');
		this.geometry = attributes.get('geometry');
		this.id = (String)((Map<String, Object>) attributes.get('properties')).get('external_id');
	}
}

public class DB_ContentDocumentSelector {
    public List<ContentDocument> selectByTitle(String fileName) {
    	return [
			SELECT id 
			FROM ContentDocument
			WHERE title = :fileName
		];
    }
}

public class DB_ContentVersionSelector {
    public List<ContentVersion> selectByContentDocumentId(Id contentDocumentId) {
    	return [
			SELECT versionData
			FROM ContentVersion
			WHERE contentDocumentId = :contentDocumentId
			ORDER BY VersionNumber DESC
		];
    }
}

























 
Hi!

I'm currently trying to work my way through the Trailhead "Get Started with Hybrid Development", but am having problems when I attempt to "forcedroid create".

When it gets to "Installing "cordova-plugin-whitelist" for android" it fails with:
 
Failed to install 'cordova-plugin-whitelist':TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:466:7)
at D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\lib\check_reqs.js:177:42
at _fulfilled (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:796:13)
at D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:857:14
at runSingle (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:137:13)
at flush (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
Failed to restore plugin "cordova-plugin-whitelist" from config.xml. You might need to try adding it again. Error: TypeError: Path must be a string. Received undefined



This error is not imediately fatal, but after a time I see:
 
Installing "cordova-plugin-whitelist" for android
Failed to install 'cordova-plugin-whitelist':TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:466:7)
at D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\lib\check_reqs.js:177:42
at _fulfilled (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:796:13)
at D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:857:14
at runSingle (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:137:13)
at flush (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
Failed to install 'com.salesforce':TypeError: Path must be a string. Received undefined
at assertPath (path.js:7:11)
at Object.join (path.js:466:7)
at D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\lib\check_reqs.js:177:42
at _fulfilled (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:834:54)
at self.promiseDispatch.done (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:863:30)
at Promise.promise.promiseDispatch (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:796:13)
at D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:857:14
at runSingle (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:137:13)
at flush (D:\tutorials\AndroidStudioProjects\THA\platforms\android\cordova\node_modules\q\q.js:125:13)
at _combinedTickCallback (internal/process/next_tick.js:67:7)
D:\tutorials\AndroidStudioProjects
forcedroid create failed

Command failed: cordova plugin add https://github.com/forcedotcom/SalesforceMobileSDK-CordovaPlugin#v5.0.0 --force
Error: Path must be a string. Received undefined



Whereas, this last bit is fatal.

FWIW,
OS: Windows XP SP3
Java: 1.8.0_121
Node: 5.12.0
Npm: 4.2.0
Cordovoa: 6.5.0

ANDROID_HOME: C:\devtools\Android\sdk
ANDROID_SDK_HOME: C:\devtools\Android\sdk
JAVA_HOME: C:\devtools\Java\jdk1.8.0_121
JDK_HOME: %JAVA_HOME%
JRE_HOME: %JAVA_HOME%\jre
CLASSPATH: .;%JAVA_HOME%\lib;%JAVA_HOME%\jre\lib
User PATH: %JAVA_HOME%\bin;C:\Documents and Settings\Brian Kessler\Application Data\npm
System PATH: C:\Documents and Settings\All Users\Application Data\Oracle\Java\javapath;%SystemRoot%\system32;%SystemRoot%;%SystemRoot%\System32\Wbem;C:\Program Files\Pinnacle\Shared Files\InstantCDDVD\;C:\WINXPSP3\system32\WindowsPowerShell\v1.0;C:\Program Files\Skype\Phone\;C:\Program Files\Kensington\TrackballWorks;C:\devtools\Git\cmd;C:\devtools\Git\GitExtensions\;C:\devtools\nodejs\;%ANDROID_HOME%\platform-tools;%ANDROID_HOME%\tools

Any ideas what is wrong or how to fix this?
I'm currently workng my way through Explore Custom Transaction Security Policies : Test the Apex for the Policy.
Perhaps at the time this module was written, the example code was valid.

However, presently: 
1. If I try to set the value of LoginHistory.platform, the Apex code is rejected with 
Error: Compile Error: Field is not writeable: LoginHistory.Platform at line 6 column 5

2. If I try to insert a LoginHistory record, the Apex code is rejected with
Error: Compile Error: DML operation INSERT not allowed on LoginHistory at line 7 column 5

I don't want to litter my production code with Test.isRunningTest().

While I could refactor the code to replace both the SOQL and the evaluation with injected dependency(s), such would leave the most critical portions of the class actually untested, which is likewise unsatisfactory.

Is it still possible to test the PolicyCondition?
Is there some trick I'm overlooking?





 
Currently trying to complete Implement the Flow with Visualforce.

When I submit the VF/Flow form, the result is
 
Click to Open Sidebar 	Content Starts Here
 	
Limit Exceeded
You or your organization has exceeded the maximum limit for this feature.

I received an email reporting:
Error element Add_Values_to_Updated_Collection (FlowAssignment).
Number of iterations exceeded
This report lists the elements that the flow interview executed. The report is a beta feature.
We welcome your feedback on IdeaExchange.
Flow Details
Flow Name: Reassign_accounts
Type: Flow
Version: 1
Status: Active
Flow Interview Details
Interview Label: Reassign accounts 07/02/2017 02:37
Current User: Brian Kessler (0050Y000000e94c)
Start time: 07/02/2017 02:19
Duration: 1,045 seconds
How the Interview Started
Brian Kessler (0050Y000000e94c) started the flow interview.
SCREEN: Collect_Usernames
Display Text: EnterUsernames
Value at run time: So you need to reassign some accounts?

No problem! First, we need the username of the person who's moving on to a new role.

Textbox: User1_username
Label: User whose accounts need to be reassigned
Value at run time: bmk@trailhead2.dev

Display Text: other_usernames
Value at run time: Then we need the usernames of the people we want to give the accounts to.

Textbox: User2_username
Label: Assign hot accounts to
Value at run time: kessler.bm+rmore_test1@gmail.com

Textbox: User3_username
Label: Assign other accounts to
Value at run time: kessler.bm+mrigs_test_2@gmail.com

Selected Navigation Button: NEXT
FAST LOOKUP: Get_User_1_s_ID
Find all User records where:
Username Equals {!User1_username} (bmk@trailhead2.dev)
Assign those records to {!User1}.
Save these field values in the variable: Id, FirstName, LastName, Email
Result
Successfully found records.
FAST LOOKUP: Get_User_2_s_ID
Find all User records where:
Username Equals {!User2_username} (kessler.bm+rmore_test1@gmail.com)
Assign those records to {!User2}.
Save these field values in the variable: Id, FirstName, LastName, Email
Result
Successfully found records.
FAST LOOKUP: Get_User_3_s_ID
Find all User records where:
Username Equals {!User3_username} (kessler.bm+mrigs_test_2@gmail.com)
Assign those records to {!User3}.
Save these field values in the variable: Id, FirstName, LastName, Email
Result
Successfully found records.
FAST LOOKUP: Find_User_1_s_Accounts
Find all Account records where:
OwnerId Equals {!User1.Id} (0050Y000000e94cQAA)
Assign those records to {!User1_Accounts}.
Save these field values in the variable: Id, Rating, OwnerId
Result
Successfully found records.
LOOP: Reassign_User1s_Accounts
Loop Through: [0010Y00000E6PvYQAV,0010Y00000E6PvZQAV,0010Y00000E6PvaQAF,0010Y00000E6PvbQAF,0010Y00000E6PvcQAF,0010Y00000E6PvdQAF,0010Y00000E6PveQAF,0010Y00000E6PvfQAF,0010Y00000E6Pn9QAF,0010Y00000E6PvgQAF,0010Y00000E6PvhQAF,0010Y00000E6PviQAF,0010Y00000E6PvjQAF,0010Y00000E6PwuQAF,0010Y00000E6PwvQAF,0010Y00000E6PwwQAF,0010Y00000E6PwxQAF,0010Y00000E6PwyQAF,0010Y00000E6PwzQAF,0010Y00000E6Px0QAF,0010Y00000E6Px1QAF,0010Y00000E6Px2QAF,0010Y00000E6Px3QAF,0010Y00000E6Px4QAF,0010Y00000E6Px5QAF,0010Y00000E6Px6QAF,0010Y00000E6Px7QAF,0010Y00000E6Px8QAF,0010Y00000E6Px9QAF,0010Y00000E6PxAQAV,0010Y00000E6PxBQAV,0010Y00000E6PxCQAV,0010Y00000E6PxDQAV,0010Y00000E6PxEQAV,0010Y00000E6PxFQAV,0010Y00000E6PxGQAV,0010Y00000E6PxHQAV,0010Y00000E6PxIQAV,0010Y00000E6PxJQAV,0010Y00000E6PvwQAF,0010Y00000E6PvxQAF,0010Y00000E6PvyQAF,0010Y00000E6PvzQAF,0010Y00000E6Pw0QAF,0010Y00000E6Pw1QAF,0010Y00000E6Pw2QAF,0010Y00000E6Pw3QAF,0010Y00000E6Pw4QAF,0010Y00000E6Pw5QAF,0010Y00000E6Pw6QAF,0010Y00000E6Pw7QAF,0010Y00000E6Pw8QAF,0010Y00000E6Pw9QAF,0010Y00000E6PwAQAV,0010Y00000E6PwBQAV,0010Y00000E6PwCQAV,0010Y00000E6PwDQAV,0010Y00000E6PwEQAV,0010Y00000E6PwFQAV,0010Y00000E6PwGQAV,0010Y00000E6PxiQAF,0010Y00000E6PxjQAF,0010Y00000E6PxkQAF,0010Y00000E6PxlQAF,0010Y00000E6PxmQAF,0010Y00000E6PxnQAF,0010Y00000E6PxoQAF,0010Y00000E6PxpQAF,0010Y00000E6PxqQAF,0010Y00000E6PxrQAF,0010Y00000E6PwHQAV,0010Y00000E6PwIQAV,0010Y00000E6PwJQAV,0010Y00000E6PwKQAV,0010Y00000E6PwLQAV,0010Y00000E6PwMQAV,0010Y00000E6PwNQAV,0010Y00000E6PwOQAV,0010Y00000E6PwPQAV,0010Y00000E6PwQQAV,0010Y00000E6PwRQAV,0010Y00000E6PwSQAV,0010Y00000E6PwTQAV,0010Y00000E6PwUQAV,0010Y00000E6PwVQAV,0010Y00000E6PwWQAV,0010Y00000E6PwXQAV,0010Y00000E6PwYQAV,0010Y00000E6PwZQAV,0010Y00000E6PwaQAF,0010Y00000E6PwbQAF,0010Y00000E6PwcQAF,0010Y00000E6PwdQAF,0010Y00000E6PweQAF,0010Y00000E6PwfQAF,0010Y00000E6PwgQAF,0010Y00000E6PwhQAF,0010Y00000E6PwiQAF,0010Y00000E6PwjQAF,0010Y00000E6PwkQAF,0010Y00000E6PwlQAF,0010Y00000E6PwmQAF,0010Y00000E6PwnQAF,0010Y00000E6PwoQAF,0010Y00000E6PwpQAF,0010Y00000E6PwqQAF,0010Y00000E6PwrQAF,0010Y00000E6PwsQAF,0010Y00000E6PwtQAF,0010Y00000E6PxUQAV,0010Y00000E6PxVQAV,0010Y00000E6PxWQAV,0010Y00000E6PxXQAV,0010Y00000E6PxYQAV,0010Y00000E6PxZQAV,0010Y00000E6PxaQAF,0010Y00000E6PxKQAV,0010Y00000E6PxLQAV,0010Y00000E6PxMQAV,0010Y00000E6PxNQAV,0010Y00000E6PxOQAV,0010Y00000E6PxPQAV,0010Y00000E6PxQQAV,0010Y00000E6PxRQAV,0010Y00000E6PxSQAV,0010Y00000E6PxTQAV,0010Y00000E6PxbQAF,0010Y00000E6PxcQAF,0010Y00000E6PxdQAF,0010Y00000E6PxeQAF,0010Y00000E6PxfQAF,0010Y00000E6PxgQAF,0010Y00000E6PxhQAF,0010Y00000E6PnOQAV,0010Y00000E6Py4QAF,0010Y00000E6Py5QAF,0010Y00000E6Py6QAF,0010Y00000E7tODQAZ,0010Y00000E5W5iQAF,0010Y00000E6Pn4QAF,0010Y00000E6PvNQAV,0010Y00000E6PvOQAV,0010Y00000E6PvPQAV,0010Y00000E6PvQQAV,0010Y00000E6PvRQAV,0010Y00000E6PvSQAV,0010Y00000E6PvTQAV,0010Y00000E6PvUQAV,0010Y00000E6PvVQAV,0010Y00000E6PvWQAV,0010Y00000E6PvXQAV,0010Y00000E6Pv8QAF,0010Y00000E6Pv9QAF,0010Y00000E6PvAQAV,0010Y00000E6PvBQAV,0010Y00000E6PvCQAV,0010Y00000E6PvDQAV,0010Y00000E6PvEQAV,0010Y00000E6PvFQAV,0010Y00000E6PvGQAV,0010Y00000E6PvHQAV,0010Y00000E6PvIQAV,0010Y00000E6PvJQAV,0010Y00000E6PvKQAV,0010Y00000E6PvLQAV,0010Y00000E6PvMQAV,0010Y00000E6PujQAF,0010Y00000E7ywLQAR,0010Y00000E5fPeQAJ,0010Y00000E6PxsQAF,0010Y00000E6PxtQAF,0010Y00000E6PxuQAF,0010Y00000E6PxvQAF,0010Y00000E6PxwQAF,0010Y00000E6PxxQAF,0010Y00000E6PxyQAF,0010Y00000E6PxzQAF,0010Y00000E6Py0QAF,0010Y00000E6Py1QAF,0010Y00000E6Py2QAF,0010Y00000E6Py3QAF,0010Y00000E6PvkQAF,0010Y00000E6PvlQAF,0010Y00000E6PvmQAF,0010Y00000E6PvnQAF,0010Y00000E6PvoQAF,0010Y00000E6PvpQAF,0010Y00000E6PvqQAF,0010Y00000E6PvrQAF,0010Y00000E6PvsQAF,0010Y00000E6PvtQAF,0010Y00000E6PvuQAF,0010Y00000E6PvvQAF,0010Y00000E6Q3WQAV,0010Y00000E6PuoQAF,0010Y00000E5flVQAR,0010Y00000E6Q0jQAF,0010Y00000E6Q0kQAF,0010Y00000E6Q0lQAF,0010Y00000E6Q0mQAF,0010Y00000E6Q0nQAF,0010Y00000E6Q0oQAF,0010Y00000E6Q0pQAF,0010Y00000E6Q0qQAF,0010Y00000E6Q0rQAF,0010Y00000E6Q0sQAF,0010Y00000E6Q0tQAF,0010Y00000E6Q0uQAF,0010Y00000E6Q0vQAF,0010Y00000E6Q0wQAF,0010Y00000E6Q0xQAF,0010Y00000E6Q0yQAF,0010Y00000E6Q0zQAF,0010Y00000E6Q10QAF,0010Y00000E6Q11QAF,0010Y00000E6Q12QAF,0010Y00000E6Q13QAF,0010Y00000E6Q14QAF,0010Y00000E6Q15QAF,0010Y00000E6Q16QAF,0010Y00000E6Q17QAF,0010Y00000E6Q18QAF,0010Y00000E6Q19QAF,0010Y00000E6Q1AQAV,0010Y00000E6Q1BQAV,0010Y00000E6Q1CQAV,0010Y00000E6Q1DQAV,0010Y00000E6Q1EQAV,0010Y00000E6Q1FQAV,0010Y00000E6Q1GQAV,0010Y00000E6Q1HQAV,0010Y00000E6Q1IQAV,0010Y00000E6Q1JQAV,0010Y00000E6Q1KQAV,0010Y00000E6Q1LQAV,0010Y00000E6Q1MQAV,0010Y00000E6Q1NQAV,0010Y00000E6Q1OQAV,0010Y00000E6Q1PQAV,0010Y00000E6Q1QQAV,0010Y00000E6Q1RQAV,0010Y00000E6Q1SQAV,0010Y00000E6Q1TQAV,0010Y00000E6Q1UQAV,0010Y00000E6Q1VQAV,0010Y00000E6Q1WQAV,0010Y00000E6Q1XQAV,0010Y00000E6Q1YQAV,0010Y00000E6Q1ZQAV,0010Y00000E6Q1aQAF,0010Y00000E6Q1bQAF,0010Y00000E6Q1cQAF,0010Y00000E6Q1dQAF,0010Y00000E6Q1eQAF,0010Y00000E6Q1fQAF,0010Y00000E6Q1gQAF,0010Y00000E6Q1hQAF,0010Y00000E6Q1iQAF,0010Y00000E6Py7QAF,0010Y00000E6Py8QAF,0010Y00000E6Py9QAF,0010Y00000E6PyAQAV,0010Y00000E6PyBQAV,0010Y00000E6PyCQAV,0010Y00000E6Q1jQAF,0010Y00000E6Q1kQAF,0010Y00000E6Q1lQAF,0010Y00000E6Q1mQAF,0010Y00000E6Q1nQAF,0010Y00000E6Q1oQAF,0010Y00000E6Q1pQAF,0010Y00000E6Q1qQAF,0010Y00000E6Q1rQAF,0010Y00000E6Q1sQAF,0010Y00000E6Q1tQAF,0010Y00000E6Q1uQAF,0010Y00000E6Q1vQAF,0010Y00000E6Q1wQAF,0010Y00000E6Q1xQAF,0010Y00000E6Q1yQAF,0010Y00000E6Q1zQAF,0010Y00000E6Q20QAF,0010Y00000E6Q21QAF,0010Y00000E6Q22QAF,0010Y00000E6Q23QAF,0010Y00000E6Q24QAF,0010Y00000E6Q25QAF,0010Y00000E6Q26QAF,0010Y00000E6Q27QAF,0010Y00000E6Q28QAF,0010Y00000E6PyDQAV,0010Y00000E6PyEQAV,0010Y00000E6PyFQAV,0010Y00000E6PyGQAV,0010Y00000E6PyHQAV,0010Y00000E6PyIQAV,0010Y00000E6PyJQAV,0010Y00000E6PyKQAV,0010Y00000E6PyLQAV,0010Y00000E6PyMQAV,0010Y00000E6PyNQAV,0010Y00000E6PyOQAV,0010Y00000E6PyPQAV,0010Y00000E6PyQQAV,0010Y00000E6PyRQAV,0010Y00000E6PySQAV,0010Y00000E6PyTQAV,0010Y00000E6PyUQAV,0010Y00000E6PyVQAV,0010Y00000E6PyWQAV,0010Y00000E6PyXQAV,0010Y00000E6PyYQAV,0010Y00000E6PyZQAV,0010Y00000E6PyaQAF,0010Y00000E6PybQAF,0010Y00000E6PycQAF,0010Y00000E6Q29QAF,0010Y00000E6Q2AQAV,0010Y00000E6Q2BQAV,0010Y00000E6Q2CQAV,0010Y00000E6Q2DQAV,0010Y00000E6Q2EQAV,0010Y00000E6Q2FQAV,0010Y00000E6Q2GQAV,0010Y00000E6Q2HQAV,0010Y00000E6Q2IQAV,0010Y00000E6Q2JQAV,0010Y00000E6Q2KQAV,0010Y00000E6Q2LQAV,0010Y00000E6Q2MQAV,0010Y00000E6Q2NQAV,0010Y00000E6Q2OQAV,0010Y00000E6Q2PQAV,0010Y00000E6Q2QQAV,0010Y00000E6Q2RQAV,0010Y00000E6Q2SQAV,0010Y00000E6Q2TQAV,0010Y00000E6Q2UQAV,0010Y00000E6Q2VQAV,0010Y00000E6Q2WQAV,0010Y00000E6Q2XQAV,0010Y00000E6Q2YQAV,0010Y00000E6PydQAF,0010Y00000E6PyeQAF,0010Y00000E6PyfQAF,0010Y00000E6PygQAF,0010Y00000E6PyhQAF,0010Y00000E6PyiQAF,0010Y00000E6PyjQAF,0010Y00000E6PykQAF,0010Y00000E6PylQAF,0010Y00000E6PymQAF,0010Y00000E6PynQAF,0010Y00000E6PyoQAF,0010Y00000E6PypQAF,0010Y00000E6PyqQAF,0010Y00000E6PyrQAF,0010Y00000E6PysQAF,0010Y00000E6PytQAF,0010Y00000E6PyuQAF,0010Y00000E6PyvQAF,0010Y00000E6PywQAF,0010Y00000E6PyxQAF,0010Y00000E6PyyQAF,0010Y00000E6PyzQAF,0010Y00000E6Pz0QAF,0010Y00000E6Pz1QAF,0010Y00000E6Pz2QAF,0010Y00000E6Q2ZQAV,0010Y00000E6Q2aQAF,0010Y00000E6Q2bQAF,0010Y00000E6Q2cQAF,0010Y00000E6Q2dQAF,0010Y00000E6Q2eQAF,0010Y00000E6Q2fQAF,0010Y00000E6Q2gQAF,0010Y00000E6Q2hQAF,0010Y00000E6Q2iQAF,0010Y00000E6Q2jQAF,0010Y00000E6Q2kQAF,0010Y00000E6Q2lQAF,0010Y00000E6Q2mQAF,0010Y00000E6Q2nQAF,0010Y00000E6Q2oQAF,0010Y00000E6Q2pQAF,0010Y00000E6Q2qQAF,0010Y00000E6Q2rQAF,0010Y00000E6Q2sQAF,0010Y00000E6Q2tQAF,0010Y00000E6Q2uQAF,0010Y00000E6Q2vQAF,0010Y00000E6Q2wQAF,0010Y00000E6Q2xQAF,0010Y00000E6Q2yQAF,0010Y00000E6Pz3QAF,0010Y00000E6Pz4QAF,0010Y00000E6Pz5QAF,0010Y00000E6Pz6QAF,0010Y00000E6Pz7QAF,0010Y00000E6Pz8QAF,0010Y00000E6Pz9QAF,0010Y00000E6PzAQAV,0010Y00000E6PzBQAV,0010Y00000E6PzCQAV,0010Y00000E6PzDQAV,0010Y00000E6PzEQAV,0010Y00000E6PzFQAV,0010Y00000E6PzGQAV,0010Y00000E6PzHQAV,0010Y00000E6PzIQAV,0010Y00000E6PzJQAV,0010Y00000E6PzKQAV,0010Y00000E6PzLQAV,0010Y00000E6PzMQAV,0010Y00000E6PzNQAV,0010Y00000E6PzOQAV,0010Y00000E6PzPQAV,0010Y00000E6PzQQAV,0010Y00000E6PzRQAV,0010Y00000E6PzSQAV,0010Y00000E6Q2zQAF,0010Y00000E6Q30QAF,0010Y00000E6Q31QAF,0010Y00000E6Q32QAF,0010Y00000E6Q33QAF,0010Y00000E6Q34QAF,0010Y00000E6Q35QAF,0010Y00000E6Q36QAF,0010Y00000E6Q37QAF,0010Y00000E6Q38QAF,0010Y00000E6Q39QAF,0010Y00000E6Q3AQAV,0010Y00000E6Q3BQAV,0010Y00000E6PzTQAV,0010Y00000E6PzUQAV,0010Y00000E6PzVQAV,0010Y00000E6PzWQAV,0010Y00000E6PzXQAV,0010Y00000E6PzYQAV,0010Y00000E6PzZQAV,0010Y00000E6PzaQAF,0010Y00000E6PzbQAF,0010Y00000E6PzcQAF,0010Y00000E6PzdQAF,0010Y00000E6PzeQAF,0010Y00000E6PzfQAF,0010Y00000E6PzgQAF,0010Y00000E6PzhQAF,0010Y00000E6PziQAF,0010Y00000E6PzjQAF,0010Y00000E6PzkQAF,0010Y00000E6PzlQAF,0010Y00000E6PzmQAF,0010Y00000E6PznQAF,0010Y00000E6PzoQAF,0010Y00000E6PzpQAF,0010Y00000E6PzqQAF,0010Y00000E6PzrQAF,0010Y00000E6PzsQAF,0010Y00000E6PztQAF,0010Y00000E6PzuQAF,0010Y00000E6PzvQAF,0010Y00000E6PzwQAF,0010Y00000E6PzxQAF,0010Y00000E6PzyQAF,0010Y00000E6PzzQAF,0010Y00000E6Q00QAF,0010Y00000E6Q01QAF,0010Y00000E6Q02QAF,0010Y00000E6Q03QAF,0010Y00000E6Q04QAF,0010Y00000E6Q05QAF,0010Y00000E6Q06QAF,0010Y00000E6Q07QAF,0010Y00000E6Q08QAF,0010Y00000E6Q09QAF,0010Y00000E6Q0AQAV,0010Y00000E6Q0BQAV,0010Y00000E6Q0CQAV,0010Y00000E6Q0DQAV,0010Y00000E6Q0EQAV,0010Y00000E6Q0FQAV,0010Y00000E6Q0GQAV,0010Y00000E6Q0HQAV,0010Y00000E6Q0IQAV,0010Y00000E6Q0JQAV,0010Y00000E6Q0KQAV,0010Y00000E6Q0LQAV,0010Y00000E6Q0MQAV,0010Y00000E6Q0NQAV,0010Y00000E6Q0OQAV,0010Y00000E6Q0PQAV,0010Y00000E6Q0QQAV,0010Y00000E6Q0RQAV,0010Y00000E6Q0SQAV,0010Y00000E6Q0TQAV,0010Y00000E6Q0UQAV,0010Y00000E6Q0VQAV,0010Y00000E6Q0WQAV,0010Y00000E6Q0XQAV,0010Y00000E6Q0YQAV,0010Y00000E6Q0ZQAV,0010Y00000E6Q0aQAF,0010Y00000E6Q0bQAF,0010Y00000E6Q0cQAF,0010Y00000E6Q0dQAF,0010Y00000E6Q0eQAF,0010Y00000E6Q0fQAF,0010Y00000E6Q0gQAF,0010Y00000E6Q0hQAF,0010Y00000E6Q0iQAF,0010Y00000E7unYQAR,0010Y00000E7tO8QAJ,0010Y00000E7ukFQAR,0010Y00000E7ukZQAR,0010Y00000E7ukeQAB,0010Y00000E7undQAB,0010Y00000E7uniQAB,0010Y00000E7ukKQAR,0010Y00000E7ukLQAR,0010Y00000E7ukUQAR,0010Y00000E7uk5QAB,0010Y00000E6Pv3QAF,0010Y00000E6Pv4QAF,0010Y00000E6Pv5QAF,0010Y00000E6Pv6QAF,0010Y00000DUYuGQAX,0010Y00000DUYuEQAX,0010Y00000DUYuFQAX,0010Y00000DUYu6QAH,0010Y00000DUYu7QAH,0010Y00000DUYu8QAH,0010Y00000DUYu9QAH,0010Y00000DUYuAQAX,0010Y00000DUYuCQAX,0010Y00000DUYuDQAX,0010Y00000DUYuBQAX,0010Y00000DUYuHQAX,0010Y00000E6PuyQAF,0010Y00000E6PuzQAF,0010Y00000E6Pv0QAF,0010Y00000E6Pv1QAF]
Iteration: 0
Current value of {!accountLoopVar}: 0010Y00000E6PvYQAV
DECISION: What_s_the_Account_Rating
ASSIGNMENT: Assign_to_User_3
{!accountLoopVar.OwnerId} Equals {!User3.Id}
Result
{!accountLoopVar.OwnerId} = "0050Y000000eSOOQA2"
ASSIGNMENT: Add_Values_to_Updated_Collection
{!coll_updatedAccts} Add {!accountLoopVar}
Result
{!coll_updatedAccts} = "[0010Y00000E6PvYQAV]"
LOOP: Reassign_User1s_Accounts
Loop Through: [0010Y00000E6PvYQAV,0010Y00000E6PvZQAV,0010Y00000E6PvaQAF,0010Y00000E6PvbQAF,0010Y00000E6PvcQAF,0010Y00000E6PvdQAF,0010Y00000E6PveQAF,0010Y00000E6PvfQAF,0010Y00000E6Pn9QAF,0010Y00000E6PvgQAF,0010Y00000E6PvhQAF,0010Y00000E6PviQAF,

< -- snip  --- >

0010Y00000E6Pv0QAF,0010Y00000E6Pv1QAF]
Iteration: 498
Current value of {!accountLoopVar}: 0010Y00000E6Q0WQAV
DECISION: What_s_the_Account_Rating
ASSIGNMENT: Assign_to_User_3
{!accountLoopVar.OwnerId} Equals {!User3.Id}
Result
{!accountLoopVar.OwnerId} = "0050Y000000eSOOQA2"
Salesforce Error ID: 439573818-71445 (-2642379)

However, I've tried inspecting the Flow elements several time, but everything seems in order.

It may be relevant that when I try submitting to trailhead (just to see how it complains, in cse there are useful hints), I see
 
Challenge Not yet complete... here's what's wrong: 
Couldn't find two users in your org with a 'Salesforce' license. Check the instructions.

So maybe one of my users doesn't have the right license so the records can't be reassigned?

I've made Renee a Salesforce/Standard User
I've made Madison a Salesforce Platform/Standard Platform User (as Standard User does not appear as an option).


Any ideas how I can diagnose and fix this?









 
Hi!

I'm currently working my way through Automate Pre-Workshop Tasks with Flow.

Evidently, either the Flow or Process Builder allowed me to enter some corrupt data into the GUI.
(Wouldn't it be nice to look at code in an IDE that would tell me this as I did it? ... but that's not exactly what I want to ask.)

When I try to test the Process/Flow combination manually, saving fails with the following output:
 
Workflow Action Failed to Trigger Flow
The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 3010Y000000H8Et. Flow error messages: &lt;b&gt;An unhandled fault has occurred in this flow&lt;/b&gt;&lt;br&gt;An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help. 

Click here to return to the previous page.

Alternatively, even knowing the step couldn't (or at least shouldn't) possibly pass verification, submission to trailhead results in:
 
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_EXECUTE_FLOW_TRIGGER, The record couldn’t be saved because it failed to trigger a flow. A flow trigger failed to execute the flow with version ID 3010Y000000H8Et. Flow error messages: An unhandled fault has occurred in this flow
An unhandled fault has occurred while processing the flow. Please contact your system administrator for more information. Contact your administrator for help.: []

Googling such errors yields no results (or at least nothing fruitful).

Can you please help me determine what I did wrong?
Also, if there are any tips for diagnosing and resolving such issues, I'd be glad to know them before such errors happen when I'm doing this for employers/clients.
(Though I'd much rather be doing this with Apex triggers and well-coded trigger handlers!  ... and wouldn't it be nice if all these processes, flows, etc. transpiled to Apex...)


 
I'm currently trying to finish the Advanced Apex Specialist, on challenge 8.

Yesterday when I tried to submit, I received the error:
Ensure that you haven't deleted the product2Trigger_UnitTest in orderTests.
... Which didn't make much sense since it Product2Trigger_UnitTest doesn't belong in OrderTests, but rather in Product2Tests.
Whatever, I copied it there, but it still failed with the same error.

I decided to call it a night.

Today, I figured I'd go back to hacking away at this, but now, the check takes forever to execute before finally invariably displaying:
Looks like something went wrong, please try again later.

Note, there haven't been actually any changes between yesterday's and today's non-passing code.
 
Hi,

I'm currently struggling with Lightning Component Framework Specialist Challenge 10.

I'm successfully using an event to pass values into the Map's client side controller, and Leaflet seems to be doing something, but:

1. The marker is displayed on a grey area, not a map.
2. When I click a second boat, instead of updating the map, an error pops up informing me "Uncaught Action failed: c:Map$controller$onPlotMapMarker [Map container is already initialized.]"

This is my onPlotMapMaker method:
 
onPlotMapMarker: function(component, event, helper) {
    	var id = event.getParam('sObjectId');
    	var lat = event.getParam('lat');
    	var long = event.getParam('long');
    	var label = event.getParam('label');

    	var mapContainer = component.find('map').getElement(); 
	    var map = L.map(mapContainer).setView([lat, long], 13);

		L.tileLayer('http://{s}.tile.osm.org/{z}/{x}/{y}.png', {
		    attribution: '&copy; <a href="http://osm.org/copyright">OpenStreetMap</a> contributors'
		}).addTo(map);
		
		L.marker([lat, long]).addTo(map)
		    .bindPopup(label)
		    .openPopup();
    }

What's wrong with it?


 
This unit is being pushed as intermediate even though it is missing critical steps towards making use of the material it is presenting, such as step-by-step information how to successfully push the metadata we create and make use of the permissions we are uploading.

As far as I can tell, I am successfully uploading the Customer_interaction_Big_Object.permissionSet through ForceIDE, as I get no errors after save to server, but then this permission set isn't available for me to assign to anyone when I look in the SFDC setup UI for permission sets.

And then I can't upload the data because the object isn't writable, presumably because I don't have permissions.

Morever, the sample "Apex" script isn't even valid Apex.  For examples:
* There shouldn't be any angle brackets in: <Customer_Interaction__b> bo = new Customer_Interaction__b();
* Strings should use single quotes, not double quotes: bo.Account__c = "001R000000302D3";
* Play_Duration__c was defined as a number, not text (and again, double quotes!): bo.Play_Duration__c = "25";

Doesn't anyone give these articles a test drive before publishing them to people who will rely on them?
Hi,

I got following error on step 3.

Challenge Not yet complete... here's what's wrong: 
Couldn’t find Agency records from the Account object.

Can anyone pass this step?
Thanks in advance.

Regards,
LinThaw
Hi,

I'm currently working on the App Customization Specialist Lightning Superbadge.
I'm stuck on Challenge 4 with the reported error of:
 
Challenge Not yet complete... here's what's wrong: 
The 'My Top Volunteer Organizations' report is not sorting by the correct field.

However, I have summarized the shift hours and the report is sorted by Sum of Shift Hours, as seen below:

Report Builder:User-added image


Report:User-added image

Could this error description be incorrect and misleading?
If so, what else might be wrong on this report?
(Am I even correct to believe it is a problem with this report?)
Hi,

I'm currently working on the App Customization Specialist Lightning Superbadge.
I'm stuck on Challenge 4 with the reported error of:
 
Challenge Not yet complete... here's what's wrong: 
The 'My Top Volunteer Organizations' report is not using the correct IsShiftVolunteer filter.

However, my IsShiftVolunteer filter IS set to:
 
IsShiftVolunteer equals "True"
I've tried (nonsensically) to make this equals "False" or to lock the filter, but neither of these changes helped.

Could this error description be incorrect and misleading?
If so, what else might be wrong on this report?
(Am I even correct to believe it is a problem with this report?)

Here is a screenshot of the report builder:
My Top Volunteer Organizations Report Builder

Here is a screenshot of the report:
My Top Volunteer Organizations Report

Thanks in advance,
-Brian.
Hello everyone,

I'm encoutering the following issue :
User-added image

I'm using the following filter :
User-added image
I'm not sure what filter to use. Could anyone guide towards the answer please?

Thanks in advance,

David
I'm currently trying to Create a Connected App and Link to Alexa.

When I click "Link Account", I get a new tab which displayes an "OAuth Error":
 
We can't authorize you because of an OAuth error. For more information, contact your Salesforce administrator.

OAUTH_APPROVAL_ERROR_GENERIC : An unexpected error has occured during authentication. Please try again.

The result page URL offers a little more information:
 
error=invalid_scope&error_description=the+requested+scope+is+not+allowed

These are the Selected OAuth Scopes for the Alexa Skill Connected App in SFDC:
Access and manage your data (api)
Provide access to your data via the Web (web)

Any ideas what is wrong or how to fix it?


 
Trailhead Check Challenge Button is not responding back with results.
  • January 31, 2018
  • Like
  • 15
I'm currently trying to finish the Advanced Apex Specialist, on challenge 8.

Yesterday when I tried to submit, I received the error:
Ensure that you haven't deleted the product2Trigger_UnitTest in orderTests.
... Which didn't make much sense since it Product2Trigger_UnitTest doesn't belong in OrderTests, but rather in Product2Tests.
Whatever, I copied it there, but it still failed with the same error.

I decided to call it a night.

Today, I figured I'd go back to hacking away at this, but now, the check takes forever to execute before finally invariably displaying:
Looks like something went wrong, please try again later.

Note, there haven't been actually any changes between yesterday's and today's non-passing code.
 
Hi.
I'm back to working on the Superbadge Advanced Apex Specialist Superbadge, Step 4.

Putting aside my disagreement with a singular TestDataFactory god-object in general and a big WTF at the "InsertTestData" (weren't these supposed to be for UNIT tests!?!), I've populated the specified methods, but am now getting the following error when I submit:
 
Challenge Not yet complete... here's what's wrong: 
There was an unexpected error in your org which is preventing this assessment check from completing: System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []

Here is my TestDataFactory class:
 
/**
 * @name TestDataFactory
 * @description Contains methods to construct and/or validate commonly used records
**/
public class TestDataFactory {

	private static final Id STANDARD_PRICEBOOK_ID = (Test.isRunningTest())
			? Test.getStandardPricebookId()
			: [SELECT id FROM PriceBook2 WHERE isStandard = true LIMIT 1].id;

    /**
     * @name constructCollaborationGroup
     * @description
    **/
    public static CollaborationGroup ConstructCollaborationGroup(){ 
    	return new CollaborationGroup(
    		Name = 'TEST' + Constants.INVENTORY_ANNOUNCEMENTS,
    		CanHaveGuests = false,
    		CollaborationType = 'Public',
    		IsArchived = false,
    		IsAutoArchiveDisabled = false
    	);
    }

    /**
     * @name CreateProducts
     * @description constructs a List of Product2 records for unit tests
    **/
    public static List<Product2> constructProducts(Integer cnt){
    	List<Schema.PickListEntry> familyValueList = Product2.Family.getDescribe().getPickListValues();
    	Integer possibleFamilyValues = familyValueList.size();
    	
    	List<Product2> productList = new List<Product2>();
    	for (Integer i = 0; i < cnt; i++) {
    		productList.add(new Product2(
    			Name = 'Product ' + (i + 1),
    			Family = familyValueList[Math.mod(i, possibleFamilyValues)].getValue(),
    			Initial_Inventory__c = 10,
    			IsActive = true
    		));
    	}
    	return productList;
    }

    /**
     * @name CreatePricebookEntries
     * @description constructs a List of PricebookEntry records for unit tests
    **/
    public static List<PricebookEntry> constructPricebookEntries(List<Product2> productList){
    	List<PricebookEntry> pbes = new List<PricebookEntry>();
    	for (Product2 product: productList) { 
    		pbes.add(new PricebookEntry(
    			Pricebook2Id = STANDARD_PRICEBOOK_ID,
    			Product2Id = product.id,
    			IsActive = true,
    			UnitPrice = 1
    		));
    	} 
        return pbes;
    }

    /**
     * @name CreateAccounts
     * @description constructs a List of Account records for unit tests
    **/
    public static List<Account> constructAccounts(Integer cnt){
    	List<Account> accts = new List<Account>();
    	for (Integer i = 0; i < cnt; i++) {
    		accts.add(new Account(
    			Name = 'Account ' + (i + 1)
    		));
    	}
    	return accts;
    }

    /**
     * @name CreateContacts
     * @description constructs a List of Contacxt records for unit tests
    **/
    public static List<Contact> constructContacts(Integer cnt, List<Account> accts){
    	Integer possibleAccountValues = accts.size();
    	
    	List<Contact> contactList = new List<Contact>();
    	for (Integer i = 0; i < cnt; i++) {
    		contactList.add(new Contact(
    			LastName = 'Contact ' + (i + 1),
    			AccountId = accts[Math.mod(i, possibleAccountValues)].id
    		));
    	}
    	return contactList;
    }

    /**
     * @name CreateOrders
     * @description constructs a List of Order records for unit tests
    **/
    public static List<Order> constructOrders(Integer cnt, List<Account> accts){
    	Integer possibleAccountValues = accts.size();
    	
    	List<Order> ords = new List<Order>();
    	for (Integer i = 0; i < cnt; i++) {
    		ords.add(new Order(
    			Name = 'Order ' + (i + 1),
    			AccountId = accts[Math.mod(i, possibleAccountValues)].id,
    			EffectiveDate = Date.today(),
    			Pricebook2Id = STANDARD_PRICEBOOK_ID,
    			Status = 'Draft'
    		));
    	}
    	return ords;
    }

    /**
     * @name CreateOrderItems
     * @description constructs a List of OrderItem records for unit tests
    **/
    public static List<OrderItem> constructOrderItems(Integer cnt, List<Pricebookentry> pbes, List<Order> ords){
    	Integer possiblePricebookEntryValues = pbes.size();
    	Integer possibleOrderValues = ords.size();

    	List<OrderItem> orderItemList = new List<OrderItem>();
    	for (Integer i = 0; i < cnt; i++) {
    		orderItemList.add(new OrderItem(
    			OrderId = ords[Math.mod(i, possibleOrderValues)].id,
    			PriceBookEntryId = pbes[Math.mod(i, possiblePricebookEntryValues)].id,
    			Quantity = Constants.DEFAULT_ROWS,
    			UnitPrice = 1
    		));
    	}
    	
        return orderItemList;
    }

    /**
     * @name SetupTestData
     * @description Inserts accounts, contacts, Products, PricebookEntries, Orders, and OrderItems.
    **/
    public static void InsertTestData(Integer cnt){
    	insert constructCollaborationGroup();
    	
    	List<Product2> productList = constructProducts(cnt); 
    	insert productList;
    	
    	List<PricebookEntry> pbes = constructPricebookEntries(productList);
    	insert pbes;
    	
    	List<Account> accts = constructAccounts(cnt);
    	insert accts;
    	insert constructContacts(cnt, accts);
    	
    	List<Order> ords = constructOrders(cnt, accts);
    	insert constructOrderItems(cnt, pbes, ords);
    }
}

Any idea(s) what is wrong and how to fix this?
Thanks.



 
I got stuck in that error, can someone help me
Error step 7
 
OrderTests Class

@isTest
public class OrderTests {
    
    
    
    public  static Map<String, List<Object>> testData;  
    
    @testSetup 
    static void SetupTestData (){
        
        testData = TestDataFactory.InsertTestData(5);
        
    }
    
      @isTest static void OrderExtension_UnitTest() {
	
	 Order rec = [select id, Status from Order limit 1];
        PageReference pageRef = Page.OrderEdit;
        
        //Test.setCurrentPage(pageRef);
        pageRef.getParameters().put('id',rec.id);
        Test.setCurrentPage(pageRef);
        SetupTestData();
         ApexPages.StandardController sc = new ApexPages.standardController(rec);
        OrderExtension ext = new OrderExtension(sc);        
       	System.assertEquals(Constants.DEFAULT_ROWS, ext.orderItemList.size());
        ext.OnFieldChange();
        ext.SelectFamily();
        ext.Save();
        ext.First();
        ext.Next();
        ext.Previous();
        ext.Last();
        ext.GetHasPrevious();
        ext.GetHasNext();
        ext.GetTotalPages();
        ext.GetPageNumber();
        List<SelectOption> options = ext.GetFamilyOptions();
    }
    
    @isTest
    static void OrderUpdate_UnitTest (){
        Test.startTest();
        Order rec = [select id, Status from Order limit 1];
        Product2 prod = [SELECT Family,Id,Name,Quantity_Ordered__c,Quantity_Remaining__c FROM Product2 limit 1];
        system.debug('kkk '+prod.Quantity_Ordered__c);
        rec.status = constants.ACTIVATED_ORDER_STATUS;
        Update rec;
        Product2 updatedprod = [SELECT Family,Id,Name,Quantity_Ordered__c,Quantity_Remaining__c FROM Product2 limit 1];
        
        system.debug('kkk '+updatedprod.Quantity_Ordered__c);
        TestDataFactory.VerifyQuantityOrdered(prod,updatedprod,constants.DEFAULT_ROWS);
        Test.stopTest();
    }
    
    
   
    
    
   
}
 
Order Extension Class

/**
 * @name OrderExtension
 * @description This class is provided for you to facilitate the Super Badge
**/
public class OrderExtension {

    public Order orderRecord {get;set;}
    public List<OrderItem> orderItemList {get;set;}
    public String selectedFamily {get;set;}
    public List<chartHelper.chartData> pieData {get;set;}
    public Decimal total {get;set;}
  
    public Map<Id,OrderItem> orderItemMap;
    ApexPages.StandardSetController standardSetController;

    public OrderExtension(ApexPages.StandardController standardController){
        orderRecord = (Order)standardController.getRecord();
        orderItemMap = new Map<id,OrderItem>();
        if ( orderRecord.Id != null ){
            orderRecord = queryOrderRecord(orderRecord.Id);
        }
        orderItemList = new List<OrderItem>();
        OrderItemList.addAll(orderRecord.OrderItems);
        set<Id> p2ids = new set<Id>();
        for(OrderItem oitem : OrderItemList){
            p2ids.add(oitem.PriceBookEntryId);
        }
        List<PriceBookEntry> p2List = new List<PriceBookEntry>();
        if(p2Ids.size()>0){
            p2List = [select id from PriceBookEntry where id IN: p2Ids];
        }
        standardSetController= new ApexPages.StandardSetController(p2List);
        standardSetController.setPageSize(Constants.DEFAULT_ROWS);
     
    }
    

    public void resetstandardSetController() {
        String query = 'SELECT Name, Product2.Family, Product2.Name, Product2Id, UnitPrice, Product2.Quantity_Remaining__c'
                     + '  FROM PricebookEntry WHERE IsActive = TRUE';

        if (selectedFamily != null && selectedFamily != Constants.SELECT_ONE) {
            query += ' AND Product2.Family = \'' + selectedFamily + '\'';
        }
        query += ' ORDER BY Name';

        standardSetController= new ApexPages.StandardSetController(Database.getQueryLocator(query));
        standardSetController.setPageSize(Constants.DEFAULT_ROWS);
    }

    //ToDo: Implement your own method to populate orderItemList
    //  that you will call after pagination and/or family selection
   public void GetOrderItems() {
        orderItemList = new List<OrderItem>();
        for (SObject obj : standardSetController.getRecords()) {
            PricebookEntry pbe = (PricebookEntry)obj;

            if (orderItemMap.containsKey(pbe.Product2Id)) {
                orderItemList.add(orderItemMap.get(pbe.Product2Id));
            } else {
                orderItemList.add(new OrderItem(
                    PricebookEntryId=pbe.Id,
                    Product2Id=pbe.Product2Id,
                    UnitPrice=pbe.UnitPrice,
                    Quantity=0,
                    Product2=pbe.Product2
                ));
            }
        }
    }


    /**
     * @name OnFieldChange
     * @description
    **/
    public void onFieldChange(){
        //ToDo: Implement logic to store the values changed on the page
        for (OrderItem oi : orderItemList) {
            orderItemMap.put(oi.Product2Id, oi);
        }

        //      and populate pieData
        pieData = null;
        total = 0;
        for (OrderItem oi : orderItemMap.values()) {
            if (oi.Quantity > 0) {
                if (null == pieData) {
                    pieData = new List<chartHelper.ChartData>();
                }
                pieData.add(new chartHelper.ChartData(oi.Product2.Name, oi.Quantity * oi.UnitPrice));
                //      and populate total
                total += oi.UnitPrice * oi.Quantity;
            }

        }

    }

    /**
     * @name SelectFamily
     * @description
    **/
    public void selectFamily(){
        //ToDo: Implement logic to filter based on the selected product family
        resetstandardSetController();
        GetOrderItems();
    }

    /**
     * @name Save
     * @description
    **/
    public void save(){
        //ToDo: Implement logic to save the Order and populated OrderItems
        System.Savepoint sp = Database.setSavepoint();
        try {
            if (null == orderRecord.Pricebook2Id) {
                orderRecord.Pricebook2Id = Constants.STANDARD_PRICEBOOK_ID;
            }
            upsert orderRecord;

            List<OrderItem> orderItemsToUpsert = new List<OrderItem>();
            List<OrderItem> orderItemsToDelete = new List<OrderItem>();
            system.debug('@@@@@@@@@@@@@@@#######'+orderItemMap.values());
            for (OrderItem oi : orderItemMap.values()) {
                if (oi.Quantity > 0) {
                    if (null == oi.OrderId) {
                        oi.OrderId = orderRecord.Id;
                    }
                    orderItemsToUpsert.add(oi);
                } else if (oi.Id != null) {
                    orderItemsToDelete.add(oi);
                }
            }
            if(orderItemsToUpsert.size()>0)
            upsert orderItemsToUpsert;
            if(orderItemsToDelete.size()>0)
            delete orderItemsToDelete;
        } catch (Exception e) {
            Database.rollback(sp);
            apexPages.addMessage(new ApexPages.message(ApexPages.Severity.INFO,Constants.ERROR_MESSAGE));
        }
    }


    /**
     * @name First
     * @description
    **/
    public void First(){      
       standardSetController.first();
       GetOrderItems();
    }

    /**
     * @name Next
     * @description
    **/
    public void Next(){   
       standardSetController.next();
        GetOrderItems();
    }

    /**
     * @name Previous
     * @description
    **/
    public void Previous(){      
        standardSetController.previous();
        GetOrderItems();
    }

    /**
     * @name Last
     * @description
    **/
    public void Last(){
        standardSetController.last();
        GetOrderItems();
    }
  /**
     * @name GetHasPrevious
     * @description
    **/
   public Boolean GetHasPrevious(){
        return standardSetController.gethasprevious();
    }

    /**
     * @name GetHasNext
     * @description
    **/
   public Boolean GetHasNext(){
        return standardSetController.gethasnext();
    }

    /**
     * @name GetTotalPages
     * @description
    **/
   public Integer GetTotalPages(){
       System.debug('=====' + (Integer)Math.ceil(standardSetController.GetResultSize() / (Decimal)Constants.DEFAULT_ROWS));
        return (Integer)Math.ceil(standardSetController.GetResultSize() / (Decimal)Constants.DEFAULT_ROWS);
    }

    /**
    * @name GetPageNumber
     * @description
    **/
    public Integer GetPageNumber(){
        return standardSetController.getpagenumber();
    }

    /**
     * @name GetFamilyOptions
     * @description
    **/
    public List<SelectOption> GetFamilyOptions() {
        List<SelectOption> options = new List<SelectOption>{
            new SelectOption(Constants.SELECT_ONE, Constants.SELECT_ONE)
        };

        for (Schema.PicklistEntry ple : Constants.PRODUCT_FAMILY) {
            options.add(new SelectOption(ple.getValue(), ple.getLabel()));
        }
        return options;
    }
    

    /**
     * @name QueryOrderRecord
     * @description
    **/
    public static Order QueryOrderRecord(Id orderId){
     return [
        SELECT Id, AccountId, EffectiveDate, Name, Status, Pricebook2Id,
                (
                    SELECT Id, OrderId, Quantity, UnitPrice, PricebookEntryId, Product2Id,
                         Product2.Name, Product2.Family, Product2.Quantity_Remaining__c
                    FROM OrderItems where PricebookEntry.isActive = true
                )
            FROM Order WHERE Id = :orderId
            ];
    }

}

 
Hi All,

While working on the Advanced Apex Specialist Superbadge Step 7 I am facing a weird issue.
User-added image

The OrderExtension class is alreeady containing a variable of StandardSetController and in the OrderEdit page orderItemList is getting iterated.
But Salesforce doesn't support standardsetcontroller for OrderItem.

Hence getting the error: List controllers are not supported for OrderItem

Could anyone please help me, how to solve this issue.

Thanks,
I have an elegant working save() method for step 3:
 
public PageReference save(){
    	SavePoint savePoint = this.databaseHelper.setSavePoint();
    	Map<PriceBookEntry, Product2> productByPriceBookEntryMap = this.buildProductByPriceBookEntryMap();
    	
    	String errorMessage = this.saveProductList(productByPriceBookEntryMap.values());
    	if (String.isBlank(errorMessage)) {
    		errorMessage = this.savePriceBookEntryList(productByPriceBookEntryMap);
    	}

    	if (!String.isBlank(errorMessage)) {
    		this.databaseHelper.rollback(savePoint);
    		visualForceHelper.addErrorMessage(Constants.ERROR_MESSAGE + errorMessage);
    	} else {
    		resetForm();
    	}
    	
        return null;
    }

But, of course this won't work because Trailhead tests implementation details rather than results.

(For the love for all that is holy or unholy or completely irrelevant to holiness, can somebody please teach the trailhead challenge developers  how to write good tests and stop checking my implementation details?)

So, now I am trying to turn this into something Trailhead will recognize instead of telling me:
 
Challenge Not yet complete... here's what's wrong: 
Ensure that the save method inserts only Products and Pricebooks for rows that have all fields populated.

Now, my save() method is looking like this:
 
public PageReference save(){
    	SavePoint savePoint = Database.setSavePoint();
    	Map<PriceBookEntry, Product2> productByPriceBookEntryMap = new Map<PriceBookEntry, Product2>();
    	for (ProductWrapper productWrapper : this.productsToInsert) {
    		if (
    			productWrapper.productRecord.Name != null && productWrapper.productRecord.Name != ''
				&& productWrapper.productRecord.Family != null && productWrapper.productRecord.Family != ''
				&& (productWrapper.productRecord.Family != Constants.SELECT_ONE)
				&& productWrapper.productRecord.Initial_Inventory__c != null && productWrapper.productRecord.Initial_Inventory__c > 0
				&& productWrapper.productRecord.IsActive
	
				&& productWrapper.priceBookEntryRecord.UnitPrice != null && productWrapper.priceBookEntryRecord.UnitPrice > 0
			) {
    			productByPriceBookEntryMap.put(productWrapper.pricebookEntryRecord, productWrapper.productRecord);
    		}
    	}
    	
    	String errorMessage;
    	try {
	    	errorMessage = this.saveProductList(productByPriceBookEntryMap.values());
	    	if (String.isBlank(errorMessage)) {
	    		errorMessage = this.savePriceBookEntryList(productByPriceBookEntryMap);
	    	}
	    	if (!String.isBlank(errorMessage)) {
	    		throw new Product2ExtensionException(errorMessage);
    		}
    		resetForm();
    	}
    	catch (Exception ex) {
    		Database.rollback(savePoint);
    		visualForceHelper.addErrorMessage(Constants.ERROR_MESSAGE + errorMessage);
    	}
        return null;
    }

This is advanced in all the ways of a five year old who doesn't know when to start new paragraphs or even divide sentences.
If I had a senior developer give me this code, I'd move to have him fired immediately.
But yet, I'm sure it will need to become much worse before I can pass this step.

It works, but doesn't pass.

Please tell me what cockimanie details are probably being badly described by this error.

 
Trailhead Check Challenge Button is not responding back with results.
  • January 31, 2018
  • Like
  • 15