• Ugur Kaya
  • NEWBIE
  • 55 Points
  • Member since 2017

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 14
    Replies
Very new to this.  I have spent an hour on this and know you guys could answer this in 10 seconds.  I am simply trying to get the "mailing Country" info to the next line.  I have created an envelope button that is supposed to present info like this:

ABC Company
Attn:Accounts Receivable
New York, NY 12345
USA

But it incorrectly presents it like this:

ABC Company
Attn:Accounts Receivable
New York, NY 12345USA

How can I move the country info to the next line?  Here is my code:

<apex:page standardController="Contact" renderAs="PDF" showheader="false" sidebar="false"> <apex:styleSheet value="{!URLFOR($Resource.Envelope)}" /> <apex:panelGrid columns="1"> <apex:outputField value="{!Contact.owner.name}"/> <apex:outputText value="{!$Organization.Name}"/> <apex:outputField value="{!Contact.owner.Street}"/> <apex:panelGroup > <apex:outputField value="{!Contact.owner.City}"/>, <apex:outputField value="{!Contact.owner.State}"/>&nbsp; <apex:outputField value="{!Contact.owner.PostalCode}"/> </apex:panelGroup> </apex:panelGrid> <apex:panelGrid columns="1" style="padding-left:300px; margin-top:100px;width:100%"> <apex:outputField value="{!Contact.account.name}"/> <apex:panelGroup > Attn: <apex:outputField value="{!Contact.name}"/> </apex:panelGroup> <apex:outputField value="{!Contact.mailingStreet}"/> <apex:panelGroup > <apex:outputField value="{!Contact.mailingCity}"/>, <apex:outputField value="{!Contact.mailingState}"/>&nbsp; <apex:outputField value="{!Contact.mailingPostalCode}"/> <apex:outputField value="{!Contact.mailingCountry}"/> </apex:panelGroup> </apex:panelGrid> </apex:page>
Hi guys, i'm trying to get RecordTypeId in a Lightning Web Component which is located on the Account record page. 
I'll explain this component accesses a picklist field that is different depending on the record type. So I wanted to add record-type-id to the lightning-record-edit-form that is present on my component but in don't know how to get this id in my JS.
I tried this : 
 
import { LightningElement, api, wire } from "lwc";
import { getRecord } from "lightning/uiRecordApi";
import ACCOUNT_RECORDTYPE_FIELD from '@salesforce/schema/Account.RecordTypeId';

export default class Account_Redirect extends NavigationMixin(LightningElement) {
  @api recordId;
  @api objectApiName;

  @wire(getRecord, { recordId: '$recordId', fields: [ACCOUNT_RECORDTYPE_FIELD] })
  acc;

  get recordTypeId() {
    return this.acc.data.fields.RecordTypeId.value;
  }
}
But i have the following error : 
"Cannot read property 'fields' of undefined" 

I'm not sure what to do to make it work.
If someone can help me on this or give me other way to get this recordTypeId
 
Hi,
I'm facing one issue while executing tests for Queueable future method. When I runing my code using debugging tool on developer console then my code is running successfully. however test is failing. After analysins this it is found that the test class is not able to execute the future method which is being called in Queueable class. Anyone have any idea? 
 
public class CustomClass {
    
    public static void calloutServiceMethod(List<InputParams> inputParams) {      
        cuatomConfig__c configObject = getConfig(inputParams[0].configName);
        System.enqueueJob(new QueueableCall(configObject, inputParams[0].Ids));
    }
    
   
    @Future(callout=true)
    private static void postCall(String configName, List<Id> ids) {
        //some code here that is not being called
    }  
    
    class QueueableCall implements System.Queueable, Database.AllowsCallouts {
        private cuatomConfig__c configuration;
        private List<id> IDS;
        public QueueableCall(cuatomConfig__c Configuration, List<Id> ids){
          this.configuration = Configuration;
          this.IDS = ids;
        }
        public void execute(QueueableContext context) {
            String CName = configuration.Name__c;
            postCall(CName, IDS);
        }
    }
    
     public class InputParams {   
        
        public List<Id> Ids;
        public String configName;
    }
    
}

 
I have created a flow and added a logo image in the display text component of the flow. This flow is added on a community and using Embedded Services the community is embedded on an external Site. 

