• sfdcsushil
  • NEWBIE
  • 255 Points
  • Member since 2011

  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 19
    Questions
  • 177
    Replies
HI all, 
Request you to give a detaild explanation... if possible provide any snippet code. thanks 

i am keep on hitting while deploying classes into production  Organigaion code coverage is 45%. 
I noticed that some classes and triggers have 0% code coverage. 

1.How it could be possible to deploy a calss having 0% code coverage??. 
2. there is no test classes for few classes.. How it could be possible? 
3. for few classes have hidden code... how to sort out managed packes code coverage problem??
4. unmanaged packages have test classes and methods  in the apex class?? ... does it creating 0% code coverage issue to the classes?? 
 
Hi, 
 I'm new to visualforce and was wondering if the following is possible:

I would like to create a tab for "Important accounts" and be able to view 5 different accounts with ONLY their asset related lists. 
so when I click on the tab I want to see: 

Account 1
Asset related list for account1
Account 2 
Asset related list for account2
....
  • August 15, 2016
  • Like
  • 0
Hi, 

I reached out to regular support and they directed me here. We would like to secure force.com with SSL. I issued the certificate but we just need it signed. How do I go about doing this? 
I'm new to Apex and need help with writing a trigger that when there a new user is created or modified that they are added to a chatter group called "All Group" or Group ID. Any help is appreciated.
  • January 07, 2016
  • Like
  • 0

I am trying to use a custom button w/ JavaScript to execute a record update for users who would otherwise not be able to edit the record, due to permissions and record sharing.  However, when I click the button as a user without the proper edit rights on the record, nothing happens (except the page reload).  It works just fine when logged in as SysAdmin.
Is it possible to get the javascript to execute without regard to the logged in user's edit rights on the record?  If so, what am I missing?  Code is below:

{!REQUIRESCRIPT("/soap/ajax/34.0/connection.js")} 
var newRecords = []; 
var c=new sforce.SObject("Contact"); 
c.id="{!Contact.Id}"; 
c.Referral__c="True"; 
newRecords.push(c); 
result=sforce.connection.update(newRecords); 
window.location.reload();

 I was able to complete a trigger... athe only problem is, it doesn't actually show the commissions! I can tell the trigger is firing but nothing happens! 

 

Here's the much cleaned up trigger:

 

