• AndrewTaylor
  • NEWBIE
  • 143 Points
  • Member since 2010

  • Chatter
    Feed
  • 3
    Best Answers
  • 12
    Likes Received
  • 0
    Likes Given
  • 54
    Questions
  • 57
    Replies
Hello all, 

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? 

Ownership Edit Page

 

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?

 

 

field calendar

 

This is the calendar that I'd like to have in my VF page.

 

THANK YOU...

I have an pipeline running in Azure with a yaml file.

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?

 
For our project, we've setup Campaign Influence for Lightning Experience, which enables the CampaignInfluence2 object in the org.

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?

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.

I'm trying to deploy a new Report to a target org with a new folder, and keep getting the following error in my deployment:
 
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?



 
I've this error when deploying custom metadata: "Error: An object '<custom metdata>__mdt' of type 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/
I have a lightning component which calls an Apex method to initiate a Task:
 
@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.
 

I am trying to deploy default Compact Layout assignment to different sandbox environments. The layout deploys fine, but in the target destination, the assignment isn't updated (stays with System Default).

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?

 
How is the org default flexipage set in the metadata API? I can see how to do overrides for specific applications, but not how to set the Org Default itself.
I'm having difficulty using force:recordData to load some data for a record in a Lightning component.
 
<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?
I'm migrating an org from Classic to Lightning Experience, where the Detail page currently has a button that opens a Visualforce page (rendered as a PDF, e.g. /apex/myPdf?id={record.Id}) in a 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).
I'm currently getting the following error:
 
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. 
 
Our team is working on a mobile app for android and iOS. We have connected apps for both types of device, and are trying to get devices registered for Push Notifications.

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?
We have a Salesforce community setup with an Auth. Provider (Google). The custom class for the Auth. Provider will create a User record if the Auth. Provider returns a known contact (e.g. matching on email address).

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?

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? 

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).

 

I'm at the beginning of configuring a Trigger for Push Notifications. I don't have a the mobile app yet (being built by another team member), so I'm mainly putting it together, getting test methods running, etc.

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?
 
When setting up a community with multiple Auth. Providers (e.g. Facebook & Google), is there a way to link users together instead of creating separate user records?

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)?
I have a custom visualforce page that I'm trying to use sforce.one.navigateToUrl to redirect users to a custom VF page (e.g. /apex/mypage?param=12345).

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).

 
I'm trying to complete the "Set Up Single Sign-On for Your Internal Users" Trailhead challenge, and was able to execute the description of the challenge successfully. However, I'm getting the following error when checking the challenge on Trailhead:
 
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?

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?

I am trying to deploy default Compact Layout assignment to different sandbox environments. The layout deploys fine, but in the target destination, the assignment isn't updated (stays with System Default).

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?

 
How is the org default flexipage set in the metadata API? I can see how to do overrides for specific applications, but not how to set the Org Default itself.
I'm migrating an org from Classic to Lightning Experience, where the Detail page currently has a button that opens a Visualforce page (rendered as a PDF, e.g. /apex/myPdf?id={record.Id}) in a 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).
I'm trying to complete the "Set Up Single Sign-On for Your Internal Users" Trailhead challenge, and was able to execute the description of the challenge successfully. However, I'm getting the following error when checking the challenge on Trailhead:
 
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?
I'm currently stuck on the "Learn Standard Open Redirect Preventions" challenge of the "App Logic Vulnerability Prevention" module.

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?
I'm trying to use the new External Objects (beta), and have a custom VF page for the object.

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.
How would I add an "Accept-Encoding" header to Javascript Remoting so I can gzip the response?
I'm building a VF page that will print an Article from the Knowledgebase.

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?
I'm looking for a way to sort returned KnowledgeARticleVersion records sorted by a custom field on Article types.

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).

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.

 

I have an pipeline running in Azure with a yaml file.

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?

 
For our project, we've setup Campaign Influence for Lightning Experience, which enables the CampaignInfluence2 object in the org.

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?
I'm having difficulty using force:recordData to load some data for a record in a Lightning component.
 
<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?
I'm migrating an org from Classic to Lightning Experience, where the Detail page currently has a button that opens a Visualforce page (rendered as a PDF, e.g. /apex/myPdf?id={record.Id}) in a 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).
Cross-posting here from the Trailhead forum, where I'm working on the Lightning Components Framework SuperBadge. We're implementing LDS on a page, but NOT using force:hasRecordId. Instead, we're dynamically setting an aura:attribute, and then referencing it in the LDS parameter for recordId. I've been researching this for hours, but all the reference docs and Trailhead modules assume the case where you're using the implicit recordId on the page. No examples I can find where they're setting the recordId and then forcing the reload.

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? 

 
I'm currently getting the following error:
 
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. 
 
Our team is working on a mobile app for android and iOS. We have connected apps for both types of device, and are trying to get devices registered for Push Notifications.

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?
I'm at the beginning of configuring a Trigger for Push Notifications. I don't have a the mobile app yet (being built by another team member), so I'm mainly putting it together, getting test methods running, etc.

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?
 
I'm trying to complete the "Set Up Single Sign-On for Your Internal Users" Trailhead challenge, and was able to execute the description of the challenge successfully. However, I'm getting the following error when checking the challenge on Trailhead:
 
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?
I'm currently stuck on the "Learn Standard Open Redirect Preventions" challenge of the "App Logic Vulnerability Prevention" module.

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?
Trying to complete "Community Rollout Strategy" and Create Sharing Rules Unit. Everytime I click on "Check Challenge", I get this error: 

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? 
I want to achieve the message push function of salesforce on iOS,
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?
  • April 12, 2016
  • Like
  • 0
Hello,

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!

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?

Hi,

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. :)
I have an Apex routine that generates a formatted date for an Event, e.StartDateTime.format('MMM d, YY').

When logged in as a French user, the Month format is not changed to a French abbreviation.  Is there a way to accomplish this?