Issue is Guest users are not able to view the Logo image and it shows broken. I researched on the issue and found out that image added in a flow is saved as chatter file in Salesforce. Chatter file does not have any option to give access to Guest user. 

I also tried a workaround. I added the logo image as a Static resource and reference the static resource from the flow. It works fine when I run the flow but when I activate the flow and check on the external website the flow gives an error "Error element StaticResource (FlowRecordLookup).
This error occurred when the flow tried to look up records: sObject type 'StaticResource' is not supported.. You can look up ExceptionCode values in the SOAP API Developer Guide (https://eur02.safelinks.protection.outlook.com/?url=https%3A%2F%2Fdeveloper.salesforce.com%2Fdocs%2Fatlas.en-us.api.meta%2Fapi%2Fsforce_api_calls_concepts_core_data_objects.htm%23&data=02%7C01%7Cvikrant.panchmukhe%40volvocars.com%7Cc1c68ed287c44113df6308d81e512be8%7C81fa766ea34948678bf4ab35e250a08f%7C0%7C0%7C637292681261554579&sdata=A%2B76kq63UEnJbHrQUL%2B3E7%2BPDHN9c2P2k%2BaRxDgfoqI%3D&reserved=0" originalsrc="https://developer.salesforce.com/docs/atlas.en-us.api.meta/api/sforce_api_calls_concepts_core_data_objects.htm#" shash="M6huuBxsF0jyxjxWD7h9CUPEPZztP4y5zdEpJo6982dwWU7LBLlkzYzhrWJDYI8LUa+4xS87nkO0cOqaRhhc+eN4BvOdAizsuhwesu3HzCEmPI3/RUi005Erea3EiGFlTisFyQbtJtxh4KEipjy7Ftlo9n6JlBpBf1dHqtAZn9s=" style="color:blue; text-decoration:underline)." 
Any help will be greatly appreciated
  • July 02, 2020
  • Like
  • 0
My organization is looking to archive some records some I'm running some preliminary numbers for records we might want to archive.  I'd like to run a bunch of standard queries looking at records created >4 years ago.  When I add 'WHERE CreatedDate != LAST_N_DAYS:1460' at the end of my query I'm not getting anything. Is this the wrong way to do this query?
Thanks in advance for your help!
 
Very new to this.  I have spent an hour on this and know you guys could answer this in 10 seconds.  I am simply trying to get the "mailing Country" info to the next line.  I have created an envelope button that is supposed to present info like this:

ABC Company
Attn:Accounts Receivable
New York, NY 12345
USA

But it incorrectly presents it like this:

ABC Company
Attn:Accounts Receivable
New York, NY 12345USA

How can I move the country info to the next line?  Here is my code:

<apex:page standardController="Contact" renderAs="PDF" showheader="false" sidebar="false"> <apex:styleSheet value="{!URLFOR($Resource.Envelope)}" /> <apex:panelGrid columns="1"> <apex:outputField value="{!Contact.owner.name}"/> <apex:outputText value="{!$Organization.Name}"/> <apex:outputField value="{!Contact.owner.Street}"/> <apex:panelGroup > <apex:outputField value="{!Contact.owner.City}"/>, <apex:outputField value="{!Contact.owner.State}"/>&nbsp; <apex:outputField value="{!Contact.owner.PostalCode}"/> </apex:panelGroup> </apex:panelGrid> <apex:panelGrid columns="1" style="padding-left:300px; margin-top:100px;width:100%"> <apex:outputField value="{!Contact.account.name}"/> <apex:panelGroup > Attn: <apex:outputField value="{!Contact.name}"/> </apex:panelGroup> <apex:outputField value="{!Contact.mailingStreet}"/> <apex:panelGroup > <apex:outputField value="{!Contact.mailingCity}"/>, <apex:outputField value="{!Contact.mailingState}"/>&nbsp; <apex:outputField value="{!Contact.mailingPostalCode}"/> <apex:outputField value="{!Contact.mailingCountry}"/> </apex:panelGroup> </apex:panelGrid> </apex:page>
Hi, 

Class started throwing below errom from yesterday. We have not updated anything  recently. 

Error : System.QueryException: No such column 'lastpasswordchangedate' on entity 'User'

Observations:
  • This class is failing only in sandbox but not in prod.
  • Sandbox Version - Summer '20 Patch 10  and Spring '20 Patch 23.21
  • If i update the class to without sharing then it is working fine.
  • The class is failing only while testing the functionlity using community user but it is perfectly working fine for internal user.
Any help will/would be appreciated?
  • June 24, 2020
  • Like
  • 0
Apex Class:- 
/**
 * Created by usman on 1/30/2020.
 */

global class CampaignEmailUtility{
    public static void createListEmail(String fuStageId){
        Campaign_Follow_Up_Stage__c objCFUS = CampaignEmailUtility.getFollowUpStage(fuStageId);        
        if(objCFUS != null) {
            OrgWideEmailAddress owdEmail = CampaignEmailUtility.getEmailById(objCFUS.Campaign__r.From_Email_Id__c);
            EmailTemplate objEmailTemplate = CampaignEmailUtility.getEmailTemplateById(objCFUS.Email_Template_Id__c);
            ListEmail objLeadEmail = new ListEmail(
                Status='draft',
                CampaignId = objCFUS.Campaign__c,
                FromAddress = owdEmail.Address,//'awsqualitytech@gmail.com',
                FromName = owdEmail.DisplayName,//'Chris Taylor',
                HtmlBody = objEmailTemplate.HtmlValue,
                Name = objEmailTemplate.Subject,
                Subject = objEmailTemplate.Subject,
                TextBody = objEmailTemplate.Body
            );
            insert objLeadEmail;
            CampaignEmailUtility.createListEmailRecipientSource(objLeadEmail.Id, objCFUS.Campaign__c);
        }
    }

    public static OrgWideEmailAddress getEmailById(String oId){
        return [select Id,Address,DisplayName from OrgWideEmailAddress WHERE Id = :oId limit 1];
    }
    public static EmailTemplate getEmailTemplateById(String templateId){
        list<EmailTemplate> objEmailTemplates = [SELECT Body,BrandTemplateId,Description,DeveloperName,Encoding,
                                                    EnhancedLetterheadId,FolderId,FolderName,HtmlValue,Id,IsActive,
                                                    Markup,Name,NamespacePrefix,OwnerId,RelatedEntityType,Subject,
                                                    TemplateStyle,TemplateType,TimesUsed,UiType
                                                FROM EmailTemplate WHERE Id=:templateId];
        if(objEmailTemplates != null){
            return objEmailTemplates.get(0);
        }
        return null;
    }

    public static Campaign_Follow_Up_Stage__c getFollowUpStage(String fuStageId){
        list<Campaign_Follow_Up_Stage__c> objFollowUpStage = [SELECT Id,Campaign__r.From_Email__c,Campaign__r.From_Email_Id__c,Campaign__c,Email_Template_Id__c,
                                                                    Follow_Up_Days__c,Follow_Up_Time__c
                                                                FROM Campaign_Follow_Up_Stage__c
                                                                WHERE Id=:fuStageId];
        if(objFollowUpStage != null){
            return objFollowUpStage.get(0);
        }
        return null;
    }

    public static void createListEmailRecipientSource(String listEmailId, String campgainId){
        ListEmailRecipientSource objLERS = new ListEmailRecipientSource(
                ListEmailId = listEmailId,
                SourceListId = campgainId,
                SourceType = 'IncludeList'
        );
        insert objLERS;
        //To DO Remove schedule per time in follow up object
        if(objLERS.Id != null && listEmailId != null){
            CampaignEmailUtility.schdeuleEmailList(listEmailId);
        }
    }

    public static void schdeuleEmailList(String listEmailId){
        ListEmail objListEmail = new ListEmail(
                Id = listEmailId,
                Status = 'Scheduled'
        );
        update objListEmail;
    }

    public static list<OrgWideEmailAddress> getAllOrgWideEmailAddress(){
        return [SELECT Id,Address,DisplayName,IsAllowAllProfiles from OrgWideEmailAddress];
    }
}
Test Class:- 
@isTest(seeAllData = true)
 Public class CampaignEmailUtility_test{
     static testmethod void CampaignEmailUtility_TestMethod(){
 
 Campaign objcmp =new Campaign();
 objcmp .Name='Test Campaign';
 objcmp .IsActive=true;
 objcmp .Type='Email';
 objcmp .Status='Planned';
 objcmp.From_Email_Id__c = 'awsqualitytech@gmail.com';
 insert objcmp;
 
 Campaign_Follow_Up_Stage__c objCmpFlStg = new Campaign_Follow_Up_Stage__c();
         objCmpFlStg.Name = 'Stage 1';
         objCmpFlStg.Campaign__c = objcmp.id;
         objCmpFlStg.Email_Template_Id__c = '00X1F000001UleG';
         objCmpFlStg.Follow_Up_Date__c = system.today();
         objCmpFlStg.Follow_Up_Days__c = 5; 
         //objCmpFlStg .Follow_Up_Time__c=17:30; 
         objCmpFlStg .Local_Schedule_Date_Time__c = System.Now();  
         //objCmpFlStg .Schedule_time__c
         objCmpFlStg.Send_To_Prospects__c = 'All';
         objCmpFlStg.Status__c = 'Planned';
         objCmpFlStg.Time_Zone__c = 'PST';
         insert objCmpFlStg; 
         
         Campaign_Follow_Up_Stage__c objCmpFlStg1 = new Campaign_Follow_Up_Stage__c();
         objCmpFlStg1 .Campaign__c = objcmp.id;
         objCmpFlStg1 .Email_Template_Id__c = '00X1F000001UleG';
         objCmpFlStg1 .Follow_Up_Date__c = system.today();
         objCmpFlStg1 .Follow_Up_Days__c = 5; 
         //objCmpFlStg .Follow_Up_Time__c=17:30; 
         objCmpFlStg1 .Local_Schedule_Date_Time__c = System.Now().addMinutes(3);  
         //objCmpFlStg .Schedule_time__c
         objCmpFlStg1 .Send_To_Prospects__c = 'All';
         objCmpFlStg1 .Status__c = 'Completed';
         objCmpFlStg1 .Time_Zone__c = 'PST';
         insert objCmpFlStg1 ; 
 

     //OrgWideEmailAddress    oWEA = [select Id,Address,DisplayName from OrgWideEmailAddress];
        OrgWideEmailAddress owEA = new OrgWideEmailAddress();
                owEA.Address = objcmp.From_Email_Id__c;
                owEA.DisplayName = objcmp.Name;
                    
     User usr = [Select id,Email from User where Id = :UserInfo.getUserId()];

     System.RunAs(usr)

     {

      EmailTemplate validEmailTemplate = new EmailTemplate();
        validEmailTemplate.isActive = true;
        validEmailTemplate.Name = 'name';
        validEmailTemplate.DeveloperName = 'Abhi';
        validEmailTemplate.TemplateType = 'text';
        validEmailTemplate.HtmlValue = 'text';
        validEmailTemplate.Subject = 'name';
        validEmailTemplate.Body= 'Abhi';
        validEmailTemplate.FolderId = UserInfo.getUserId();
        
        insert validEmailTemplate;   
        
        list<EmailTemplate> objEmailTemplates = [SELECT Body,BrandTemplateId,Description,DeveloperName,Encoding,
                                                    EnhancedLetterheadId,FolderId,FolderName,HtmlValue,Id,
                                                    Markup,Name,NamespacePrefix,OwnerId,RelatedEntityType,Subject,
                                                    TemplateStyle,TemplateType,TimesUsed,UiType
                                                FROM EmailTemplate WHERE Id=:validEmailTemplate.ID LIMIT 1];
   // insert validEmailTemplate;
        
        ListEmail objLeadEmail = new ListEmail(
                Status='draft',
                CampaignId = objCmpFlStg.Campaign__c,
                FromAddress = oWEA.Address,
                FromName = 'Chris Taylor',
                HtmlBody = objEmailTemplates[0].HtmlValue,
                Name = objEmailTemplates[0].Subject,
                Subject = objEmailTemplates[0].Subject,
                TextBody = objEmailTemplates[0].Body);
                insert objLeadEmail;
                
                
   Test.startTest();     
 CampaignEmailUtility cEU = new CampaignEmailUtility();
 CampaignEmailUtility.getFollowUpStage(objCmpFlStg.id);
 CampaignEmailUtility.getEmailTemplateById(validEmailTemplate.id);
 CampaignEmailUtility.createListEmailRecipientSource(objLeadEmail.id,objcmp.id);
 CampaignEmailUtility.createListEmail(objCmpFlStg.Id);
 //CampaignEmailUtility.schdeuleEmailList(objLeadEmail.id);
 CampaignEmailUtility.getAllOrgWideEmailAddress();

         Test.stopTest();

     }
        
    
  }
 }

Error :-
System.QueryException: List has no rows for assignment to SObject
Stack TraceClass.CampaignEmailUtility.getEmailById: line 27, column 1
Class.CampaignEmailUtility.createListEmail: line 9, column 1
Class.CampaignEmailUtility_test.CampaignEmailUtility_TestMethod: line 90, column 1
How to activate the method onSubmit in < lightning:button onclick="{!c.onSubmit} /> when ENTER Key is Pressed

in Aura components development
Help?  I have been putting together a Lightening Flow and it all works great, except I cannot get the New Lookup Component to work.  I have kep it really simple but it is not returing any results.  Usually, in a lookup search, when I type in anything, it will start to show the available records to choose.  However, no records are showing up. It is as it the underlying Object is not being searched.   

The Lookup is for the Account Object. 
The Lookup Component Setting are:

*API Name: LookupToAccount
*Field API Name: Name
*Label: Search for an Existing Account
*Object API Name: Account
Record Id: [left this blank]
Required: [left this blank]
Manually assign variables (advanced): [unchecked]

I have double checked the Account Object to ensure "Name" is the appropriate field to display.  I have activated the Flow in Lightening runtime as I understand that Lookup Components may not work unless in Lightening runtime.  I am definantely typing in text that should appear as we have 1000's of Account records.  

Help?
Hello All,

Need your help in acheiving one requirement. I have list of accounts on one components, once we click on the Account, It fires an event ( Passing an AccountId). The event is received by some other components (No Parent-Child Relationship), the JS Connectec call back methods, Registers an event and then through wire method(Passing an AccountId received by Event), fethcing all the contacts, These contacts are then renders through Lightning data table ( Till this time, everything works as expected).
The problem occurs when i tries to add the empty row in Lightning data table, I can see in logs that List is being added but it does not re render the lightning data table and blank row is not added)
Hi guys, i'm trying to get RecordTypeId in a Lightning Web Component which is located on the Account record page. 
I'll explain this component accesses a picklist field that is different depending on the record type. So I wanted to add record-type-id to the lightning-record-edit-form that is present on my component but in don't know how to get this id in my JS.
I tried this : 
 
