Laveena Agarwal
IndividualForum Replies Created
-
Laveena
MemberNovember 14, 2019 at 3:30 pm in reply to: To whom can a lightning for Outlook be assigned to in salesforce?Hi Laveena,
A lightning for Outlook can be assigned to Team and user in salesforce.
Thanks.
-
Hi Saddam,
Salesforce certificates and key pairs are used for signatures that verify a request is coming from your organization. They are used for authenticated SSL communications with an external web site, or when using your organization as an Identity Provider.
Thanks
-
Laveena
MemberOctober 16, 2019 at 1:48 pm in reply to: What is the difference between Streaming API PushTopic,Generic Streaming and Platform events ?Hi Prachi,
Very generally, the Streaming API was created primarily to update UI components(Source) where as Platform Events are for integrations via a Message Bus.
With a PushTopic from the Streaming API you are limited to receiving events notifications when the configured query and event occur. There is no capacity to manually generate these events beyond causing the criteria required by the query and event.
Generic Streaming via the Streaming API is similar to Push Topics but is not bound to specific changes to Salesforce data. Instead you control when to publish an event. The trade off is that the payload of the event is a 3000 character string rather than a defined structure like that of a PushTopic.
Platform Events provide the defined notification structure of a PushTopic with a more flexible model than Generic Streaming for raising and subscribing to the events. They can be published and subscribed to via Apex in addition to the APIs.
Thanks
-
Laveena
MemberOctober 11, 2019 at 1:16 pm in reply to: How can I determine whether a lead conversion was a merge to an existing contact or a new contact?Hi Deepak,
if (lead.IsConverted && !trigger.oldmap.get(lead.id).IsConverted) {
// process all merges that had to do with Contacts
if (trigger.newmap.get(lead.id).ConvertedContactId <> null) {if(trigger.newmap.get(lead.id).Status == '-Merge Contact') {
// Existing Contact
// Delete all existing Status Trackers for lead
leadIdsToDeleteStatusTracker.add(lead.id);
}
else {
// New Contact
// Get all existing Status Trackers for lead and migrate to new Contact id
leadIdContactIdToUpdateStatusTracker.put(
lead.id,
trigger.newmap.get(lead.id).ConvertedContactId
);
}
}}
Thanks
-
Laveena
MemberOctober 11, 2019 at 1:14 pm in reply to: Is it possible to have HTML in a visual force email template?Hi Deepak,
<messaging:emailTemplate subject="Sample Disbursement Receipt" recipientType="User" relatedToType="Call__c">
<messaging:htmlEmailBody >
<html>
<body>
Please find your sample drop receipt attached with this mail.
</body>
</html>
</messaging:htmlEmailBody>
</messaging:emailTemplate>Thanks
-
Laveena
MemberOctober 11, 2019 at 1:13 pm in reply to: Has anyone created a VF page which accepts value for a datetime field sepereately as date and time?Hi Deepak,
Date d=System.Today();
String sDate = String.valueOf(d);
string datime='13:00:00';
string stringDate=sDate+' '+datime;
System.debug('The concated String :'+stringDate);
Datetime myDate = datetime.valueOf(stringDate);
System.debug('The value of myDate'+myDate);Consider few points
1)Dont hard code in select option .Use Custom setting for Same .This will give flexibilty for admin to add or modify later
2)Even in Debug log you may see different time but yes no issues on that since it always shows in GMT and according to the local of the user value will be adjusted .
3)You can use standard date field for the user to allow select the Date.
Thanks
-
Laveena
MemberOctober 11, 2019 at 1:10 pm in reply to: What happens if I use HTML5 docType in Visualforce?Hi Deepak,
I haven't noticed anything amiss when using the HTML5 doctype. The whole reason was chosen in the first place is because it was the simplest doctype that would be rendered by browsers in standards mode. This means that html4 markup will display fine under html5. This does not mean that all will be rosy trying to get visualforce to play nicely with html5, as one of the links in your comments illustrate.
Thanks
-
Laveena
MemberOctober 11, 2019 at 1:09 pm in reply to: How to fetch record id using Salesforce instance URL address?Hi Deepak,
I guess you can use the string methods now to pull the ID.
BrowserURL=BrowserURL.right(15);//Pull from right the 15 digit Id
If your org is not update to winter 13 then you can use String.Split('/') and get the last array element value .Thanks
-
Laveena
MemberOctober 11, 2019 at 1:08 pm in reply to: Is is possible to display an image or icon in a Email using a Visualforce template?Hi Deepak,
<apex:image> tag or plain old <img>.
It cannot be an image from static resources though.
If you want to use image hosted in your salesforce, best would be to upload it to Documents and tick the "externally available image". And then remember to use full path: https://{instance id}.salesforce.com/servlet/servlet.ImageServer?id={document id}&oid={your org ig}
Thanks -
Laveena
MemberOctober 11, 2019 at 1:06 pm in reply to: Whats's the best way to “package” a Site that comes with a managed package?Hi Deepak,
That's the way that I usually do it, as long as the customer doesn't need to be able to customize the pages in the site. Adding a Visualforce page to a site also includes any Apex code and Visualforce components that it relies on.
I also include a setup guide as part of the package that walks the administrator through the site setup, especially if I'm expecting it to be installed by admins that are unfamiliar with this process.
Thanks
-
Laveena
MemberOctober 11, 2019 at 1:04 pm in reply to: How can I create a new line in a Visualforce CSV without using Apex code?Hi Deepak,
With no other answers posted, I'm afraid this may be the best that you're able to achieve.
There doesn't seem to be a clean way of doing this. I think the best way, is to use Apex, but, after experimenting there may be one extremely hacky way to achieve this. Based on your example of n at the beginning of the line forcing newLines, but also outputting the literal value, I tried a couple of things. First, at the beginning will force a newline, but also include a space in the first column, I couldn't find a way around this, so I just added a rowCount column, to force this newline.
<apex:page readOnly="true"
contentType="application/octet-stream#MyCsv.csv"
sidebar="false"
standardStylesheets="false"
showHeader="false"
cache="true"
expires="0"><!--
This will create a newLine, but will insert an empty space in the first column of every row.<apex:outputText value="Column 1,Column 2,Column 3"/>
<apex:outputText value="aVal1,aVal2,aVal3"/>
<apex:outputText value="bVal1,bVal2,bVal3"/>
<apex:outputText value="bVal1,bVal2,bVal3"/>
<apex:outputText value="bVal1,bVal2,bVal3"/>
<apex:outputText value="bVal1,bVal2,bVal3"/>
--><!--
Use a dummy "rowCount" column to still force a newline, but preserve the actual value (e.g., no uneccessary space)
and attempt to not lose too much value by having a somewhat not-useless column (debatable)
-->
<apex:variable value="{!1}" var="rowNum"/>
<apex:outputText value="Row,Column 1,Column 2,Column 3"/>
{!rowNum},<apex:outputText value="aVal1,aVal2,aVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/>
{!rowNum},<apex:outputText value="bVal1,bVal2,bVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/>
{!rowNum},<apex:outputText value="bVal1,bVal2,bVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/>
{!rowNum},<apex:outputText value="bVal1,bVal2,bVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/>
{!rowNum},<apex:outputText value="bVal1,bVal2,bVal3"/><apex:variable var="rowNum" value="{!rowNum+1}"/>
</apex:page>Thanks
-
Laveena
MemberOctober 11, 2019 at 1:02 pm in reply to: How to display the browser Current URL in Visualforce PageHi Deepak,
If your page is using a controller or extension (if it's not, just create an extension) then you should be able to get the URL you're after using the referer header for the Visualforce page.
Use the following method to get the URL:
public String getReferer()
{
return ApexPages.currentPage().getHeaders().get('referer');
}
Then you can just get this in your page using:<apex:outputText value="{!Referer}"/>
Thanks
-
Hi Saddam,
$A is known as the Aura object. Aura object is top level object in javaScript framework code.
Can be used with –
getBooleanValue
hasClass
isArray
isEmpty
isObject
isUndefined
isUndefinedOrNull
removeClass
toggleClassThanks
-
Laveena
MemberOctober 10, 2019 at 7:17 am in reply to: How to manage multiple currency conversion rate on daily basis in salesforce?Hi Prachi,
Your organization can set up the ability to use multiple currencies in opportunities, forecasts, quotes, reports, and other data.
- Enable multiple currencies for your organization.
- To designate your corporate currency, from Setup, enter Manage Currencies in the Quick Find box, then select Manage Currencies, and then click Change Corporate.
- To activate more currencies for your organization, click New in the Active Currencies related list.
- To use dated exchange rates, enable advanced currency management.
- Set conversion rates for new currencies. See Edit Conversion Rates. If you have enabled advanced currency management, see Editing Dated Exchange Rates.
Thanks
-
Laveena
MemberOctober 10, 2019 at 7:14 am in reply to: What is the relationship among product, pricebook and pricebook entry in salesforce?Hi Prachi,
PricebookEntry object is a product entry in apricebook. This object allows products to be linked to standard price book or custom price book. Oneprice book entry is linked to only one product. Oneprice book entry can only appear in one pricebook.
Thanks
-
Laveena
MemberOctober 10, 2019 at 7:13 am in reply to: Can I display the lightning component as a pdf?Hi Saddam,
There are two methods to show a PDF in Lightning Component:
First, you can create a Visualforce page and embed it in the Lightning component. See detailed example here
Second is, usage of PDF.JS library to directly use lightning component to display the PDF. See details here .Entire source code can be found here.Thanks
-
Hi Saddam,
To communicate between components that are not in the same DOM tree, we use a singleton library that follows the publish-subscribe pattern. ... Let's say, you have two components to a Lightning page in App Builder, then use the pubsub module to send events between them.
Thanks
-
Laveena
MemberOctober 9, 2019 at 2:00 pm in reply to: What is Component Events in salesforce lightning component?Hi Nikita,
Component Events are custom events in lightning framework. They can be handled by same component or a component that instantiates or contains the component. The component events can only be registered in child component and handled by parent component.
Thanks
-
Laveena
MemberOctober 9, 2019 at 1:58 pm in reply to: What is Application Events in salesforce lightning component?Hi Nikita,
- Application Events are custom events in lightning framework.
- They are handled by any component have handler defined for event.
- These events are essentially a traditional publish-subscribe model.
Thanks
-
Laveena
MemberOctober 7, 2019 at 12:43 pm in reply to: Can I store information even if the trigger throws an exception in salesforce?Hi Deepak,
As you've noticed if an apex script throws an unhandled exception everything it did is rolled back: @future, emails, DML, etc.
The good news is that there is a way to prevent a DML operation from succeeding without causing the whole apex transaction to be rolled back (except in the specific case mentioned below): the sObject.addError method. If you call this method on every sObject in your trigger it will prevent them all from being committed to the database, however any other DML operations you perform (that of course, do not cause errors in their own triggers) will be committed successfully.
If you're looking to log to a custom object this is your best bet; catch the exception, mark everything in Trigger.new with addError, then commit your log sObject.
EXCEPTION - To summarize the edits from subsequent contact with salesforce: this will not work if every record in the trigger has errors. In this case all work done in the trigger, including @future method calls, sending email, queueing batch jobs, or performing any DML, is rolled back.
I opened a Salesforce case with partner premier support (who actually troubleshoot apex issues!) #08522717. Salesforce claims this is working as designed, and pointed me to the wiki. Which seems to suggest that setting the all or nothing flag will impact this behavior but in my testing it didn't matter - if no DML rows commit without errors all operations are rolled back.
Thanks
-
Laveena
MemberOctober 7, 2019 at 12:41 pm in reply to: How to Search Workflow Rules or Validation Rules etc in Apex i.e. Metadata Search via Apex?Hi Deepak,
UPDATE: 11th Nov, I discovered the WorkflowRule (as apposed to the Workflow) metadata type! Combined with the ValidationRule metadata type. This means that the Metadata listMetadata API call now returns exactly the two lists you need to implement your search tool.
This will allow you to list the Validation Rules and Workflow Rules from Apex.
MetadataService.MetadataPort service = MetadataServiceExamples.createService();
List<MetadataService.ListMetadataQuery> queries = new List<MetadataService.ListMetadataQuery>();
MetadataService.ListMetadataQuery queryWorkflow = new MetadataService.ListMetadataQuery();
queryWorkflow.type_x = 'WorkflowRule';
queries.add(queryWorkflow);
MetadataService.ListMetadataQuery queryValidationRule = new MetadataService.ListMetadataQuery();
queryValidationRule.type_x = 'ValidationRule';
queries.add(queryValidationRule);
MetadataService.FileProperties[] fileProperties = service.listMetadata(queries, 25);
for(MetadataService.FileProperties fileProperty : fileProperties)
System.debug(fileProperty.fullName);Thanks
-
Laveena
MemberOctober 7, 2019 at 12:39 pm in reply to: What are the limitations on using a semi-join in a batch apex query locator in salesforce?Hi Deepak,
If the Detail__c part of this query exceeds your 100,000 rows, you will receive an exception, before you even try to receive the Master__c records. I'm not sure exactly what you're going for, but here are a couple of approaches:
Query on the Master object with a subquery on the related Details within the execute() method. You might run with a limit on the batch size if that is a safe way to limit how many Detail rows you'll receive. I have run this kind of process with as few as 1 records per batch.
Query on the Detail object but sort by Master Id, so you can finish and update objects as you go along. Implementing Database.stateful will allow you to keep a running tally of any incomplete objects between execute runs. This will eliminate the requirement that one Master object fit within the governor restrictions of one execute() mathod.Thanks
-
Laveena
MemberOctober 7, 2019 at 12:35 pm in reply to: How can I determine which salesforce org edition I am using ?Hi Deepak,
Navigate to Setup.
Type Company into the Quick Find box.
Click Company Information.
Your Salesforce Edition, along with your Organization ID and Instance will be listed in the right column.Thanks
-
Laveena
MemberOctober 7, 2019 at 12:34 pm in reply to: Is there a possibility for Run all tests (in target sandbox) before deployment ?Hi Deepak,
You can force a run of all tests when deploying using the Force.com migration tool which is a wrapper over Ant. Set runAllTests=true when deploying to simulate a production like deployment where all tests are run while deploying. To rollback if test classes fail, set the rollBackOnError deployment option to true.
Thanks
-
Laveena
MemberOctober 7, 2019 at 12:33 pm in reply to: How do I get information about the view state on a force.com site page in salesforce?Hi Deepak,
For pages that don't require customer portal authentication, you can access them through https://[instance].salesforce.com/apex/%5Bpage name]. This gives you the entire development mode footer.
I don't have a solution for pages that may require authentication with a specific user.
Thanks