• Dave Durant 1
  • NEWBIE
  • 5 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 2
    Likes Given
  • 2
    Questions
  • 4
    Replies
<!--campingListItem.cmp-->
<aura:component >
	<aura:attribute name="item" type="Camping_Item__c" required="true"/>

	<ui:outputText value="{!v.item.Name}" />
	<ui:outputCheckbox value="{!v.item.Packed__c}" />
	<ui:outputCurrency value="{!v.item.Price__c}" />
	<ui:outputNumber value="{!v.item.Quantity__c}" />
	<ui:button label="Packed!" press="{!c.packItem}"/>
	
</aura:component>
<!--campingListController.js-->
({
	packItem : function(component, event, helper) {
		var button = event.getSource().get("v.disabled");
		component.set("v.item.Packed__c", "true");
		component.set(button, "true");
	}
})
What am I doing wrong?

 
This code will not compile in the Dev. Console:
<!--docsample:nestedComponents-->
<aura:component>
    Observe!  Components within components!

    <docsample:helloHTML/>

    <docsample:helloAttributes whom="component composition"/>
</aura:component>


This code will compile:

<!--docsample:nestedComponents-->
<aura:component>
    Observe!  Components within components!

    <c:helloHTML/>

    <c:helloAttributes whom="component composition"/>
</aura:component>

The name space is wrong for the two nested components.  (Unless I am completely hallucinating!  And I might be - it's Friday!)

I am trying to create a partner portal user in a unit test., but having terrible difficulties. I understand that I must create a Contact and Account first, ensure the Account is a partner account, then create a user that points to the contact. However, I am unable to create a user that points to a contact.

 

 

Contact contact1 = new Contact(LastName = 'TestContact');
 Database.insert(contact1);
 Account account1 = new Account(Name = 'TestAccount');
 Database.insert(account1);
 account1.IsPartner = true;
 Database.update(account1);
 Profile profile1 = [Select Id from Profile where name = 'System Administrator'];
 UserRole userRole1 = new UserRole(
 	PortalType = 'Partner',
 	//PortalRole = 'Test',
 	//Name = 'Test Portal Role',
 	PortalAccountId = account1.Id
 );
 Database.insert(userRole1);
 User user1 = new User(
 	//IsPortalEnabled = true, // 4) Compiler says Field is not writeable.
 	//ContactId = contact1.Id, // 3) Runtime says Only Portal Users can be associated to a Contact.
 	UserType = 'PowerPartner', // 2) Compiler says field not writeable.
 	UserRoleId = userRole1.Id,
 	Username = System.now().millisecond() + 'test12345@test.com',
 	LastName = 'McTesty',
 	Email = 'test12345@test.com',
 	Alias = 'test123',
 	CommunityNickname = 'test12345',
 	TimeZoneSidKey = 'America/Los_Angeles',
 	LocaleSidKey = 'en_US',
	EmailEncodingKey = 'UTF-8',
	ProfileId = profile1.Id,
	LanguageLocaleKey = 'en_US'
);
Database.insert(user1);
//user1.IsPartner = true;
//user1.IsPortalEnabled = true;
//Database.update(user1);
//user1.ContactId = contact1.Id; // 1) Runtime says role type must match user type.
//Database.update(user1);

 

 

Can anyone paste some working code for this? Or maybe I'm making an obvious mistake?