trigger GenerateCommission on Revenue_Event__c (after insert) {

 

list <Account> CommissionList = new list<Account>([SELECT Id,

(SELECT id, Sales_Agent__C FROM Commission_Calculations__r WHERE Active__c = TRUE)

FROM Account where Id IN :Trigger.newMap.keySet() ]);

 

List<commission_Calculation__c> FinalCommissions = new list<Commission_Calculation__c>{};

 

For (Revenue_Event__c NewRevenueEvent : Trigger.new){

 

for(Account j: CommissionList){

for(Commission_Calculation__c cc : j.Commission_Calculations__r){              

              Commission__c NewCommission = new Commission__c();

              NewCommission.Revenue_Event__c = NewRevenueEvent.id;                      

              NewCommission.Sales_Agent__c = CommissionList[0].Commission_Calculations__r.get(0).Sales_Agent__c;

              NewCommission.Commission_Percentage__c = CommissionList[0].Commission_Calculations__r.get(0).id;

              FinalCommissions.add(cc);           

            }    

 

 

       }

Insert  FinalCommissions;

}

 

 

I can't figure out why the trigger seems to fire, but doesn't update the commissions. 

Please help, and thanks!

 

Hi ,

 

I have added a Custom Object in Production and using trigger i have added some values in to this Custom Object. But how can i see these Object values. In report also it does not show this Custom Object.

 

Please help

 

Thanks and regards

Hari G S

Hello, 

As per documentation, SF:bulkRetrieve command can be used to retrieve all reports in bulk(Link below). 

https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_retrieve_bulk.htm?search_text=Report

When i try retrieving the reports, it gives me following message  - 

[sf:bulkRetrieve] Total number of items to be retrieved for Metadata type 'Report' = 0

But we do have more than 30,000 reports in system. Any idea why would it throw the message? 
Hello,

I have some code which creates a  task for one user when an opportunity is created. during creation of tasks, i am setting up the Email header for sending emails. But emails are not being sent for some reason.

Code Snippet - 
          Database.DMLOptions dml = new Database.DMLOptions();
          dml.emailHeader.triggerUserEmail = true;
          database.insert(lstTasks, dml);

Can someone provide some pointers for fixing this issue. Thanks in Advance. 
Hello,

I am using below code for setting Cookie in HTTP callout , Looks like its not working. 
Is my code correct? 

HttpRequest req = new HttpRequest();
req.setMethod('GET');
req.setHeader('Cookie', 'Name=Value');

Regards,
Sushil


When we add additional attendees to Event, It creates a event for additonal attendee in the background as child event.

But when the other person declines the request, event gets deleted. But this deletion of child event is not firing the triggers.

Anyone has experienced this before??

Hello,

 

We want to implement Basic auth in external SOAP call. Can anyone help us with best practices for Storing Passwords in SFDC. 

 

Regards,

Sushil

Hi,

 

Can someone give me some pointers on implementing token based authentication while making a SOAP web service callout from salesforce.

 

Regards,

Sushil

I am creating a custom clone button. If user is trying to clone a record which has record type for which he does not have access, i want dont want to pass record type id to url.

 

Please let me know how can we check in javascript if user has access to particular record type.

Hi,

 

Has anyone done integration of Salesforce with any other Application using MQ as Middleware. I could not find any documentation on this. Please provide some pointers.

 

Thanks,

Sushil

Hi All,

 

Is it possible to remove Edit button on Mini Page Layout? Please let me know.

 

Thanks.

 

Hi,

 

We have requirement as follows:-

 

When a custom object is updated, A trigger logic will query another custom object which has got around 0.15 million records(150000). The query will have filters on 2 text fields.

 

Now if lets say we load data in first custom object using data loader which contains around 10,000 records. Trigger will fire in chunks of 200. And it will query second object with some filters and then populate first custom obect with data from second.

 

I just want to understand what would be best approach here, Keeping in mind the no of records that are present in the second object.

 

1. Keep the logic in Trigger

2. Move that whole logic inside a batch class.

 

Please provide your inputs.

 

Hi,

 

I dont want some users to search on Tasks and Events. How can i remove Task and Event from Sidebar Search?

 

Please suggest.

 

Thanks in Advance.

Hi,

 

I have a requirement where i need to populate Lead source field based on the URL of website from which Lead was generated. Please let me know if there is a way if we can get that URL?

I know one way of identifying Lead Source is adding hidden field in the Web to Lead form page.

Please suggest.

 

Thanks.

 

Hi All,

 

We have a Jquery datepicker included in our visualforce page. We want to reload/refresh this datepicker when some field changes on the page. Please suggest if there is any way to accomplish this?

Hi,

 

We have an Apex Component(has one Controller attached to it) included in the Visualforce page. We want to get it refreshed when one User lookup is populated on the Visualforce Page. Please suggest if there is a way to accomplish this.

We had tried page reload. But that leads to Data being blanked out on the page. Is there any clean way to do it?

 

Hi,

 

Can anybody suggest some way of comparing profiles aprat from Enhanced Profile management, which has its limits.

 

Thanks,

Sushil

Has anybody retrieved and parsed the profiel information in JAVA using Meta Data API of Salesforce? Please give some suggestions?

Is there a option to use Metadata API within Salesforce? If yes, Please give some documentation or relevant code.

 

Thanks.

Hi,

 

Can anybody tell me the licensing cost assocociated with Social Contacts, Salesforce CRM Content and Salesforce Answers. 

 

Thanks

Sushil

Hi All,

I am displaying the list of records using datatable but values not displaying correctly under column name. 

Image:
User-added image

Adv Thnx,
Regards,
VSK98
  • November 24, 2018
  • Like
  • 0

Hi All 
New to SOQL wanted a little help so I can move forwards. 
I have a Master object called Application and 2 CHILD objects associated by MD (master detail)
1. Funding
2. Supplier
I want to fetch records from both related lists via a SOQL query. 
Its giving me a parsing error. Im not sure on the exact syntax to query for multiple related objects where both are Master detail. I tried following the blog by a SF MVP, but attempt was futile. Please can a developer help with this very simple query (for a dev of course)

http://www.sfdc99.com/2013/06/24/example-how-to-write-a-cross-object-soql-query-part-2/

SELECT Id, Name, Minimum_Amount_Required__c , Case_Worker__c, 
   (SELECT Funding_Amount__c FROM FROM Funding_Company__r),
   (SELECT Name, RecordTypeId FROM Supplier__r WHERE RecordTypeId = '012240000005vya')
   FROM Application__c
   WHERE Status__c='Surveyors'

  • February 01, 2018
  • Like
  • 0
HI all, 
Request you to give a detaild explanation... if possible provide any snippet code. thanks 

i am keep on hitting while deploying classes into production  Organigaion code coverage is 45%. 
I noticed that some classes and triggers have 0% code coverage. 

1.How it could be possible to deploy a calss having 0% code coverage??. 
2. there is no test classes for few classes.. How it could be possible? 
3. for few classes have hidden code... how to sort out managed packes code coverage problem??
4. unmanaged packages have test classes and methods  in the apex class?? ... does it creating 0% code coverage issue to the classes?? 
 
Hi All!

We have a trigger to prevent users from deleting events in salesforce:

Trigger PreventDelete on Event (before delete)

{Profile adminId = [SELECT Id from Profile where Name='System Administrator' LIMIT 1];if(System.Trigger.IsDelete && UserInfo.getProfileId() != adminId.Id)
      {
    for(Event tsk : Trigger.old)
    {
      tsk.addError('Meetings can not be deleted.  Please mark as Cancelled or reschedule to a different day/time.');
    }
 }
 }

But I cannot deploy it because it has 0% code coverage.  I am guessing I need a test class but do not know how to do that.  Can anyone help?  Thanks!
I'm facing a weird issue when a datetime is converted to date between midnight and 1 AM ET (Eastern Time). We're facing the issue after the day light saving which is post 12th March 2017.

We're fetching the current date and time using system.now() method. The datetime is returned in GMT timezone.

If the current datetime is 3/21/2017 12.15 AM, then the GMT returned by the system.now() mehtod is 4.15 AM. 4 hours are added in the time since, ET is 4 hours behind GMT.

Now, we're making use of the DateTime class's instance method, format('EEE') to get the current day. For the stated date in the example, the day comes out to be Tuesday. Based on this day, we've some calculations which determine the number of days to be subtracted from the datetime instance.

Suppose, it is determined that we want to subtract 2 days and get the date. After subtracting 2 days from the datetime 3/21/2017 12.15 AM, we're getting datetime as 3/19/17 12.15 AM.

We want the date component from this datetime, hence are making use of the DateTime class' instace method date() to fetch the date. But, the datetime is converted to date, it is returning 3/18/2017 instead of 3/19/2017. The date() method returns date in local timezone and I believe that when the datetime is converted to date, the date is getting calculated by subtracting 5 hours instead of 4 hours to get the date in local timezone which is ET.

Any help regarding understanding the reason behind this will be much obiliged. Thanks in advance!
Hello, 

As per documentation, SF:bulkRetrieve command can be used to retrieve all reports in bulk(Link below). 

https://developer.salesforce.com/docs/atlas.en-us.daas.meta/daas/forcemigrationtool_retrieve_bulk.htm?search_text=Report

When i try retrieving the reports, it gives me following message  - 

[sf:bulkRetrieve] Total number of items to be retrieved for Metadata type 'Report' = 0

But we do have more than 30,000 reports in system. Any idea why would it throw the message? 
I would like to use an existing Email Alert in an Apex class.
I do not want to simply send an email from the class.

The reason is that Administrators will want to change recipients and/or templates, and they should be able to do so using clicks, not code.

Is this possible?
I start working with SFDC's triggers since a little bit, what I noticed that triggers on object OpportunityContactRoles are not allowed, are there any way to use fire a trigger when an end-user add a contact to an opportunity.My requirement, is to catch the event when an end-user attach a contact to a given opportunity, thenbased on the data in the contact itself I'll update some properties in the opportunities.
Any help is appreciated  
Hi Team,
   I am new to salesforce development. As per my current project requirement, we were dealing with Case object. And I was getting Case details, case comments using SOQL. But now I want to use DML to update Case attribute. Can you please guide me for the dependencies(jar maven repo link) I need to include in my project.
I have a code to attach files greater than 25MB. but the problem is i can't able to save/view the Attached document by using of chatter:feed tag in VF page. The error I got is, chatter:feed should not be used under form tag. Is there any other solution to use Chatter:feed in VF page? kindly Suggest any option is available.
We have encountered a strange issue in a customer Sandbox. A VF homepage component generates relative URLs, but in other orgs it generates absolute URLs. Is this an internal defect, or is it a configuration that we don’t know about?

In the sandbox is a Visualforce homepage component based on a simple custom VF page. This component is added to the left sidebar in classic SF UI. It works fine on standard pages and on other custom VF pages.
BUT when we try to open a VF page from any AppExchange package, the sidebar component fails and we see the “URL No Longer Exists” error inside it. 
We analyzed the HTML-code in a browser and found that it fails because Salesforce does not use the correct URL for an iframe which is generated for the home page component.
Pages from AppExchange packages are based on a specific domain name (unique for every package). Example of a page from the "mea" package:
https://mea.cs52.visual.force.com/apex/MassEditAllActivities
In the defective sandbox, Salesforce generates the following iframe for a sidebar component (NOTE that it uses a relative URL):
<iframe frameborder="0" id="contentPane"
   onload="initContentFrame('/apex/MyCustomPage, true, false , https://cs52.salesforce.com' );"
   src="/blank.html" style="width: 100%; height: 100%">
</iframe>
As a result, a browser tries to open the following URL in the iframe:
https://mea.cs52.visual.force.com/apex/MyCustomPage
Since the custom page is not a part of the MEA package this URL does not work.

In all other orgs where we tried to reproduce this issue, Salesforce generates absolute URLs for the same iframes and they work good:
<iframe frameborder="0" id="contentPane"
   onload="initContentFrame('https://na14.visual.force.com/apex/MyCustomPage, true, false , 'https://na14.salesforce.com' );"
   src="/blank.html" style="width: 100%; height: 100%">
</iframe>

Other AppExchange packages cause this same issue in this sandbox, but work correctly in other orgs. 
Why would Salesforce generate incorrect URLs only in this sandbox?
Hi, 
 I'm new to visualforce and was wondering if the following is possible:

I would like to create a tab for "Important accounts" and be able to view 5 different accounts with ONLY their asset related lists. 
so when I click on the tab I want to see: 

Account 1
Asset related list for account1
Account 2 
Asset related list for account2
....
  • August 15, 2016
  • Like
  • 0

Hi there,

Is it possible to prevent user with 'Customer Community User' profile to access the  '_ui/search/ui/UnifiedSearchResults' page via our Community site?

Thank you

Hi,

 

We have an Apex Component(has one Controller attached to it) included in the Visualforce page. We want to get it refreshed when one User lookup is populated on the Visualforce Page. Please suggest if there is a way to accomplish this.

We had tried page reload. But that leads to Data being blanked out on the page. Is there any clean way to do it?

 

Hi,
i would like to know what would be the best way to modify data of my Salesforce account.

I've read things about Apex class, but im not sure if this is required.
Basically I want to use built in REST endpoints of Salesforce from my external application written in Java to post data to the salesforce system.

Has anybody done that before and where can I find documentation about REST endpoints of salesforce.

Thanks,
Detlef
I am trying to figure out how to work with the Marketing Cloud API and am not having much luck (documentation here: https://developer.salesforce.com/docs/atlas.en-us.mc-apis.meta/mc-apis/index-api.htm).  The web service URL I used was https://webservice.test.exacttarget.com/Service.asmx.  Here is my code (mostly copied from the "starter kit" example code):
            m_Client.ClientCredentials.UserName.UserName = "david.brink@nau.edu.dv";
            m_Client.ClientCredentials.UserName.Password = "passw0rd";

            //Local variables
            APIObject[] Results;
            String requestID;
            String status;

            // Instantiate the retrieve request
            RetrieveRequest rr = new RetrieveRequest();
            rr.ObjectType = "DataExtensionObject[810f461c-231a-440a-8543-837460be6c7a]";//required

            rr.Properties = new string[] { "subscriber_key" };//required //Any Column on the Data Extension
            string a = rr.ToString();
            status = m_Client.Retrieve(rr, out requestID, out Results);
This code errors on the last line (error detail in the SOAP response below).
The "Retrieve" function in the last line sends this SOAP request:
<s:Envelope xmlns:s="http://schemas.xmlsoap.org/soap/envelope/">
 <s:Body xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  <RetrieveRequestMsg xmlns="http://exacttarget.com/wsdl/partnerAPI">
   <RetrieveRequest>
    <ObjectType>DataExtensionObject[810f461c-231a-440a-8543-837460be6c7a]</ObjectType>
    <Properties>subscriber_key</Properties>
   </RetrieveRequest>
  </RetrieveRequestMsg>
 </s:Body>
</s:Envelope>
and gets this response:
<?xml version="1.0" encoding="utf-8"?>
<soap:Envelope xmlns:soap="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:wsa="http://schemas.xmlsoap.org/ws/2004/08/addressing" xmlns:wsse="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd" xmlns:wsu="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-utility-1.0.xsd">
	<soap:Header>
		<wsa:Action>http://schemas.xmlsoap.org/ws/2004/08/addressing/fault</wsa:Action>
		<wsa:MessageID>urn:uuid:2a94f968-99f4-4a08-8782-d3b6fbe46860</wsa:MessageID>
		<wsa:RelatesTo>urn:uuid:4d96621b-9506-4ef0-8bdc-a05c7f12456e</wsa:RelatesTo>
		<wsa:To>http://schemas.xmlsoap.org/ws/2004/08/addressing/role/anonymous</wsa:To>
		<wsse:Security>
			<wsu:Timestamp wsu:Id="Timestamp-ec9ba10a-728f-4376-9e53-d7f711177af7">
				<wsu:Created>2017-03-17T22:05:29Z</wsu:Created>
				<wsu:Expires>2017-03-17T22:10:29Z</wsu:Expires>
			</wsu:Timestamp>
		</wsse:Security>
	</soap:Header>
	<soap:Body>
		<soap:Fault>
			<faultcode xmlns:q0="http://docs.oasis-open.org/wss/2004/01/oasis-200401-wss-wssecurity-secext-1.0.xsd">q0:Security</faultcode>
			<faultstring>Security requirements are not satisfied because the security header is not present in the incoming message.</faultstring>
			<faultactor>https://webservice.test.exacttarget.com/Service.asmx</faultactor>
		</soap:Fault>
	</soap:Body>
</soap:Envelope>
Does anyone have any suggestions on how to address this error?

Thanks,

David Brink
 

This is an informational posting since I couldn't find it documented anywhere:

 

If a report is in a folder, the OwnerID of the report corresponds to the ID of the folder object, so you can query a report folder's contents like this:

 

 

folder[] ff = [select id from folder where developername = 'Community_Inventory_Tool_Reports'];
id fid = (ff.isEmpty()) ? null : ff[0].id;
report[] rpts = [select id, name, description from report where ownerid = : fid and ownerid != null order by name];
return (rpts.isEmpty() == null) ? null : rpts;