DZone
Thanks for visiting DZone today,
Edit Profile
  • Manage Email Subscriptions
  • How to Post to DZone
  • Article Submission Guidelines
Sign Out View Profile
  • Post an Article
  • Manage My Drafts
Over 2 million developers have joined DZone.
Log In / Join
Refcards Trend Reports
Events Video Library
Refcards
Trend Reports

Events

View Events Video Library

Zones

Culture and Methodologies Agile Career Development Methodologies Team Management
Data Engineering AI/ML Big Data Data Databases IoT
Software Design and Architecture Cloud Architecture Containers Integration Microservices Performance Security
Coding Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks
Culture and Methodologies
Agile Career Development Methodologies Team Management
Data Engineering
AI/ML Big Data Data Databases IoT
Software Design and Architecture
Cloud Architecture Containers Integration Microservices Performance Security
Coding
Frameworks Java JavaScript Languages Tools
Testing, Deployment, and Maintenance
Deployment DevOps and CI/CD Maintenance Monitoring and Observability Testing, Tools, and Frameworks

How does AI transform chaos engineering from an experiment into a critical capability? Learn how to effectively operationalize the chaos.

Data quality isn't just a technical issue: It impacts an organization's compliance, operational efficiency, and customer satisfaction.

Are you a front-end or full-stack developer frustrated by front-end distractions? Learn to move forward with tooling and clear boundaries.

Developer Experience: Demand to support engineering teams has risen, and there is a shift from traditional DevOps to workflow improvements.

Related

  • Solid Testing Strategies for Salesforce Releases
  • Exploring Communication Strategies for LWC in Salesforce
  • Lightning Data Service for Lightning Web Components
  • Integrating Apex With Lightning Web Components

Trending

  • Enterprise-Grade Distributed JMeter Load Testing on Kubernetes: A Scalable, CI/CD-Driven DevOps Approach
  • KubeVirt: Can VM Management With Kubernetes Work?
  • Building Smarter Chatbots: Using AI to Generate Reflective and Personalized Responses
  • Resilience Pattern: Circuit Breaker

How to Resolve Some Salesforce Issues (Winter ‘18 Release)

If your team is having issues with the latest Salesforce release, this article of commonly reported issues may contain a solution.

By 
Ilya Feigin user avatar
Ilya Feigin
·
Feb. 05, 18 · Tutorial
Likes (6)
Comment
Save
Tweet
Share
6.0K Views

Join the DZone community and get the full member experience.

Join For Free

Like any large system, some issues may occur in Salesforce. In this article, we'll consider some of them along with solutions found by our Salesforce development team:

  • The difference between operating Lightning and Classic interfaces. Buttons, Links and Actions defined on the Layout page that are not displayed in the Lightning interface;

  • An issue with connection to Salesforce using SOAP, API, and WSDL files from a.NET project;

  • Visualforce page cannot perform the action on the controller after clicking the button linked to this action, if the page has unfilled required fields.

Difference Between Work of Lightning and Classic Interfaces

Salesforce has two different interfaces – Lightning and Classic:

LightningLightning
ClassicClassic


Each object on Salesforce has the ability to create its own Buttons, Links and Actions, that users can locate in the object’s layout page and use these on the Object edit page.

Object managerButtons, Links and Actions on Setup -> Object Manager


For the Classic version, this works as expected:

Account page on ClassicAccount page on Classic


But for Lightning, you cannot find these buttons and links:

Account page on LightningAccount page on Lightning


If you want to create the same button on the Lightning interface without programming, you can create Action or Global Action and bind this Action or Global Action to the object's Layout page.

For applying your own global actions for Lightning:

  • Click the icon on the “Salesforce Mobile and Lightning Experience Actions” section for an override default list of global actions;

  • Add your own global action to the list section “Salesforce Mobile and Lightning Experience Actions”.

Image title Layout with special Global Actions

An Issue With Connecting to Salesforce Using SOAP API WSDL File From.NET Project

Salesforce, like any large system, has a set of APIs — REST, SOAP, etc. At the moment (Winter’18 release), there is an issue when connecting to Salesforce from the.NET project using the SOAP API. The fact is that the WSDL file, received from the API page in the Setup menu, generates a runtime error when trying to connect to Salesforce:

Unable to generate a temporary class (result=1).
error CS0030: Cannot convert type 'xxx.Salesforce.ListViewRecordColumn[]' to 'xxx.Salesforce.ListViewRecordColumn'

WSDL API on Setup menuWSDL API on Setup menu


To solve this issue, you can modify your WSDL file. Add row:

<xsd:attribute name="tmp" type="xsd:string"></xsd:attribute>


to  complexType ListViewRecord .


As result you’ll get the following text:

<complextype name="ListViewRecord">
<sequence>
<element name="columns" type="tns:ListViewRecordColumn" minoccurs="1" maxoccurs="unbounded"></element>
</sequence>
<xsd:attribute name="tmp" type="xsd:string"></xsd:attribute>
</complextype>