import { LightningElement, api, wire } from "lwc";
import { getRecord } from "lightning/uiRecordApi";
import ACCOUNT_RECORDTYPE_FIELD from '@salesforce/schema/Account.RecordTypeId';

export default class Account_Redirect extends NavigationMixin(LightningElement) {
  @api recordId;
  @api objectApiName;

  @wire(getRecord, { recordId: '$recordId', fields: [ACCOUNT_RECORDTYPE_FIELD] })
  acc;

  get recordTypeId() {
    return this.acc.data.fields.RecordTypeId.value;
  }
}
But i have the following error : 
"Cannot read property 'fields' of undefined" 

I'm not sure what to do to make it work.
If someone can help me on this or give me other way to get this recordTypeId
 
Hello!
We are trying to implement SAML 2.0 assertion flow in c#.NET desktop application to allow user to login into Salesforce through his/her domain(Active Directory) credentials. To achieve this, we have done following things so far:

1. We have implemented Salesforce SSO (through ADFS 2.0 & SAML 2.0) and we are able to successfully login into salesforce from browser (Through Identity Provider(IdP) Initiated login approach). URL used in IdP initiated approach: https://adforsfsso.nifdc.com/adfs/ls/IdpInitiatedSignon.aspx?loginToRp=https://saml.salesforce.com

