• AndrewTaylor
  • NEWBIE
  • 143 Points
  • Member since 2010

  • Chatter
    Feed
  • 3
    Best Answers
  • 12
    Likes Received
  • 0
    Likes Given
  • 54
    Questions
  • 57
    Replies
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?
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?