This is how you handle the described issue.

Visualforce Page Cannot Perform the Action on the Controller After Clicking to the Button That Is Linked With This Action, If the Page Has Some Unfilled Required Fields

This issue occurs if we want to perform some action on the form on which the required field is located, by clicking the button. Suppose there’s a Visualforce page that allows you to create and edit the fields Account Name, Phone, Industry from the Account object. The Account Name field is a required field. Also on the form we have two buttons: "Save," to save the account and "Do Action" to perform any action (In our case, to write to the log).

Example of Visualforce pageExample of Visualforce page

To demonstrate an error create:

  • Visualforce page with the following code:

<apex:page controller="AddEditAccountCustomController" tabstyle="Account">
    <apex:form>
        <apex:pageblock mode="edit">
            <apex:pagemessages></apex:pagemessages>
            <apex:pageblocksection>
                <apex:inputfield value="{!Account.name}"></apex:inputfield>
                <apex:inputfield value="{!Account.phone}"></apex:inputfield>
                <apex:inputfield value="{!Account.industry}"></apex:inputfield>
            </apex:pageblocksection>
            <apex:pageblockbuttons location="bottom">
                <apex:commandbutton value="Save" action="{!save}"></apex:commandbutton>
                <apex:commandbutton value="Do Action" action="{!doAction}" rerender="block">
                     <apex:param name="newName" value="Test" assignto="{!paramValue}"></apex:param>
                </apex:commandbutton> 
            </apex:pageblockbuttons>
        </apex:pageblock>
    </apex:form>
</apex:page>
  • Custom Apex controller:

public class AddEditAccountCustomController {
    String paramValue;

    public Account account { get; private set; }

    public AddEditAccountCustomController() {
        Id id = ApexPages.currentPage().getParameters().get('id');
        account = (id == null) ? new Account() : 
            [SELECT Name, Phone, Industry FROM Account WHERE Id = :id];
    }

    public PageReference save() {
        System.debug('Save');
        try {
            upsert(account);
        } catch(System.DMLException e) {
            ApexPages.addMessages(e);
            return null;
        }
        //  After successful Save, navigate to the default view page
        PageReference redirectSuccess = new ApexPages.StandardController(Account).view();
        return (redirectSuccess);
    }

    public String getParamValue(){
        return paramValue;
    }

    public void setParamValue(String paramValue){
        this.paramValue = paramValue;
    }

    public void doAction() {
        System.debug('Account Name Before :'+ this.paramValue);
    }
}

When a user clicks the “Do Action” button while the “Account name” field is empty, the button doesn’t work properly.

To solve this issue we can use the Visualforce tag apex:actionRegion. An area of a Visualforce page that demarcates which components should be processed by the Force.com server when an AJAX request is generated. Only the components in the body of the apex:actionRegion are processed by the server, thereby increasing the performance of the page.

After solving the issue Visualforce page code looks like this.

<apex:page controller="AddEditAccountCustomController" tabstyle="Account">
    <apex:form>
        <apex:pageblock mode="edit">
            <apex:pagemessages></apex:pagemessages>
            <apex:pageblocksection>
                <apex:inputfield value="{!Account.name}"></apex:inputfield>
                <apex:inputfield value="{!Account.phone}"></apex:inputfield>
                <apex:inputfield value="{!Account.industry}"></apex:inputfield>
            </apex:pageblocksection>
            <apex:pageblockbuttons location="bottom">
                <apex:commandbutton value="Save" action="{!save}"></apex:commandbutton>
                <apex:actionregion>
                    <apex:commandbutton value="Do Action" action="{!doAction}" rerender="block">
                        <apex:param name="newName" value="Test" assignto="{!paramValue}"></apex:param>
                    </apex:commandbutton> 
                </apex:actionregion>
            </apex:pageblockbuttons>
        </apex:pageblock>
    </apex:form>
</apex:page>

In this article, we overviewed three Salesforce issues we encountered with in the Winter ‘18 release. We hope it will help you make your Salesforce projects better.

Lightning (software) Release (computing)

Published at DZone with permission of Ilya Feigin. See the original article here.

Opinions expressed by DZone contributors are their own.

Related

  • Solid Testing Strategies for Salesforce Releases
  • Exploring Communication Strategies for LWC in Salesforce
  • Lightning Data Service for Lightning Web Components
  • Integrating Apex With Lightning Web Components

Partner Resources

×

Comments

The likes didn't load as expected. Please refresh the page and try again.

ABOUT US

  • About DZone
  • Support and feedback
  • Community research
  • Sitemap

ADVERTISE

  • Advertise with DZone

CONTRIBUTE ON DZONE

  • Article Submission Guidelines
  • Become a Contributor
  • Core Program
  • Visit the Writers' Zone

LEGAL

  • Terms of Service
  • Privacy Policy

CONTACT US

  • 3343 Perimeter Hill Drive
  • Suite 100
  • Nashville, TN 37211
  • [email protected]

Let's be friends: