-
ChatterFeed
-
3Best Answers
-
12Likes Received
-
0Likes Given
-
54Questions
-
57Replies
Change of Ownership Edit page
out of the box, Salesforce allows you to change ownership of an account owner to another owner by means of cllicking the "Change" next to the current account owner. Upon clicking it, you are transferred over to the Ownership Edit page (see below).
Is their a way to keep all the functionalities/selections on this page, but also add the ability to add a custom message that will transfer over via email when the "Send Notification Email" checkbox is selected?
-
- HNT_Neo
- November 11, 2015
- Like
- 0
- Continue reading or reply
inputField Calendar in a VF page using a controller
Hi guys.. I hope someone can help me. I'm trying to use a inputField Calendar in a VF page, the problem is I using a controller, any ideas?
This is the calendar that I'd like to have in my VF page.
THANK YOU...
-
- NaypersMclgx
- April 17, 2012
- Like
- 0
- Continue reading or reply
Azure deployment failure
In one of our steps, we run the Salesforce deployment (validation only), but whether it is succsesful or not, the yaml file performs as a successful deployment.
if [ $(setvarStep.PullRequest) = 'true' ] then echo 'DevOps Message -- Validation in Progress - Non Feature branch behavior' npx sfdx force:source:deploy --checkonly --testlevel $(setvarStep.SalesforceTestLevel) --sourcepath $(salesforce.sourcepath) --targetusername $(salesforce.connectedApp.Alias) fi
I'm trying to catch this deployment now into a string, but unsure/unable to do a check to see if there's an error:
if [ $(setvarStep.PullRequest) = 'true' ] then echo 'DevOps Message -- Validation in Progress - Non Feature branch behavior' sfdxresult=$(npx sfdx force:source:deploy --checkonly --testlevel $(setvarStep.SalesforceTestLevel) --sourcepath $(salesforce.sourcepath) --targetusername $(salesforce.connectedApp.Alias)) if ($deploymentresult -like "*Component Failures*") then echo "found the error!" else echo "no error found!" fi fi
The above always writes "no error found!"
Any advice?
-
- AndrewTaylor
- December 23, 2019
- Like
- 0
- Continue reading or reply
SFDX Scratch Org and Permission Set License
To access this object, even as a System Admin deploying layout changes, the user seems to need the "Sales User" or "CRM User" permission set license, then a permission set enabling "Campaign Influence".
In my scratch org, I don't see either of these Permission Set Licenses available.
How can I access CampaignInfluence2 in a scratch org?
-
- AndrewTaylor
- August 20, 2019
- Like
- 0
- Continue reading or reply
Azure DevOps and SFDX
Is it possible to run Azure DevOps pipelines using Salesforce DX? Presumably the sfdx cli needs to be installed, but unsure of a starting point.
I've seen a video leveraging ANT scripts, but nothing so far with sfdx.
-
- AndrewTaylor
- June 13, 2019
- Like
- 0
- Continue reading or reply
Metadata API - Error: Cannot find folder:
All Component Failures: 1. reports/<report_folder>/<report_name>.report -- Error: Cannot find folder:<report_folder>I'm hoping this doesn't involve manual creation of the folder in the target org.
I have the report folder in my metadata in reports/<report_name>-meta.xml, and looks like:
<?xml version="1.0" encoding="UTF-8"?> <ReportFolder xmlns="http://soap.sforce.com/2006/04/metadata"> <accessType>Public</accessType> <name>report name</name> <publicFolderAccess>ReadOnly</publicFolderAccess> </ReportFolder>
Is there something I'm missing?
-
- AndrewTaylor
- June 04, 2018
- Like
- 0
- Continue reading or reply
CustomMetadata was named in package.xml, but was not found in zipped directory
The custom metadata definition is in the objects directory (<custom metadata>__mdt), and a directory with the metadata in customMetadata
I came across the link below, and had a similar issue with the retrieve stripping __mdt from the metadata files; I tried renaming these, but to no avail
https://jungleeforce.wordpress.com/2017/04/10/error-an-object-custommetadata-record-md-of-type-custommetadata-was-named-in-package-xml-but-was-not-found-in-zipped-directory/
-
- AndrewTaylor
- May 02, 2018
- Like
- 0
- Continue reading or reply
Lightning Component Task.Type Field is Empty
@AuraEnabled public static Task initTask(Id contactId) { Task t = new Task( Type = 'Type A', OwnerId = UserInfo.getUserId(), Status = 'Completed', ActivityDate = Date.today(), Priority = 'Normal', Subject = 'Notes' ); System.debug('t = ' + t); return t; }When I call this, the Type field appears to be empty:
var action = component.get("c.initTask"); action.setParams({ "contactId": contactId }); action.setCallback(this, function(a) { var state = a.getState(); if (state === "SUCCESS") { var record = a.getReturnValue(); console.log("record = "); console.log(record); console.log(record.Type); if(record.Type == '') { console.log('Type is empty'); } else { console.log('Type is something else?'); } console.log(a.getReturnValue().Type) component.set('v.record', record); console.log('post set'); console.log(component.get('v.record').Type); } else if (state === "ERROR") { var errors = a.getError(); console.error(errors); } }); $A.enqueueAction(action);
In the log, console.log(record.Type) shows the expected value, however, if I write out {!v.record.Type} in my component, it's empty.
If I reference a different field, it works as expected; my suspicion is that Type is a reserved attribute/parameter, however, I'm unsure of a clean workaround.
Any insights are appreciated.
-
- AndrewTaylor
- February 26, 2018
- Like
- 0
- Continue reading or reply
Deploying Object's Compact Layout Assignment
I'm retrieving my code through my IDE (Mavensmate) and deploying thorugh ANT scripts.
In retrieving the related metadata (I don't want the whole object, only the relevant changes), I get the following:
<?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <compactLayouts> <fullName>Default</fullName> <fields>Name</fields> <fields>Field1__c</fields> <fields>Field2__c</fields> <fields>Field3__c</fields> <fields>Field4__c</fields> <label>Default</label> </compactLayouts> </CustomObject>
I can try manually adding compactLayoutAssignment, but worry about this disappearing every time I retrieve/refresh my project from the org. Is there a way I can cleanly configure my project so this is retrieved, and I can deploy w/o updating the xml beforehand?
-
- AndrewTaylor
- February 01, 2018
- Like
- 1
- Continue reading or reply
Org Default FlexiPage - How is this set in the MetaData API?
-
- AndrewTaylor
- January 18, 2018
- Like
- 1
- Continue reading or reply
Loading a Record using force.recordData targetFields
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes" access="global"> <aura:attribute name="record" type="Object"/> <aura:attribute name="fieldsToQuery" type="Object"/> <aura:attribute name="recordError" type="String"/> <force:recordData aura:id="recordLoader" recordId="{!v.recordId}" layoutType="FULL" targetRecord="{!v.record}" targetError="{!v.recordError}" targetFields="{!v.fieldsToQuery}" /> {!v.fieldsToQuery.Name} <br/> {!v.fieldsToQuery.MailingAddress}<br /> {!v.fieldsToQuery.MailingCity}, {!v.fieldsToQuery.MailingState} {!v.fieldsToQuery.MailingPostalCode}<br /> {!v.fieldsToQuery.MailingCountry} </aura>
In the above, the data does not render on the page; if I try to specifically set the fields in force:recordData, it doesn't help either. Is there something I'm missing on this?
-
- AndrewTaylor
- January 08, 2018
- Like
- 0
- Continue reading or reply
Lightning Experience Button to Open New Window
In Lightning Experience, the detail page button will open the URL in the same window (despite behaviour being set to Display in new window). The only solution I've found so far would be to use a Lightning Component as an Action, and in the init method, open a new window. This part is fine, but then if the user returns to the original window (record page), they will see the modal still open.
From what I've read so far, if I want to auto-close the modal (i.e. $A.get("e.force:closeQuickAction").fire()) I cannot do that in the init method, so I would have to call this asynchronously (e.g. https://salesforce.stackexchange.com/questions/189248/forceclosequickaction-not-working ).
Is this really the only way to accomplish this? It seems like an overly complicated implementation to do something which seems very trivial (open a new window).
-
- AndrewTaylor
- January 04, 2018
- Like
- 1
- Continue reading or reply
lightning experience rollout specialist - Challenge 8
Create custom text fields called Question and Answer. The Answer field must allow reps to include images and format text that they enter.I have fields Question (Text field: Question__c) and Answer (Rich Text Area: Answer__c) added to the Linked Article object.
-
- AndrewTaylor
- September 12, 2017
- Like
- 0
- Continue reading or reply
Mobile SDK - Registering for Push Notifications (iOS)
Push Messages are enabled in both apps, and we've been able to register using Android; however, using iOS, get the following error:
2017/07/14 16:14:23.205 AppName[698:2a07] ERROR com.salesforce: Registration for notifications with Salesforce failed with status 404 2017/07/14 16:14:23.206 VertexGPS[698:2a07] ERROR com.salesforce: Response:( { errorCode = "NOT_FOUND"; message = "The requested resource does not exist"; } )
Has anyone encountered this before? Could this be related to a configuration issue?
-
- AndrewTaylor
- July 14, 2017
- Like
- 0
- Continue reading or reply
Connected App Oauth Failed Login from Auth. Provider
We have a Connected App setup for Oauth to allow authentication to the community. However, if the Auth. Provider registration class can't create the user (e.g. unknown Contact record), an error is thrown, and no response is made to the callback URL. Is there a way to force this to happen?
-
- AndrewTaylor
- May 25, 2017
- Like
- 0
- Continue reading or reply
Salesforce Community - Remote Authorization login page cached
I'm testing out a Connected App with a Salesforce commmunity. I was using a custom login page (Visualforce), and have switched it off to the standard login page.
Viewing the Community directly (https://my-force-domain.com/mycommunity) returns the expected login page; however, when I go through an oauth url (https://my-force-domain.com/mycommunity/services/oauth2/authorize?response_type=token&client_id=<something>&redirect_uri=<something>) is still showing the Visualforce page.
Is there something I need to do to flush the cache?
-
- AndrewTaylor
- May 17, 2017
- Like
- 0
- Continue reading or reply
Testing Connected App with Community User
How can I test an Oauth 2.0 authorization for a Connected App for a Community User?
I've followed the directions at https://jdspaceit.wordpress.com/2016/09/26/using-postman-for-testing-salesforce-rest-apis/comment-page-1/ , which works fine for a standard login experience. However, trying to use my community url for the authorization and token ur (e.g. https://mycommunity.naXX.force.com/services/oauth2/authorize) just gives a non-descript error in Postman (Could not complete Oauth2.0 login).
-
- AndrewTaylor
- May 17, 2017
- Like
- 0
- Continue reading or reply
Push Notifications: Invalid connected application
Here's my trigger:
trigger ObjectTrigger on Object__c (after insert) { for (Object__c m : Trigger.new) { Messaging.PushNotification msg = new Messaging.PushNotification(); Messaging.PushNotification androidMsg = new Messaging.PushNotification(); Map<String, Object> payload = Messaging.PushNotificationPayload.apple('New Message: ' + m.Subject__c , '', null, null); Map<String, Object> androidPayload = new Map<String, Object>(); androidPayload.put('subject', 'New Message: ' + m.Subject__c); // Adding the assembled payload to the notification msg.setPayload(payload); androidMsg.setPayload(androidPayload); // Adding recipient users to list Set<String> users = new Set<String>(); users.add(UserInfo.getUserId()); // Sending the notification to the specified app and users. // Here we specify the API name of the connected app. msg.send('Test_App', users); androidMsg.send('Test_App', users); } } }When running a test method against this, I get an error at the line: "msg.send('Test_App', users);", with the error being:
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, MessageTrigger: execution of AfterInsert caused by: System.NoAccessException: Invalid connected application: Test_App Class.Messaging.PushNotification.send: line 28, column 1 Trigger.MessageTrigger: line 22, column 1: []
I do have a Connected App setup, but it's essentially a placeholder. Is there something that I need to explicitly configure in the Connected App for the Push Notifications to not error out?
-
- AndrewTaylor
- May 02, 2017
- Like
- 0
- Continue reading or reply
Managing Users and Multiple Auth. Providers
E.g. if I login using Facebook, then a week later, use Google (for argument's sake, let's say I forgot which one I'd used before), can the community or Registration handler be managed to autolink the Google account to the Facebook-generated User (e.g. by email address)?
-
- AndrewTaylor
- April 24, 2017
- Like
- 0
- Continue reading or reply
Visualforce Page "sforce.one.navigateToUrl is not a function"
The page works find with sforce.one.navigateToSObject(record.Id);, but the console throws an error saying "sforce.one.navigateToUrl is not a function" if I try to use sforce.one.navigateToUrl('/apex/mypage?param=' + myParamValue).
-
- AndrewTaylor
- April 11, 2017
- Like
- 0
- Continue reading or reply
Set Up Single Sign-On for Your Internal Users Challenge - Could not find SAML Enabled in your org's setup audit trail
Challenge Not yet complete... here's what's wrong: Could not find SAML Enabled in your org's setup audit trail. Make sure that you have 'SAML Enabled' checked under 'Federated Single Sign-On Using SAML' in your org's 'Single Sign-On Settings'.
I've reviewed the settings, and "SAML Enabled" is true, and I'm connected to the right org when doing the challenge. Has anyone else encountered this?
-
- AndrewTaylor
- January 19, 2017
- Like
- 3
- Continue reading or reply
Steelbrick API - Auto add product options?
I'm looking into the Steelbrick CPQ solution in Salesforce, and trying to determine if there's a way to auto-add product options to a quote through the API (i.e. avoid querying the object & records, and call an API method).
For example, if I have product A, with Product B, C and D setup to be required options, is there a way in the API to add Product A to a Quote, and have B, C, and D auto added w/o having to do additional queries on the data model?
-
- AndrewTaylor
- December 16, 2016
- Like
- 0
- Continue reading or reply
Deploying Object's Compact Layout Assignment
I'm retrieving my code through my IDE (Mavensmate) and deploying thorugh ANT scripts.
In retrieving the related metadata (I don't want the whole object, only the relevant changes), I get the following:
<?xml version="1.0" encoding="UTF-8"?> <CustomObject xmlns="http://soap.sforce.com/2006/04/metadata"> <compactLayouts> <fullName>Default</fullName> <fields>Name</fields> <fields>Field1__c</fields> <fields>Field2__c</fields> <fields>Field3__c</fields> <fields>Field4__c</fields> <label>Default</label> </compactLayouts> </CustomObject>
I can try manually adding compactLayoutAssignment, but worry about this disappearing every time I retrieve/refresh my project from the org. Is there a way I can cleanly configure my project so this is retrieved, and I can deploy w/o updating the xml beforehand?
-
- AndrewTaylor
- February 01, 2018
- Like
- 1
- Continue reading or reply
Org Default FlexiPage - How is this set in the MetaData API?
-
- AndrewTaylor
- January 18, 2018
- Like
- 1
- Continue reading or reply
Lightning Experience Button to Open New Window
In Lightning Experience, the detail page button will open the URL in the same window (despite behaviour being set to Display in new window). The only solution I've found so far would be to use a Lightning Component as an Action, and in the init method, open a new window. This part is fine, but then if the user returns to the original window (record page), they will see the modal still open.
From what I've read so far, if I want to auto-close the modal (i.e. $A.get("e.force:closeQuickAction").fire()) I cannot do that in the init method, so I would have to call this asynchronously (e.g. https://salesforce.stackexchange.com/questions/189248/forceclosequickaction-not-working ).
Is this really the only way to accomplish this? It seems like an overly complicated implementation to do something which seems very trivial (open a new window).
-
- AndrewTaylor
- January 04, 2018
- Like
- 1
- Continue reading or reply
Set Up Single Sign-On for Your Internal Users Challenge - Could not find SAML Enabled in your org's setup audit trail
Challenge Not yet complete... here's what's wrong: Could not find SAML Enabled in your org's setup audit trail. Make sure that you have 'SAML Enabled' checked under 'Federated Single Sign-On Using SAML' in your org's 'Single Sign-On Settings'.
I've reviewed the settings, and "SAML Enabled" is true, and I'm connected to the right org when doing the challenge. Has anyone else encountered this?
-
- AndrewTaylor
- January 19, 2017
- Like
- 3
- Continue reading or reply
Stuck - Learn Standard Open Redirect Preventions
The challenge is to submit a valid open redirect attack starting from the Standard Redirect Protections Challenge tab.
However, the links on this page are all to standard record pages, where the hack (e.g changing retURL to returl) won't work (it only works on VF pages).
Even if I attempt this and check the challenge, the error I get states: "It doesn't appear that you've successfully redirected to an external website using the Visualforce page. Please try again." - so it implies that it expects me executing this from a custom VF page.
Can anyone give me some advice on where I'm missing something on the challenge?
-
- AndrewTaylor
- December 07, 2016
- Like
- 1
- Continue reading or reply
External Objects (beta) - Can't Pass Id to VF page via button?
When I try to add a button to the standard page layout, I don't see a way to pass the record Id. If I try to use a URL for a custom button, I can't add any fields from my External Object (e.g. MyObject__x.Id). If I just use a Visualforce page, the record is not passed through in the link.
I realize this is in beta, so there might not be many people using this yet, but if anyone else is struggling with this, would be curious to hear.
-
- AndrewTaylor
- January 29, 2014
- Like
- 1
- Continue reading or reply
Javascript Remoting - Add "Accept-Encoding" to header
-
- AndrewTaylor
- January 14, 2014
- Like
- 1
- Continue reading or reply
Visualforce page for all Article Types
The client may add/remove article types over time, and I'm fairly new the Knowledge VF tags (though familiar with Visualforce itself). Is there a method for Knowledge to return the Article content w/o having to customize a Controller/VF page per article type?
-
- AndrewTaylor
- January 08, 2014
- Like
- 1
- Continue reading or reply
Sort KnowledgeArticleVersion by Custom Article Field
Has anyone found workarounds for this? I can't find a way to accomplish this since each article type ends up being a custom object (it looks like this is probably related, as it wouldn't be guaranteed the custom field exists on all custom article types).
-
- AndrewTaylor
- January 05, 2014
- Like
- 1
- Continue reading or reply
Test Methods - Can't retrieve data via SOQL after setting values in Trigger
I have some tests running for a Trigger (before insert), where I set some lookup fields (based on some logic from other fields).
Through debugging, I can see that the fields are set properly within my Trigger (let's call this field LookupField__c).
However, in my test class, if I query the inserted records [select Id, LookupField__c from Sobject where Id = :insertedRecord.Id], the LookupField__c is null (even though in the Trigger, I can see it was set).
The field is not touched anywhere else. Is there a reason I can't query on this in the Test Class? I could have sworn I used to be able to do this.
-
- AndrewTaylor
- June 04, 2012
- Like
- 1
- Continue reading or reply
Azure deployment failure
In one of our steps, we run the Salesforce deployment (validation only), but whether it is succsesful or not, the yaml file performs as a successful deployment.
if [ $(setvarStep.PullRequest) = 'true' ] then echo 'DevOps Message -- Validation in Progress - Non Feature branch behavior' npx sfdx force:source:deploy --checkonly --testlevel $(setvarStep.SalesforceTestLevel) --sourcepath $(salesforce.sourcepath) --targetusername $(salesforce.connectedApp.Alias) fi
I'm trying to catch this deployment now into a string, but unsure/unable to do a check to see if there's an error:
if [ $(setvarStep.PullRequest) = 'true' ] then echo 'DevOps Message -- Validation in Progress - Non Feature branch behavior' sfdxresult=$(npx sfdx force:source:deploy --checkonly --testlevel $(setvarStep.SalesforceTestLevel) --sourcepath $(salesforce.sourcepath) --targetusername $(salesforce.connectedApp.Alias)) if ($deploymentresult -like "*Component Failures*") then echo "found the error!" else echo "no error found!" fi fi
The above always writes "no error found!"
Any advice?
- AndrewTaylor
- December 23, 2019
- Like
- 0
- Continue reading or reply
SFDX Scratch Org and Permission Set License
To access this object, even as a System Admin deploying layout changes, the user seems to need the "Sales User" or "CRM User" permission set license, then a permission set enabling "Campaign Influence".
In my scratch org, I don't see either of these Permission Set Licenses available.
How can I access CampaignInfluence2 in a scratch org?
- AndrewTaylor
- August 20, 2019
- Like
- 0
- Continue reading or reply
Loading a Record using force.recordData targetFields
<aura:component implements="force:hasRecordId,flexipage:availableForAllPageTypes" access="global"> <aura:attribute name="record" type="Object"/> <aura:attribute name="fieldsToQuery" type="Object"/> <aura:attribute name="recordError" type="String"/> <force:recordData aura:id="recordLoader" recordId="{!v.recordId}" layoutType="FULL" targetRecord="{!v.record}" targetError="{!v.recordError}" targetFields="{!v.fieldsToQuery}" /> {!v.fieldsToQuery.Name} <br/> {!v.fieldsToQuery.MailingAddress}<br /> {!v.fieldsToQuery.MailingCity}, {!v.fieldsToQuery.MailingState} {!v.fieldsToQuery.MailingPostalCode}<br /> {!v.fieldsToQuery.MailingCountry} </aura>
In the above, the data does not render on the page; if I try to specifically set the fields in force:recordData, it doesn't help either. Is there something I'm missing on this?
- AndrewTaylor
- January 08, 2018
- Like
- 0
- Continue reading or reply
Lightning Experience Button to Open New Window
In Lightning Experience, the detail page button will open the URL in the same window (despite behaviour being set to Display in new window). The only solution I've found so far would be to use a Lightning Component as an Action, and in the init method, open a new window. This part is fine, but then if the user returns to the original window (record page), they will see the modal still open.
From what I've read so far, if I want to auto-close the modal (i.e. $A.get("e.force:closeQuickAction").fire()) I cannot do that in the init method, so I would have to call this asynchronously (e.g. https://salesforce.stackexchange.com/questions/189248/forceclosequickaction-not-working ).
Is this really the only way to accomplish this? It seems like an overly complicated implementation to do something which seems very trivial (open a new window).
- AndrewTaylor
- January 04, 2018
- Like
- 1
- Continue reading or reply
Force Lightning Data Service to load a specific record?
In this case, the id attribute is successfully being set, but LDS isn't loading the record. The error message says: The onBoatSelected handler in the BoatDetails controller must force Lightning Data Service to load the specified record, using logic in the controller.
In the controller, I'm using a reloadRecord command: component.find("service").reloadRecord() where "service" is the aura:id for the force:recordData element.
Is there some other command required to get the LDS to load the record?
Here's the component markup with the force:recordData info:
<aura:attribute name="id" type="String"/> <aura:attribute name="boat" type="Boat__c"/> <aura:attribute name="boatSimple" type="Boat__c"/> <aura:attribute name="recordError" type="String"/> <aura:handler event="c:BoatSelected" action="{!c.onBoatSelected}"/> <force:recordData aura:id="service" recordId="{!v.id}" mode="VIEW" fields= "Id, Name, Description__c, Price__c, Length__c, Contact__r.Name, Contact__r.Email, Contact__r.HomePhone, BoatType__r.Name, Picture__c" targetRecord="{!v.boat}" targetFields="{!v.boatSimple}" targetError="{!v.recordError}" recordUpdated="{!c.onRecordUpdated}" />Am I screwing up something in the markup?
- PatMcClellan__c
- November 15, 2017
- Like
- 0
- Continue reading or reply
lightning experience rollout specialist - Challenge 8
Create custom text fields called Question and Answer. The Answer field must allow reps to include images and format text that they enter.I have fields Question (Text field: Question__c) and Answer (Rich Text Area: Answer__c) added to the Linked Article object.
- AndrewTaylor
- September 12, 2017
- Like
- 0
- Continue reading or reply
Mobile SDK - Registering for Push Notifications (iOS)
Push Messages are enabled in both apps, and we've been able to register using Android; however, using iOS, get the following error:
2017/07/14 16:14:23.205 AppName[698:2a07] ERROR com.salesforce: Registration for notifications with Salesforce failed with status 404 2017/07/14 16:14:23.206 VertexGPS[698:2a07] ERROR com.salesforce: Response:( { errorCode = "NOT_FOUND"; message = "The requested resource does not exist"; } )
Has anyone encountered this before? Could this be related to a configuration issue?
- AndrewTaylor
- July 14, 2017
- Like
- 0
- Continue reading or reply
Push Notifications: Invalid connected application
Here's my trigger:
trigger ObjectTrigger on Object__c (after insert) { for (Object__c m : Trigger.new) { Messaging.PushNotification msg = new Messaging.PushNotification(); Messaging.PushNotification androidMsg = new Messaging.PushNotification(); Map<String, Object> payload = Messaging.PushNotificationPayload.apple('New Message: ' + m.Subject__c , '', null, null); Map<String, Object> androidPayload = new Map<String, Object>(); androidPayload.put('subject', 'New Message: ' + m.Subject__c); // Adding the assembled payload to the notification msg.setPayload(payload); androidMsg.setPayload(androidPayload); // Adding recipient users to list Set<String> users = new Set<String>(); users.add(UserInfo.getUserId()); // Sending the notification to the specified app and users. // Here we specify the API name of the connected app. msg.send('Test_App', users); androidMsg.send('Test_App', users); } } }When running a test method against this, I get an error at the line: "msg.send('Test_App', users);", with the error being:
System.DmlException: Insert failed. First exception on row 0; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, MessageTrigger: execution of AfterInsert caused by: System.NoAccessException: Invalid connected application: Test_App Class.Messaging.PushNotification.send: line 28, column 1 Trigger.MessageTrigger: line 22, column 1: []
I do have a Connected App setup, but it's essentially a placeholder. Is there something that I need to explicitly configure in the Connected App for the Push Notifications to not error out?
- AndrewTaylor
- May 02, 2017
- Like
- 0
- Continue reading or reply
Set Up Single Sign-On for Your Internal Users Challenge - Could not find SAML Enabled in your org's setup audit trail
Challenge Not yet complete... here's what's wrong: Could not find SAML Enabled in your org's setup audit trail. Make sure that you have 'SAML Enabled' checked under 'Federated Single Sign-On Using SAML' in your org's 'Single Sign-On Settings'.
I've reviewed the settings, and "SAML Enabled" is true, and I'm connected to the right org when doing the challenge. Has anyone else encountered this?
- AndrewTaylor
- January 19, 2017
- Like
- 3
- Continue reading or reply
Stuck - Learn Standard Open Redirect Preventions
The challenge is to submit a valid open redirect attack starting from the Standard Redirect Protections Challenge tab.
However, the links on this page are all to standard record pages, where the hack (e.g changing retURL to returl) won't work (it only works on VF pages).
Even if I attempt this and check the challenge, the error I get states: "It doesn't appear that you've successfully redirected to an external website using the Visualforce page. Please try again." - so it implies that it expects me executing this from a custom VF page.
Can anyone give me some advice on where I'm missing something on the challenge?
- AndrewTaylor
- December 07, 2016
- Like
- 1
- Continue reading or reply
Trailhead - System.QueryException: List has no rows for assignment to SObject
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.QueryException: List has no rows for assignment to SObject
Any advice? Or do I have to start a new DE org?
- Karyna Woods 18
- September 20, 2016
- Like
- 0
- Continue reading or reply
About SFPushNotificationManager Error "The requested resource does not exist"
I have done as Mobile SDK Guide said
- (void)application:(UIApplication*)application didRegisterForRemoteNotificationsWithDeviceToken:(NSData*)deviceToken
{
[[SFPushNotificationManager sharedInstance] didRegisterForRemoteNotificationsWithDeviceToken:deviceToken];
if ([SFUserAccountManager sharedInstance].currentUser.credentials.accessToken != nil) {
[[SFPushNotificationManager sharedInstance] registerForSalesforceNotifications];
}
}
- (BOOL)application:(UIApplication *)application didFinishLaunchingWithOptions:(NSDictionary *)launchOptions {
[[SFPushNotificationManager sharedInstance] registerForRemoteNotifications];
}
but the console print
ERROR|SFPushNotificationManager|Registration for notifications with Salesforce failed with status 404
and
ERROR|SFPushNotificationManager|Response:(
{
errorCode = "NOT_FOUND";
message = "The requested resource does not exist";
}
)
how to solve this problem?
- denny2
- April 12, 2016
- Like
- 0
- Continue reading or reply
Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash
I am preparing to move a webservice call that has been in testing in my sandbox environment and works as expected there. When I run the same call against my production environment I receive the following error:
Fatal error: Uncaught SoapFault exception: [sf:INVALID_SESSION_ID] INVALID_SESSION_ID: Invalid Session ID found in SessionHeader: Illegal Session. Session not found, missing session hash: <**HASH REMOVED**> This is expected, it can happen if the session has expired and swept away, or if the user logs out, or if its just someone trying to hack in.
The code is fairly simple - I am creating a connection with the PHP toolkit using the appropriately generated partner wsdl.jsp and logging in. I am able to log in but when I make the call to the webservice I am given the error above. Could this be an issue in the way the production org is set up or do I need to look elsewhere?
Code used to call the service is below. The error is thrown on $client->IsThisLiveProduct($valuearray);
$USERNAME = "USERNAME"; $PASSWORD = "PASSWORD"; $TOKEN = "TOKEN"; require_once ('/soapclient/SforcePartnerClient.php'); require_once ('/soapclient/SforceHeaderOptions.php'); $mySforceConnection = new SforcePartnerClient(); $mySoapClient = $mySforceConnection->createConnection("../forcecom2/soapclient/wsdl.jsp.xml"); $mylogin = $mySforceConnection->login($USERNAME, $PASSWORD . $TOKEN); $parsedURL = parse_url($mySforceConnection->getLocation()); define ("_WS_NAME_", 'WSNAME'); define ("_WS_WSDL_", _WS_NAME_ . '.xml'); define ("_WS_NAMESPACE_", 'http://soap.sforce.com/schemas/class/' . _WS_NAME_); // SOAP Client for Web Service $client = new SoapClient(_WS_WSDL_); $sforce_header = new SoapHeader(_WS_NAMESPACE_, "SessionHeader", array("sessionId" => $mySforceConnection->getSessionId())); $client->__setSoapHeaders(array($sforce_header)); // Call the web service $valuearray = array('SerialNumber'=>'SERIALNO'); $response = $client->IsThisLiveProduct($valuearray);
Thanks!
- Dan Cahill
- March 03, 2016
- Like
- 1
- Continue reading or reply
Calling the Google Search Appliance using Apex
Has anyone integrated with the Google Search Appliance from Salesforce? I see there is a connector, but it looks like its from the GSA to SFDC, not the other way around?
For example, if I wanted to write a wrapper utility to perform the search from Salesforce, and return the results styled in a VF page, is this a possiblity?
- AndrewTaylor
- December 01, 2015
- Like
- 0
- Continue reading or reply
How to Register Apple deviceToken to Salesforce without Using Salesforce Mobile SDK
We're creating a simple prototype that does not use the Mobile SDK. Only a couple of web services with OAuth.
However, we cannot figure out how we are going to register the Apple deviceToken in a web service without using the Salesforce Mobile SDK.
Has anyone done this?
Any help/answer will be highly appreciated.
Thanks. :)
- Divine Bendicion
- April 06, 2015
- Like
- 1
- Continue reading or reply
Datetime.format - Support Language?
When logged in as a French user, the Month format is not changed to a French abbreviation. Is there a way to accomplish this?
- AndrewTaylor
- February 05, 2015
- Like
- 0
- Continue reading or reply