• vignesh sethuramalingam 17
  • 0 Points
  • Member since 2016

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
  • 3
I am working on a lightning component where I want to show picklist field using as follows. `
<aura:component > 
    <aura:attribute name="conObj" type="Contact" default="sobjectType:'Contact'}"/> 
​    <force:inputField value="{!v.conObj.Salutation}" aura:id="pic"/> 
The above code works fine in my developer org but not working on sandbox. When I try to run this by adding in an app throws some exception. Although same component works in same sandbox if I replace inputField with outputField.

Is there any solution for this ?
I have received the Attachement.Body from REST API call as mentioned in https://developer.salesforce.com/docs/atlas.en-us.api_rest.meta/api_rest/resources_sobject_blob_retrieve.htm from client side. 
When I get the blob returned and try to create a js file object,as below: 
    var body = [blobData];
    this.file = new File(body , fileName , {type: contentType , lastModifiedDate: new Date(), name: fileName} );
Now btoa(blobData) throws error Uncaught DOMException: Failed to execute 'btoa' on 'Window': The string to be encoded contains characters outside of the Latin1 range  for image/pdf. It works fine for text.
Please help to figure this out. 

I've been trying to write a test class and have finally narrowed down a major problem to the fact that several lines of code in my trigger are not being tested because I have a NULL Object .  This is where my trigger code stops:

accountpartner[] myAccountPartner = [Select AccountToId FROM AccountPartner WHERE AccountFromId = :myContact[0].AccountId];


So I've tried to place information into those fields in my test class:

AccountPartner AP2 = new AccountPartner(
		 AccountToId = endAccount.Id,
		 AccountFromId = portalAccount1.Id,
		 Role = 'Partner User'

However, I receive "Field is not writeable: AccountPartner.AccountToId", "Field is not writeable: AccountPartner.AccountFromId", "Field is not writeable: AccountPartner.Role".


Is there a way around this?