2. Now we are trying to implement SAML assertion flow (Reference URL: https://help.salesforce.com/articleView?id=remoteaccess_oauth_web_sso_flow.htm) to allow user to login into Salesforce within custom c#.NET desktop based application through Salesforce SSO implemented in above point #1 (through user's domain(Active Directory) credentials).

3. We have followed steps given in SAML Assertion flow implementation document (Reference URL: https://help.salesforce.com/articleView?id=remoteaccess_oauth_web_sso_flow.htm). 
    3.1 According to it, we need valid a Base-64 encoded, then URL encoded, SAML response that is normally used for web single sign-on. We have captured SAML response from Web SSO URL (https://adforsfsso.nifdc.com/adfs/ls/IdpInitiatedSignon.aspx?loginToRp=https://saml.salesforce.com) through fiddler. Below is Base64 decoded version SAML response we received from Web SSO URL:
        
        
<samlp:Response xmlns:samlp="urn:oasis:names:tc:SAML:2.0:protocol" ID="_a811a056-b137-4f3e-a2c3-621301effbb1" Version="2.0" IssueInstant="2017-07-06T09:47:21.243Z" Destination="https://login.salesforce.com?so=00D410000012bMN" Consent="urn:oasis:names:tc:SAML:2.0:consent:unspecified">
            <Issuer xmlns="urn:oasis:names:tc:SAML:2.0:assertion">http://ADforSFSSO.nifdc.com/adfs/services/trust</Issuer>
            <samlp:Status>
                <samlp:StatusCode Value="urn:oasis:names:tc:SAML:2.0:status:Success" />
            </samlp:Status>
            <Assertion xmlns="urn:oasis:names:tc:SAML:2.0:assertion" ID="_d42ebb25-d1cb-4025-aad1-1fe282a9d30b" IssueInstant="2017-07-06T09:47:21.243Z" Version="2.0">
                <Issuer>http://ADforSFSSO.nifdc.com/adfs/services/trust</Issuer>
                <ds:Signature xmlns:ds="http://www.w3.org/2000/09/xmldsig#">
                    <ds:SignedInfo>
                        <ds:CanonicalizationMethod Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                        <ds:SignatureMethod Algorithm="http://www.w3.org/2000/09/xmldsig#rsa-sha1" />
                        <ds:Reference URI="#_d42ebb25-d1cb-4025-aad1-1fe282a9d30b">
                            <ds:Transforms>
                                <ds:Transform Algorithm="http://www.w3.org/2000/09/xmldsig#enveloped-signature" />
                                <ds:Transform Algorithm="http://www.w3.org/2001/10/xml-exc-c14n#" />
                            </ds:Transforms>
                            <ds:DigestMethod Algorithm="http://www.w3.org/2000/09/xmldsig#sha1" />
                            <ds:DigestValue>gIcx+gPXCXxp30W9Fnc2mDvzbzo=</ds:DigestValue>
                        </ds:Reference>
                    </ds:SignedInfo>
                    <ds:SignatureValue>dKcaZRut8Ebmry3fqRPiRyFEl7hdu1ntBkKKemYIS6dfEsXpCHmvoiOQEGHO1ft/h/TlKC7kZ/8sIgS3DU/b54PU4fN2+n3l1f8US+k282LLjAdXN9KeNeUbVvSD3F290p7ThKg+l0zgActQYnt2lEPsiGHt3Gw8v0tUogXS/3bljP0jnRyzX1meQ68qjWEthGUr11QzMENQSsCr51Qpb7TzofxWYKghgd8wYd2JXAtr5QHaiVlSyZHmPJjyZ8k+30oK7SGP+/i9gytr87Gy89aO+PYoWatSd0fa7/YJZZGGN/2r7fwUH0+S/5ZSOsnBY9K1WeDx5Zt1yApYjKSD/Q==</ds:SignatureValue>
                    <KeyInfo xmlns="http://www.w3.org/2000/09/xmldsig#">
                        <ds:X509Data>
                            <ds:X509Certificate>MIIC5DCCAcygAwIBAgIQYSbnq+iCZL5KzguC0ED3NDANBgkqhkiG9w0BAQsFADAuMSwwKgYDVQQDEyNBREZTIFNpZ25pbmcgLSBBRGZvclNGU1NPLm5pZmRjLmNvbTAeFw0xNzA2MTQxMzMwMzZaFw0xODA2MTQxMzMwMzZaMC4xLDAqBgNVBAMTI0FERlMgU2lnbmluZyAtIEFEZm9yU0ZTU08ubmlmZGMuY29tMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEAoX/zXfMlfetGNctUuyo+/77IHEEeg1Vdm9of2zrr+mgd4/O+4SOm1uoaAu3mlSrzgwJaRXdV3rEXi8CeChcl9a4jvddhy54NGzafSoWehp7vtURolhr83biR6XYYwXZw0dH55VV5CjyHEBsX3V7TAfRuxjzjie4xHhnpwNOioHdZ8sG/tw918rE314RfXkyJt4I5YSd9YB4d3eaKLePM7S0uSerm717PP/WcuZtv0SlZPUoRIItjx+a2+qqmmN5jU0UilSUrOd7tlGHYifG6L//b0Ffe+HnIcm5uY3tdMToLs7REkR2Rg3mC+JQ3IFJOPBYgtUCXYL1uwwJii131cQIDAQABMA0GCSqGSIb3DQEBCwUAA4IBAQBpMZNoppRIBi7YSc0DOEw+mLYQIK8PBnDmG3x1jVeEXYE0kxuPJ8C7QqfBgmZ2tPcfFrmtfl6CJlIhpU6U2gRXVyjc9pAkumz+XJ/v23y3TmFtlhS3ajwVSz/1Sp7nR314QEajgQvuCkusxJgM5HCVtM91Hue1q7s6qeUUQsynQ82HgiBXi9y6y5JaIzRexBjRD8iZViXgX0ezfIKdlHApPD1pepHeD4s/vtVl/9At4PXUj1rgK3IM4trP3qpIJeBgP+h5tZ4gK+JmL+n1G3fiL0IL+yjCQeuZWHHinDuI4qe8+goww3bzkOitk8KhAeprK5ziUaFGbO+UwrA/M+AQ</ds:X509Certificate>
                        </ds:X509Data>
                    </KeyInfo>
                </ds:Signature>
                <Subject>
                    <NameID>niadmin@nifdc.com</NameID>
                    <SubjectConfirmation Method="urn:oasis:names:tc:SAML:2.0:cm:bearer">
                        <SubjectConfirmationData NotOnOrAfter="2017-07-06T09:52:21.243Z" Recipient="https://login.salesforce.com?so=00D410000012bMN" />
                    </SubjectConfirmation>
                </Subject>
                <Conditions NotBefore="2017-07-06T09:47:21.243Z" NotOnOrAfter="2017-07-06T10:47:21.243Z">
                    <AudienceRestriction>
                        <Audience>https://saml.salesforce.com</Audience>
                    </AudienceRestriction>
                </Conditions>
                <AuthnStatement AuthnInstant="2017-07-06T09:13:07.861Z" SessionIndex="_d42ebb25-d1cb-4025-aad1-1fe282a9d30b">
                    <AuthnContext>
                        <AuthnContextClassRef>urn:federation:authentication:windows</AuthnContextClassRef>
                    </AuthnContext>
                </AuthnStatement>
            </Assertion>
        </samlp:Response>

    3.2 We have checked above SAML response in "SAML Validator Tool" available in salesforce org under "Setup -> Single Sing-on settings". It is showing it as correct SAML response. Please find below screenshot of the same:
SAML Validator result of SAMLResponse received from Web SSO URL
    
    3.3 But when we POST Base64 encoded SAML response on OAuth 2.0 token end point (URL: https://login.salesforce.com/services/oauth2/token?so=00D410000012bMN), it is giving following error in json format:
{"error":"invalid_grant","error_uri":"https://na35.salesforce.com/setup/secur/SAMLValidationPage.apexp","error_description":"invalid assertion"}

We have used simple form for now to POST SAML Response. Below is the same:
<html>
<body>
	<form enctype="application/x-www-form-urlencoded" name="testform" action="https://login.salesforce.com/services/oauth2/token?so=00D410000012bMN" method="POST">
	<input type="hidden" name="grant_type" value="assertion" />
	<input type="hidden" name="assertion_type" value="urn:oasis:names:tc:SAML:2.0:profiles:SSO:browser" />
	<input type="hidden" name="format" value="json" />
	<input type="hidden" name="assertion" value="<<BASE64 ENCODED SAML RESPONSE >>" />
	<input type="submit" name="submit" value="Submit" />
</form>
</body>
</html>
Question / Help required:
1. Has anyone has any idea how to resolve this error? (invalid_grant
)
2. If you have any valid SAML response, please share.
Hi All,

I'm trying to create a Lightning Component for a Global Quick Action in order to create a detail object "Billable__c" for a Master Object "Project__c".

I've got it working in Salesforce Lightning Experience, however I'm having issues using the global quick action in the Salesforce1 app.  I'm getting the following error:
 
Error in $A.getCallback() [undefined is not an object (evaluating 'a.attributes')]
Callback failed: serviceComponent://ui.chatter.components.aura.components.forceChatter.chatter.QuickActionLoaderController/ACTION$getQuickActions
(https://stratusg.lightning.force.com/auraFW/javascript/xH6sVFQUmvLYLsBsK3q02Q/aura_prod.js:2)

Here is my component:
 
<aura:component implements="force:lightningQuickActionWithoutHeader" controller="HoursController" access="GLOBAL">
    <aura:attribute name="newBillable" type="Billable__c" default="{ 'sobjectType': 'Billable__c'}"/>
    <aura:attribute name="options" type="list" default="[{ 'class': 'optionClass', label: '- None -', value: '' }]"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}" />
    <div class="slds-page-header" role="banner">
        <h1 class="slds-page-header__title slds-m-right--small slds-truncate slds-align-left">Log Hours</h1>
    </div>
    <label class="slds-form-element__label">Number of Hours</label>
    <force:inputField aura:id="hours" value="{!v.newBillable.Numer_of_Hours__c}" />
    <lightning:select aura:id="project" name="project" label="Project" value="{!v.newBillable.Project__c}" required="true">
    	<aura:iteration items="{!v.options}" var="item" >
            <option text="{!item.label}" value="{!item.value}" selected="{!item.selected}"/>
        </aura:iteration>
    </lightning:select>
    <label class="slds-form-element__label">Date</label>
    <force:inputField aura:id="date" value="{!v.newBillable.Date__c}" />
    <label class="slds-form-element__label">Description</label>
    <force:inputField aura:id="desc" value="{!v.newBillable.Description__c}" />
    <lightning:button label="Save Billable" onclick="{!c.handleSaveBillable}" variant="brand" class="slds-m-top-medium"/>
</aura:component>

Here is my Controller:
 
({
    doInit : function (component, event, helper) {
        helper.loadProjects(component);
    },
    
	handleSaveBillable : function(component, event, helper) {
        var newBillable = component.get("v.newBillable");
        helper.upsertBillable(component, newBillable);
    }
})
Helper:
 
({
    loadProjects : function(component) {
        var action = component.get("c.getProjects");
        action.setCallback(this, function(response) {
            var state = response.getState();
            if(state === "SUCCESS") {
                //component.set("v.projects", response.getReturnValue());
                //var projects = component.get("v.projects");
        		var projects = response.getReturnValue();
                var opts = new Array();
        		opts.push({value: "", label: "- None -"});
                for(var i=0; i<projects.length; i++){
                    var p = projects[i];
                    console.log(p);
                    opts.push({value: p.Id, label: p.Name});
                }
                console.log(opts);
                component.set("v.options", opts);
            } else {
                console.log('Problem getting Projects, response state: '+state);
            }
        });
        $A.enqueueAction(action);
    },
    
    upsertBillable : function(component, billable) {
        var action = component.get("c.saveBillable");
        action.setParams({
            "billable": billable
        });
        $A.enqueueAction(action);
    }
})

Apex Controller:
 
public with sharing class HoursController {
	
    @AuraEnabled
    public static List<Project__c> getProjects(){
        return [SELECT Id, Name FROM Project__c WHERE Status__c = 'Active'];
    }
    
    @auraEnabled
    public static Billable__c saveBillable(Billable__c billable){
        upsert billable;
        return billable;
    }
}

Any help is appreciated.