Parul
IndividualForum Replies Created
-
Parul
MemberSeptember 20, 2018 at 9:05 am in reply to: If We Deactivate The Workflow, Scheduled Actions Will Be Removed From Queue Or Not?I think after deleting it might be removed:
For example: There is a scenario
When a workflow rule that has time-dependent actions is triggered, use the workflow queue to view pending actions and cancel them if necessary.
To view pending actions:
Click Your Name | Setup | Monitoring | Time-Based Workflow.
Click Search to view all pending actions for any active workflow rules, or set the filter criteria and click Search to view only the pending actions that match the criteria. The filter options are:Workflow Rule Name: The name of the workflow rule.
Object: The object that triggered the workflow rule. Enter the object name in the singular form.
Scheduled Date: The date the pending actions are scheduled to occur.
Create Date: The date the record that triggered the workflow was created.
Created By: The user who created the record that triggered the workflow rule.
Record Name: The name of the record that triggered the workflow rule.
The filter is not case-sensitive. For more information on filters, see Entering Filter Criteria.
To cancel pending actions:Select the box next to the pending actions you want to cancel. Optionally, check the box in the column header to select all currently displayed items.
Click Delete.Hope this will help you
Thanks
-
Parul
MemberSeptember 20, 2018 at 1:24 am in reply to: Getting Uncommitted work pending Error in my Test classYou may try the following for System.CalloutException: You have uncommitted work pending. Please commit or rollback before calling out
@isTest
private class MyFunTest {
@isTest
static void runTest() {
Account a = new Account(name=’foo’);
insert a;Test.startTest();
Test.setMock(HttpCalloutMock.class, new MockHttpResponseGenerator());
MyCalloutClass.getInfoFromExternalService();
Test.stopTest();
}
} -
Parul
MemberSeptember 20, 2018 at 1:23 am in reply to: How to disable the Opening Sequence in Salesforce Lightning?We can not disable.
-
Parul
MemberSeptember 20, 2018 at 1:23 am in reply to: How to upload file using Salesforce Mobile SDK for Android?Hi,
Ok. I figured this out. First, create the parent object (the main form data) using the following.
request = RestRequest.getRequestForCreate(apiVersion, objectType, fields);
client.sendAsync(restRequest, new RestClient.AsyncRequestCallback() {...In the onSuccess method you will get the id of the new object from the response. There are plenty of examples that show how to get the JSON object and the id. Armed with this parentId we can now create the attachment. The code looks something like this.
private void postImageAsAttachment(String parentId, String title) {
Map<String, Object> fields = new HashMap<String, Object>();
fields.put("Name", title);
fields.put("ParentId", parentId);
fields.put("Body", ImageHelper.getBase64FromImage(mCurrentPhotoPath));RestRequest request = null;
try {
request = RestRequest.getRequestForCreate(apiVersion, "Attachment", fields);
} catch (Exception ex) {
Log.d(TAG, "sendRequest: ", ex);
Toast.makeText(MainActivity.this, "The file upload failed: " + ex.toString(), Toast.LENGTH_LONG).show();
}
client.sendAsync(request, new RestClient.AsyncRequestCallback() {...I'm using a simple class called ImageHelper that simply loads the image file, performs image compression (if necessary), and base64 encodes the image data. The result is that an "Attachment" object is created as a child of the parent object.
-
Parul
MemberSeptember 20, 2018 at 1:22 am in reply to: How to pass JavaScript variable value to Apex Controller?Hi,
Two ways are there:
- By using hidden field
- By using apex:param
Thanks
-
Parul
MemberSeptember 20, 2018 at 1:20 am in reply to: When bulk API is enabled what can be the limitations in dataloader?Hi,
Bulk API use is subject to the standard API usage limits. Each HTTP request counts as one call for the purposes of calculating usage limits.
-
Parul
MemberSeptember 20, 2018 at 1:19 am in reply to: Grouping records in a report on Visualforce pageHi,
Controller:
public class GroupingExampleController
{
private List<Account> allAccs {get; set;}
public List<GroupWrapper> groups {get; set;}
public String groupFieldName {get; set;}
public List<SelectOption> groupOptions {get; set;}public GroupingExampleController()
{
allAccs=[select id, Name, BillingStreet, BillingCity, BillingCountry, Type,
(select id, Name, Email, Phone from Contacts limit 5)
from Account
where Type != null
limit 10];
groupFieldName='Type';setupGrouping();
groupOptions=new List<SelectOption>();
groupOptions.add(new SelectOption('Name', 'Name'));
groupOptions.add(new SelectOption('BillingCity', 'BillingCity'));
groupOptions.add(new SelectOption('BillingCountry', 'BillingCountry'));
groupOptions.add(new SelectOption('Type', 'Type'));
}public PageReference regroup()
{
setupGrouping();
return null;
}private void setupGrouping()
{
Map<String, List<Account>> groupedMap=new Map<String, List<Account>>();
for (Account acc : allAccs)
{
String key=String.valueof(acc.get(groupFieldName));
if ( (null==key) || (0==key.length()) )
{
key='Undefined';
}
List<Account> groupedAccs=groupedMap.get(key);
if (null==groupedAccs)
{
groupedAccs=new List<Account>();
groupedMap.put(key, groupedAccs);
}groupedAccs.add(acc);
}groups=new List<GroupWrapper>();
for (String key : groupedMap.keySet())
{
GroupWrapper gr=new GroupWrapper();
groups.add(gr);
gr.accs=groupedMap.get(key);
gr.groupedVal=key;
}
}public class GroupWrapper
{
public List<Account> accs {get; set;}
public String groupedVal {get; set;}
public Integer count {get {return accs.size(); } set;}
}
}Visualforce page:-
<apex:page controller="GroupingExampleController" tabstyle="Account">
<apex:form >
<apex:pageBlock >
Group By: <apex:selectList value="{!groupFieldName}" size="1">
<apex:selectOptions value="{!groupOptions}" />
</apex:selectList> <apex:commandButton value="Go" action="{!regroup}"/>
<table border="0">
<apex:repeat value="{!Groups}" var="group">
<tr>
<td colspan="3"><b>{!groupFieldName}:{!group.GroupedVal}</b> - {!group.count} records</td>
</tr>
<apex:repeat value="{!group.accs}" var="acc">
<tr>
<td width="30px"></td>
<td colspan="2"><b>Account:</b>{!acc.Name}</td>
</tr>
<apex:repeat value="{!acc.Contacts}" var="cont">
<tr>
<td width="30px"></td>
<td width="30px"></td>
<td><b>Contact:</b>{!cont.Name}</td>
</tr>
</apex:repeat>
</apex:repeat>
</apex:repeat>
</table>
</apex:pageBlock>
</apex:form>
</apex:page>Thanks
-
Hi,
How are you calling this VF page?
Are you passing any Id? -
Parul
MemberSeptember 20, 2018 at 1:16 am in reply to: How to map JSON string with Salesforce object?Approach 1
Type resultType = Type.forName('CustomersResponse');
CustomersResponse deserializeResults = (CustomersResponse)JSON.deserialize(response, resultType);
System.debug('==========> deserialize() results = ' + deserializeResults);NOTE: With the above code, in theory, it is possible to use JSON.deserialize(response,CustomersResponse.class), however this does not always work. Sometimes Salesforce is unable to determine the type correctly and you receive a “variable does not exist : CustomerDetails.type” compile error message). So instead, you must first use a Type.forName() call to take care of this problem. Alternatively, you could compile all classes in your Salesforce Org together or define your class as an inner class of the class doing the deserialization work.
Approach 2
Type resultType = Type.forName('CustomersResponse');
CustomersResponse readValueAsResults = (CustomersResponse)JSON.createParser(response).readValueAs(resultType);
System.debug('==========> createParser().readValueAs() results = ' + readValueAsResults); -
Parul
MemberSeptember 20, 2018 at 1:15 am in reply to: How to map JSON string with Salesforce object?Hi,
Map<String, Object> m = (Map<String, Object>)JSON.deserializeUntyped(jsonInput);
Map<String, Object> m2=(Map<String, Object>)m.get('info5');
List<decimal> d=new List<decimal>();for(String s:m2.keyset()){
decimal t=(decimal)m2.get(s);
d.add(t);
} -
Parul
MemberSeptember 20, 2018 at 1:14 am in reply to: Can we use external storage to store attachments in Salesforce?Although it's not cheap or inexpensive, this might be an appropriate situation to consider implementing Lightning Connect which would use ODATA to connect with your NAS database that's external to Salesforce. Lightning Connect now has Read/Write capabilities and integrates very well with Salesforce. You'd get the benefits of the less expensive storage on your NAS yet still have seamless integration with Salesforce that would be transparent to your community users.
-
Hi,
You need a paid production license to log a case. It doesn't work with sandbox or developer licenses.
Thanks.
-
Hi,
String url="http://localhost:8080/safp/contacts/FirmAddress.do?btnAction=FirmAddress&firmId="+URLEncoder.encode("122379069","UTF-8")+"&strLocation="+URLEncoder.encode("!@#$%^&*()_+","UTF-8")+"&async=true&newAccID=112";
Use URLEncoder.encode()
-
Yes, you can display.
-
Hi,
Controller:-
public class CameraAccess{
public ContentVersion cont {get;set;}public CameraAccess() {
cont = new ContentVersion();
}public PageReference saveFile()
{
//PathOnClient is Mandatory
cont.PathOnClient = cont.title;//By default Origin value is "C" that means Content must be enabled in Org, so we need to explicitly set Origin as H
cont.Origin = 'H';
insert cont;//redirect to path where file is saved
return new PageReference('/'+cont.id);
}
}Visualforce Page:-
<apex:page controller="CameraAccess" standardStylesheets="false" showHeader="false">
<apex:stylesheet value="{!URLFOR($Resource.BootStrap3, '/bootstrap-3.1.1-dist/css/bootstrap.css')}" />
<div class="container">
<div class="row clearfix">
<div class="col-md-12 column">
<div class="jumbotron">
<h1> Camera Access in Visualforce using HTML 5 </h1>
<a href="https://jitendrazaa.com">https://jitendrazaa.com</a>
</div>
<div class="panel panel-warning">
<div class="panel-heading">
<apex:form>
<p>
<apex:inputFile value="{!cont.VersionData}" accept="image/*;capture=camera" filename="{!cont.Title}" />
</p><p>
<apex:commandButton StyleClass="btn btn-danger" action="{!saveFile}" value="Save File" />
</p>
</apex:form>
</div>
</div>
</div>
</div>
</div></apex:page>
-
Parul
MemberSeptember 20, 2018 at 1:05 am in reply to: How can we develop multi select datalist on the basis of different searches for different element searched for?Hi,
List<Account> accountList = new List<Account>();
List<Contact> contactList = new List<Contact>();for (Integer i = 0; i < 10; i++) {
accountList.add(new Account(Name = 'Boards Test Accout ' + i));
contactList.add(new Contact(
FirstName = 'Boards ' + i,
LastName = 'Test Contact'
));
}List<sObject> objects = new List<sObject>();
objects.addAll((List<sObject>)(accountList));
objects.addAll((List<sObject>)(contactList));insert objects;
-
Parul
MemberSeptember 20, 2018 at 1:00 am in reply to: How to deploy the Lightning components and Lightning Pages (Inside Community Builder) from Sandbox to Prod?Hi,
Step 1:
Use change sets to move all custom lightning components you are referencing in the community from the sandbox to production, as well as any metadata that you setup outside of the Community Builder (welcome email templates, workflow rules, profiles, permission sets, etc). If you skip this step, it will still allow you to deploy the community and will appear to be successful, but you will see an internal server error in the Community Builder and will not be able to make any updates until you have moved the missing components into production. I highly recommend creating a deployment template and filling it in as you build your community to ensure nothing is forgotten at the time of deployment; it is an important part of our methodology at Perficient and ensures smooth deployments.
Step 2:From your sandbox, navigate to the Site.com Studio and locate the toolbar. Click the arrow next to the widget icon and select to ‘Export This Site’ from the sandbox. Then go into production and create a new community, selecting the same version of the template; going from a Spring ’16 Napili template in sandbox and moving Winter ’16 production environment will not work. You need to go from Winter’ 16 in sandbox to Winter ’16 in production. All customization performed inside the Community Builder will move over.
Step 3:Go to the Community Management console and update your administrative settings, topics, moderation criteria, etc. as these do not carry over automatically.
-
Parul
MemberSeptember 20, 2018 at 12:54 am in reply to: How to implement VLookup in Salesforce formulas?VLOOKUP(field_to_return, field_on_lookup_object, lookup_value)
Searches an object for a record where the specified field matches the specified lookup_value. If a match is found, returns another specified field value.
-
Parul
MemberSeptember 20, 2018 at 12:53 am in reply to: Is there any way to validate UTF-8 in regex?Hi,
String FirstName = 'Parul';
Pattern regexPattern = Pattern.compile('^[\\p{L}\\. \'-]+$');
Matcher regexMatcher = regexPattern.matcher(FirstName);if (!regexMatcher.matches()) {
System.debug(LoggingLevel.Warn, 'No Matches');
} else {
System.debug(LoggingLevel.Debug, 'Matches');
} -
Parul
MemberSeptember 20, 2018 at 12:52 am in reply to: MetaData Api Call for Users with non-ModifyAllData PermissionHi,
The Wsdl2Apex based class will include some additional parts that identify the session.
There will be an inner class that contains the readMetadata method. It will probably be called something like MetadataPort or MetadataService. This class will include members like:
public soapSforceCom200604Metadata.SessionHeader_element SessionHeader;
private String SessionHeader_hns = 'SessionHeader=http://soap.sforce.com/2006/04/metadata';It SessionHeader here contains the active SessionId of the user who is making the request. If you replace the value with the SessionId of a user with the "Modify All Data" permission then the call should succeed.
The trick then becomes how does a non-admin user get a valid admin users session.
If you had access to the admin users credentials, say via a protected custom setting that is hidden in a managed package, then you could call the login method via the Partner API to get a valid session.
-
Parul
MemberSeptember 20, 2018 at 12:46 am in reply to: How can I use AngularJS on Visualforce page if I want to invoke a method of controller?Hi,
Here is the sample code:-
Visualforce page
<apex:page standardStylesheets="false" sidebar="false"
showHeader="false" applyBodyTag="false" applyHtmlTag="false"
docType="html-5.0" controller="AngularDemoController">
<html lang="en" ng-app="demoApp">
<head>
<meta charset="utf-8"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Angular Demo</title>
<link rel="stylesheet" href="<a class="vglnk" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.3.2/css/bootstrap.min.css"/" rel="nofollow"><span>https</span><span>://</span><span>maxcdn</span><span>.</span><span>bootstrapcdn</span><span>.</span><span>com</span><span>/</span><span>bootstrap</span><span>/</span><span>3</span><span>.</span><span>3</span><span>.</span><span>2</span><span>/</span><span>css</span><span>/</span><span>bootstrap</span><span>.</span><span>min</span><span>.</span><span>css</span><span>"/</span></a>>
<script src="<a class="vglnk" href="https://ajax.googleapis.com/ajax/libs/angularjs/1.3.11/angular.min.js" rel="nofollow"><span>https</span><span>://</span><span>ajax</span><span>.</span><span>googleapis</span><span>.</span><span>com</span><span>/</span><span>ajax</span><span>/</span><span>libs</span><span>/</span><span>angularjs</span><span>/</span><span>1</span><span>.</span><span>3</span><span>.</span><span>11</span><span>/</span><span>angular</span><span>.</span><span>min</span><span>.</span><span>js</span></a>"></script>
<script>
// define the app
var demoApp = angular.module('demoApp', []);
// add the controller
demoApp.controller('DemoCtrl', function ($scope) {
$scope.account = {!account}
$scope.contacts = {!contacts}
});
</script>
</head>
<body class="container" ng-controller="DemoCtrl">
<h1 style="color:Green">{{account.Name}}</h1>
<p class="lead" style="color:Gray">
{{account.BillingStreet}}<br/>
{{account.BillingCity}}, {{account.BillingState}}
{{account.BillingPostalCode}}
</p>
<b>Search</b> <input ng-model="query" /><br/><br/><table class="table table-bordered">
<tr>
<th>Name</th>
<th>Email</th>
<th>Id</th>
</tr>
<tr ng-repeat="contact in contacts | filter:query">
<td>{{contact.Name}}</td>
<td>{{contact.Email}}</td>
<td>{{contact.Id}}</td>
</tr>
</table>
</body>
</html>
</apex:page>Apex Class:
global with sharing class AngularDemoController {
// hardcode an account id for demo purposes
static String accountId = '00128000003u3uK';global static String getAccount() {
return JSON.serialize([select name, billingstreet,
billingcity, billingstate, billingpostalcode
from account where id = :accountId][0]);
}global static String getContacts() {
return JSON.serialize([select id, name, email
from contact where accountId = :accountId]);
}
} -
Parul
MemberSeptember 20, 2018 at 12:43 am in reply to: How can I get the developer trial version of wave analytics?Hi,
You need to get the Analytics license.
-
Parul
MemberSeptember 20, 2018 at 12:38 am in reply to: Splitting label values on '\n' is not getting same values on comparingHi,
> equals(stringOrId) Returns true if the passed-in object is not null and represents the same binary sequence of characters as the current string. Use this method to compare a string to an object that represents a string or an ID.
== is same as equalsIgnoreCase(secondString)
Returns true if the secondString is not null and represents the same sequence of characters as the String that called the method, ignoring case.
-
Parul
MemberSeptember 20, 2018 at 12:34 am in reply to: How can I use Custom Pagination in Salesforce?Hi,
Hi,
Add the below code to you Apex controller
public ApexPages.StandardSetController samplePagination{
get {
if(samplePagination== null) {
samplePagination= new ApexPages.StandardSetController(Database.getQueryLocator(<<Add your SOQl query here>>));
//set number of records you want to show on UI
samplePagination.setPageSize(5);
}
return samplePagination;
}
set;
}
// indicates whether there are more records after the current page set.
public Boolean hasNext {
get {
return samplePagination.getHasNext();
}
set;
}// indicates whether there are more records before the current page set.
public Boolean hasPrevious {
get {
return samplePagination.getHasPrevious();
}
set;
}
public ApexPages.StandardSetController samplePagination{
get
{
if(samplePagination== null)
{
samplePagination= new ApexPages.StandardSetController(Database.getQueryLocator(<<Add your SOQl query here>>));
//set number of records you want to show on UI
samplePagination.setPageSize(5);
}
return samplePagination;
}
set;
}
public void previous()
{
samplePagination.previous();
}
public void next()
{
samplePagination.next();
}
public Boolean hasNext
{
get{
return samplePagination.getHasNext();
}
set;
}
public Boolean hasPrevious
{
get
{
return samplePagination.getHasPrevious();
}
set;
}
Add the below code to your Visualforce page
<apex:panelGrid columns="8" id="<<your id>>">
<apex:commandLink action="{!previous}" rendered="{!hasPrevious}" rerender="{{Add the IDs which you want to rerender}}">
<apex:outputLabel value="<<Previous" style="font-weight: bold;"/>
</apex:commandlink>
<apex:commandLink action="{!next}" rendered="{!hasNext}" rerender="{{<<Add the IDs which you want to rerender}}">
<apex:outputLabel value="Next>>" style="font-weight: bold;"/>
</apex:commandlink>
</apex:panelGrid>
Let me know if you have any queries.
-
Hi,
You can use ERD Tool.