Manpreet Singh
IndividualForum Replies Created
-
Manpreet
MemberApril 25, 2018 at 10:35 am in reply to: Unable to see the inserted record without refreshing the detail page of a Salesforce OpportunityHi Aman,
It is a known issue to salesforce and possible it will be fixed in next few releases.As an alternative you can do the following :
VISUALFORCE PAGE :
-------------------<apex:page showHeader="true" standardController="Account" extensions="AccountController" sidebar="true">
<script type='text/javascript' src='/canvas/sdk/js/publisher.js'/>
<script src="https://mobile1.t.salesforce.com/soap/ajax/30.0/connection.js" type="text/javascript" />
<script>
function UpdateYourAcc() {
var accountId = document.getElementById('accountId').value;
Visualforce.remoting.Manager.invokeAction(
'{!$RemoteAction.AccountController.accountUpdateNumberField}', accountId,
function(result, event)
{
//if(result!=null) sforce.one.navigateToSObject(result,"detail");
Sfdc.canvas.publisher.publish({name: "publisher.close", payload:{ refresh:"true"}});
});
}
</script>
<input type="text" name="name" id="accountId" value="{!viewState.accountId}"/>
<a href="#" data-role="button" class="updateNotify" id="sendInvoicesMyself" onclick="UpdateYourAcc()">Update Account</a>
</apex:page>Thanks.
-
Manpreet
MemberApril 25, 2018 at 10:30 am in reply to: How to display Contact fields using fieldSets in Salesforce Lightning Components?Hi Anish,
You can do your implementation something like this :<aura:application >
<aura:attribute name="contact" type="Contact" default="{LastName: 'Smith'}"/>
<ul>
<li>LastName: {!v.contact.LastName}</li>
<li>Email: {!v.contact.Email}</li>
</ul><c:FieldSetForm
fsName="Contact_Field_Set"
typeName="Contact"
record="{!v.contact}"
/>
<button onclick="{!c.handleSave}">save</button>
</aura:application>FieldSetForm.cmp
----------------
<aura:component controller="FieldSetCtlr">
<aura:handler name="init" value="{!this}" action="{!c.init}" />
<aura:attribute name="record" type="Object" description="The record being edited"/>
<aura:attribute name="fsName" type="String"/>
<aura:attribute name="typeName" type="String"/>
<aura:attribute name="fields" type="Object[]"/>
<aura:attribute name="form" type="Aura.Component[]"/>
<aura:attribute name="inputToField" type="Map"/>
<p>
{!v.form}
</p>
</aura:component>FieldSetFormController.js
-------------------------({
init: function(cmp, event, helper) {
console.log('FieldSetFormController.init');
var action = cmp.get('c.getFields');
action.setParams({
fsName: cmp.get('v.fsName'),
typeName: cmp.get('v.typeName')
});
action.setCallback(this,
function(response) {
console.log('FieldSetFormController getFields callback');
var fields = response.getReturnValue();
cmp.set('v.fields', fields);
helper.createForm(cmp);
}
);
$A.enqueueAction(action);
},handleValueChange: function(cmp, event, helper) {
console.log('change');
var inputToField = cmp.get('v.inputToField');
var field = inputToField[event.getSource().getGlobalId()];
var obj = cmp.get('v.record');
if (!obj[field]) {
// Have to make a copy of the object to set a new property - thanks LockerService!
obj = JSON.parse(JSON.stringify(obj));
}
obj[field] = event.getSource().get('v.value');
cmp.set('v.record', obj);
}
})FieldSetFormHelper.js
---------------------({
configMap: {
'anytype': { componentDef: 'ui:inputText', attributes: {} },
'base64': { componentDef: 'ui:inputText', attributes: {} },
'boolean': {componentDef: 'ui:inputCheckbox', attributes: {} },
'combobox': { componentDef: 'ui:inputText', attributes: {} },
'currency': { componentDef: 'ui:inputText', attributes: {} },
'datacategorygroupreference': { componentDef: 'ui:inputText', attributes: {} },
'date': {
componentDef: 'ui:inputDate',
attributes: {
displayDatePicker: true
}
},
'datetime': { componentDef: 'ui:inputDateTime', attributes: {} },
'double': { componentDef: 'ui:inputNumber', attributes: {} },
'email': { componentDef: 'ui:inputEmail', attributes: {} },
'encryptedstring': { componentDef: 'ui:inputText', attributes: {} },
'id': { componentDef: 'ui:inputText', attributes: {} },
'integer': { componentDef: 'ui:inputNumber', attributes: {} },
'multipicklist': { componentDef: 'ui:inputText', attributes: {} },
'percent': { componentDef: 'ui:inputNumber', attributes: {} },
'phone': { componentDef: 'ui:inputPhone', attributes: {} },
'picklist': { componentDef: 'ui:inputText', attributes: {} },
'reference': { componentDef: 'ui:inputText', attributes: {} },
'string': { componentDef: 'ui:inputText', attributes: {} },
'textarea': { componentDef: 'ui:inputText', attributes: {} },
'time': { componentDef: 'ui:inputDateTime', attributes: {} },
'url': { componentDef: 'ui:inputText', attributes: {} }
},createForm: function(cmp) {
console.log('FieldSetFormHelper.createForm');
var fields = cmp.get('v.fields');
var obj = cmp.get('v.record');
var inputDesc = [];
var fieldPaths = [];
for (var i = 0; i < fields.length; i++) {
var field = fields[i];
var config = this.configMap[field.type.toLowerCase()];
if (config) {
config.attributes.label = field.label;
config.attributes.required = field.required;
config.attributes.value = obj[field.fieldPath];
config.attributes.fieldPath = field.fieldPath;
inputDesc.push([
config.componentDef,
config.attributes
]);
fieldPaths.push(field.fieldPath);
} else {
console.log('type ' + field.type.toLowerCase() + ' not supported');
}
}$A.createComponents(inputDesc, function(cmps) {
console.log('createComponents');
var inputToField = {};
for (var i = 0; i < fieldPaths.length; i++) {
cmps[i].addHandler('change', cmp, 'c.handleValueChange');
inputToField[cmps[i].getGlobalId()] = fieldPaths[i];
}
cmp.set('v.form', cmps);
cmp.set('v.inputToField', inputToField);
});
}
})
FieldSetCtlr.cls
----------------public class FieldSetCtlr {
@AuraEnabled
public static List<FieldSetMember> getFields(String typeName, String fsName) {
Schema.SObjectType targetType = Schema.getGlobalDescribe().get(typeName);
Schema.DescribeSObjectResult describe = targetType.getDescribe();
Map<String, Schema.FieldSet> fsMap = describe.fieldSets.getMap();
Schema.FieldSet fs = fsMap.get(fsName);
List<Schema.FieldSetMember> fieldSet = fs.getFields();
List<FieldSetMember> fset = new List<FieldSetMember>();
for (Schema.FieldSetMember f: fieldSet) {
fset.add(new FieldSetMember(f));
}
return fset;
}public class FieldSetMember {
public FieldSetMember(Schema.FieldSetMember f) {
this.DBRequired = f.DBRequired;
this.fieldPath = f.fieldPath;
this.label = f.label;
this.required = f.required;
this.type = '' + f.getType();
}public FieldSetMember(Boolean DBRequired) {
this.DBRequired = DBRequired;
}@AuraEnabled
public Boolean DBRequired { get;set; }@AuraEnabled
public String fieldPath { get;set; }@AuraEnabled
public String label { get;set; }@AuraEnabled
public Boolean required { get;set; }@AuraEnabled
public String type { get; set; }
}
}
Thanks. -
Hi Ranjith,
You need to use inner sub Query and perform your custom logic as per your requirement something like this :
for(Account acc : [SELECT Id, primary__c, (SELECT Id FROM Address__r ) FROM Account]){if((acc.primary__c == TRUE) && (acc.Address__r.size() > 0)){
acc.primary__c == FALSE;
}//Your custom logic
}Thanks.
-
Manpreet
MemberApril 16, 2018 at 12:06 pm in reply to: How to create one-way integration from WordPress to Salesforce?Hi Amresh,
WordPress to salesforce is supported using rest api. You can find developemt resources on wordpress.org. It has public api with Auth2 support.Basically you need an access_token with every request to get salesforce data. In order to obtain one, you need to first authenticate with your Salesforce organization. This can be done through OAuth, which is recommended way instead of hardcoding credentials.
You must create a 'Connected app' in salesforce by registering your wordpress application details. By doing so salesforce creates a Client ID and Client Secret for you application. When you first authenticate with salesforce, provide these 2 values along with the request. This will redirect you to Salesforce authentication page where, upon successful authentication, you will be redirected to a web page which you mentioned in 'redirectURI' parameter(This can be you initial page where you made the authentication request in you application).Once redirected, you'll have an additional parameter in the response, authorization code.
Thanks.
-
Manpreet
MemberApril 16, 2018 at 11:37 am in reply to: How to prevent a user from creating a new account in Salesforce?Hi rahul,
You can simply remove Create permission from Account Object on the profile of that user.
Thanks.
-
Hi Amresh,
You can create a custom pipe in a following manner :
import {
Pipe,
PipeTransform
} from '@angular/core';
@Pipe({
name: 'name of pipe used in markup'
})
export class NameofClass implements PipeTransform {
transform(value: string, args: string[]): any {
//Play with value and argument and return the result
return value;
}
}// This is just a sample script. Paste your real code (javascript or HTML) here.
if ('this_is' == /an_example/) {
of_beautifier();
} else {
var a = b ? (c % d) : e[f];
}Thanks.
-
Manpreet
MemberApril 16, 2018 at 6:32 am in reply to: I want that only my contact section will refresh when i click on delete buttonHi Raghav,
You need to use Rerender while pressing that Delete commandButton something like this :
<apex:commandButton value=”Delete” reRender=”a” action=”{!del}”/>
Thanks.
-
Manpreet
MemberApril 16, 2018 at 6:27 am in reply to: How to Recall the approval process using Salesforce Apex?Hi Rahul,
I know two workarounds but they're both terrible:
1 - Just reject the record and do it again.
2 - Give the ModifyAll permission for that object. This is generally a terrible idea as it shatters security models by giving admin-like powers not just to recall and reassign, but also approve your own changes.
I'm in full support of introducing this feature!
-
Manpreet
MemberMarch 23, 2018 at 11:45 am in reply to: How to write the Salesforce Trigger for a Custom Object's Attachment?Hello Pranav,
I think we should also add an event of after update as well in trigger because sometimes attachments can also be changed as per requirements. I think we should also focus on same.
Thanks,
-
Manpreet
MemberMarch 23, 2018 at 11:40 am in reply to: How to write the Salesforce Trigger for a Custom Object's Attachment?Hello Archit,
We cannot write the Triggers on Attachment object.
Create and schedule a batch process which will create the attachments in Attachments object.
Thanks,
-
Manpreet
MemberFebruary 15, 2018 at 4:09 pm in reply to: How to enable internal stylesheet for Salesforce Visualforce PDF page?Hi Pranav,
You can add tag in inside the apex pages applyHtmlTag=false.
Something like this :
<apex:page applyHtmlTag="false" >Thanks.
-
Manpreet
MemberFebruary 15, 2018 at 4:08 pm in reply to: How to add watermark in each page for Salesforce visualforce pdf page?Hi Pranav,
You will insert
<apex:page renderAs=""pdf"" standardStylesheets=""false"" applyHtmlTag=""false"" showHeader=""false"">
to top of the page.After that you will inert style inside the page.
<style>
@page {background-image: url('https://login.salesforce.com/img/logo198.png');
background-repeat: no-repeat;
background-position: center;}
</style>
Thanks. -
Manpreet
MemberFebruary 15, 2018 at 4:06 pm in reply to: What is the benefit of Salesforce Lightning design token?Hi Pranav,
Lightning design token are visual design for building a design for components or apps
Benefit : It use to margins and spacing, font sizes and families.Thanks.
-
Manpreet
MemberFebruary 15, 2018 at 4:05 pm in reply to: What is the different between router and route in Angular 2?Hi Pranav,
Router: Displays the application component for the active URL. Manages navigation from one component to the next.
Route: Defines an array of Routes, each mapping a URL path to a component.
Thanks.
-
Hi santosh,
In order to integrate salesforce with magento the steps are as follows :get the client--> get the seesion ID-- > and do the callouts:
Code:
$proxy = new SoapClient('http://magentohost/api/v2_soap/?wsdl');
// TODO : change url $sessionId = $proxy->login('apiUser', 'apiKey');
// TODO : change login and pwd if necessary $result = $proxy->salesOrderShipmentCreate($sessionId, '200000006', array('8', '1'), 'shipment comment'); var_dump($result);Apex Code:
HttpRequest req = new HttpRequest();
req.setEndpoint('callout:Magento_Admin');
req.setMethod('GET');
Http http = new Http();
HTTPResponse res = http.send(req);
System.debug('Response ===' +res.getBody());
System.debug('Response ===' +res.getstatusCode());This will give you a basic Idea on how to proceed.
Thanks. -
Hi sumanth,
You need to consider below parameters before developing a cpq:
1. Configuration: An ideal Combination of products and services is created
In the modern business environment of increasing product and deal complexity, identifying the right combination of goods and services to recommend to the customer is essential to winning the deal. By automatically providing these recommendations to your sales reps, you can ensure that all your sales reps become configuration experts – and sell like the top 20%.2. Pricing: Discounts, promotions and bundles are applied
In the Quote-to-Cash world, pricing refers to the set of rules that dictate how sales can best price a deal, and what incentives can be offered to customers to win deals.3. Quoting: A quote is generated, approved and sent to the customer
One of the most important cogs in your sales cycle, quotes are often the first impression you have on your customers. While presenting a quick and accurate quote can win you a deal, an error riddled and delayed quote can lose you a customer.4. Contract Creation: A contract or order form is created
All deals end with an agreement that includes a set of terms and conditions. These agreements carry a lot of risk, and can seriously impact your revenue streams. When it comes to protecting your business, the details matter. As contracts are created, it is important that the right people have visibility into built-in clauses (renewal and termination clause for example) to ensure security.5. Contract Negotiation: Contract terms and clauses are redlined and changed
If you have ever been involved in a contract negotiation, you know it is a living, and constantly changing document. Once you begin negotiations, it is critical to get detailed visibility into what is changing in your contracts as they go through multiple iterations.6. Contract Execution: An approved contract is signed and the deal is finalized
A significant roadblock in many company’s sales cycles, effective contract execution can drive deal acceleration. Enabling an E-signature tool can drastically reduce the time spent finalizing contracts.7. Order Fulfillment: The order is received, processed and delivered
Once the contract has been signed, operations jumps into gear to ensure that the right products are delivered to the right customers – in a timely manner. Having an integrated, visible system that provides one connected view of the customer can ensure that the changes to the order and requirements are reflected in the final product.8. Billing: Final charges are calculated and an invoice is sent to the customer
Accurate billing is critical to a successful company, as it determines cash flow, forecasting, and revenue recognition. Billing is easy with a seamlessly integrated Quote-to-Cash process – everything captured in the quote (details such as discounts, billing timeframes, etc) and the contract is automatically passed on to the finance team, guaranteeing accurate billing and renewal information.9. Revenue Recognition: Cash is received
Recognizing revenue incorrectly carries a lot of risk. When important details in your contracting terms – like pricing, net payment terms and delivery schedules – are made available to finance, your company will be more likely to recognize revenue correctly.10. Renewal: Manage customer retention and recurring revenue
Especially with the SaaS model, an enormous percentage of revenue comes in the form of repeat and subscription customers – so it is vital to stay on top of your contracts. With insights into your quotes and contracts, your business can effectively identify expiring contracts, upsell and cross-sell current customers, and reduce churn.Thanks.
-
Manpreet
MemberJanuary 31, 2018 at 10:12 am in reply to: Can I put external look up relation between external object and standard or custom object in Salesforce?Hi abhi,
You can create an Indirect Lookup Relationship for that.It links a child External object to a parent Standard or Custom object. External child object’s indirect lookup relationship field will be mapped to custom unique + external Id on parent object.
Now let us discuss in detail about indirect lookup relationship configuration with an example.
Below example shows an Order (External Child Object) associated with Account (Standard Salesforce Parent Object).
Thanks.
-
Manpreet
MemberJanuary 30, 2018 at 4:34 pm in reply to: Marketing Cloud - Send an email using A/B testing in Salesforce Exact TargetHi Shalini,
The A/B Testing feature does limit you to the selection of only one data extension. The most common workaround to this problem is to combine the segments together into one Data Extension in order to run the test.
Thanks.
-
Manpreet
MemberJanuary 30, 2018 at 4:32 pm in reply to: How can I create global utilities for a Lightning app under LockerService?Hi Tanu,
You can define your utilities in the helper method of a custom component CmpRoot, and make all your components inherit from CmpRoot so your utilities will be available directly from their helpers as they are inherited.
<component extends="c:CmpRoot">
</component>
Thanks.
-
Hi Sandra,
Not only does its Force.com platform provide development tools used by a large community of software vendors to ensure their products react as though they belong to the same family, it also serves up common objects, including customer, product, vendor and employee, which all software developers, including Cloud ERP system providers, should be using in their software solutions.
When built on salesforce.com’s Force.com platform, a Manufacturing Cloud ERP Solution includes out of the box integration with salesforce.com’s Sales cloud, Mobile accessibility, and can use Chatter as a key communication mechanism. These integrations provide a complete and flexible solution for manufacturers with shorter implementations, lower costs and quick return on investment. The seamless integration between such an ERP and Salesforce improves forecast accuracy and operational responsiveness to changing customer demand.
Thanks.
-
Manpreet
MemberJanuary 30, 2018 at 4:27 pm in reply to: How do you add Journey Builder contacts in a Salesforce campaign??Hi Radhakrishna,
You need to Create interaction and mapping Lead ID using the "assign to person on journey option".
Thanks.
-
Manpreet
MemberJanuary 30, 2018 at 4:24 pm in reply to: Create Streaming PushTopic using REST API in Salesforce?Hi Radhakrishna,
Yes, you can create a PushTopic via the REST API.
Based on the Create a Record example and PushTopic:
curl https://na1.salesforce.com/services/data/v32.0/sobjects/PushTopic/
-H "Authorization: Bearer token -H "Content-Type: application/json"
-d "@newpushtopic.json"
Request Body newpushtopic.json{
"Name" : "Account",
"Query" : "SELECT Id FROM Account",
"ApiVersion" : 32.0,
"NotifyForOperationCreate" : true,
"NotifyForOperationUpdate" : true,
"NotifyForOperationUndelete" : true,
"NotifyForOperationDelete" : true,
"NotifyForFields" : "All",
}Thanks.
-
Manpreet
MemberJanuary 30, 2018 at 4:22 pm in reply to: How to maintain state using transient keyword for List in Salesforce?Hi Subramanyam,
Using "transient" or "static" keyword to declare the list will not be transmitted as part of view state for Visualforce page hence it becomes null each time Visualforce Page gets Refreshed.
Remove that and you are ready to go.
[Static & Transient variables are not saved in the viewstate and hence are get lost after a http invocation]
Thanks.
-
Manpreet
MemberJanuary 30, 2018 at 4:18 pm in reply to: Salesforce Lightning migration from classic to lightningHi Louis,
There are no of reasons why You Should Consider Moving to Salesforce Lightning :
New UI: This new modern user interface not only looks new, but it is more flexible and dynamic than the original classic layout. Increase user productivity by decreasing toggle time between screens, allowing your team members to work more efficiently and speed up time to revenue with fewer clicks.
Lightning App Builder: With Lightning App Builder you can easily customize your Lightning pages with easy drag and drop configuration.
Sales Path: Sales Path allows you to define the key stages that a Lead or Opportunity needs to go through, and highlight the important fields per stage that a sales rep needs to complete.
Kanban View: Easily manage opportunities in the new Kanban view. This view shows up to four key fields on an opportunity and allows you to drag a record to the next stage.
Enhanced Reports, Charts, and Dashboards: Reports have a new design that look modern with enhanced functionality. You can even add reports to List Views! Dashboards also got a huge upgrade and are no longer restricted to three columns and will instantly refresh.
Salesforce Einstein: Salesforce has launched its newest feature called Einstein, an artificial intelligence (AI) tool to help determine companies be more predictive about their customers.
Thanks.
-
Manpreet
MemberJanuary 30, 2018 at 4:13 pm in reply to: what is technical name of 4501 certification?Hi adarsh,
There are no of reasons why You Should Consider Moving to Salesforce Lightning :
New UI: This new modern user interface not only looks new, but it is more flexible and dynamic than the original classic layout. Increase user productivity by decreasing toggle time between screens, allowing your team members to work more efficiently and speed up time to revenue with fewer clicks.
Lightning App Builder: With Lightning App Builder you can easily customize your Lightning pages with easy drag and drop configuration.
Sales Path: Sales Path allows you to define the key stages that a Lead or Opportunity needs to go through, and highlight the important fields per stage that a sales rep needs to complete.
Kanban View: Easily manage opportunities in the new Kanban view. This view shows up to four key fields on an opportunity and allows you to drag a record to the next stage.
Enhanced Reports, Charts, and Dashboards: Reports have a new design that look modern with enhanced functionality. You can even add reports to List Views! Dashboards also got a huge upgrade and are no longer restricted to three columns and will instantly refresh.
Salesforce Einstein: Salesforce has launched its newest feature called Einstein, an artificial intelligence (AI) tool to help determine companies be more predictive about their customers.
Thanks.