• prakash_sfdc
  • NEWBIE
  • 209 Points
  • Member since 2012

  • Chatter
    Feed
  • 6
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 146
    Replies

Hi

 

I need small help

i want wirte one shcduler class  to rename the accounts name after one year,

what i need to do is i created some records in salesforce from december 2012 to november 30

i want schedule a class on every year dec 1

to update the all accounts name to old accounts

 

actualy i written the class

am not aware how can i fetch the reocrds from accounts records that are  created on date  dec 2012 to nover 30 fro every year

 

 

can any one help

 

regards

venkatesh

I have a related list on an object, "Expense_Report__c" that contains all of the "Expense_Item__c" records that have to do with that expense report. I am trying to create a button on this related list on the parent "Expense_Report__c" record that will operate on the "Expense_Item__c" records that were selected via checkboxes in the related list.

 

The button is a Custom List Button that is supposed to execute the specified Javascript when it is clicked.

This is the code I have in that button so far:

{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
var idArray = {!GETRECORDIDS($ObjectType.Expense_Item__c)};
//alert("The Ids you have selected are: "+idArray);

var recordArray = [];

for (var i = 0; i < idArray.length; i++)
{
recordArray[i] = sforce.connection.query("SELECT ID, Name, Expense_Report__c FROM Expense_Item__c WHERE ID = '" + idArray[i] + "'").getArray('records');
alert("Object ID: " + recordArray[i]);
//alert("SELECT ID, Name, Expense_Report__c FROM Expense_Item__c WHERE ID = '" + idArray[i] + "'");
}

 

This brings up an alert dialogue with the following as the body:

Object ID: {type:'Expense_Item__c', Id:'a0Kg239939399U4iEAE', Name:'EI-00013168', Expense_Report__c:'a0Jg00000009I1QDJE', }

 The ID's represented here aren't what the page actually shows, I just filled in random values, but the ID's that it does show were correct.

 

The problem occurs when I try to access the ID, or any field really, of any Expense_Item__c records in that array, as follows:

alert("Object ID: " + recordArray[i].Id);

 

I get an alert that contains the following:

Object ID: undefined

 

Am I attempting to access these fields correctly or is there some special way I need to try to access them?

This is my first attempt to interact with Force.com through Javascript, so I'm not entirely sure how to do these things.

 

Thanks in advance.

Hello,

I need to send a mail if an event is not completed and end date < Today-14days.

Thanks

 

I dont know how to do that.

I guess I need to create an Email alert than maybe a workflow rule but how can I reach this enddate.

Is it the same as activitydate?

 

Thanks

Hi,

 

I would like to perform certain actions on the customer portal only when the portal user has logged in from the site login page.

In other words, when the system admins logs in as Portal user certain actions shouldn't take place.

Is there a way to differentiate if the user has logged in from the site login page or from the platform by clicking on 'Login As Portal User'  button on the Contact detail page?

 

 

Thanks!

I implemented customer portal's login and registration functionality.

1. User logged in through customer portal can see those pages listed in site's visualforce pages list. But these pages are public. What setting do I need to do, so that pages will be available only to users' logged in though customer portal?

2. After login user gets the default page of customer portal. It is combination of site's home page and default tabs like home, cases, solutions, etc. How can I redirect login function to any other visulforce page? I tried to change startUrl but it is not working.  What changes are needed in following login code?

 

 global PageReference login() {
     String startUrl = System.currentPageReference().getParameters().get('startUrl');
        return Site.login(username, password,startUrl);
    }
  • February 17, 2013
  • Like
  • 0

i'm not able to fetch the if from the salesforce page into my visual force page

 

 

 

public with sharing class conversionrtestclass {
        
        
        public  list<organization> org=new list<organization>();
        Prospect__c  leadList =new Prospect__c();
        LeadDedupUtility leadUtility;
        public string id;
        
        
      public   Prospect__c  getleadList()
        {
            return leadList;
        }
        
      public  list <Organization> getorg()
        {
            return org;
        }
        
        
      public string getid()
        {
            return id;
        }
     
     
       
        public conversionrtestclass(ApexPages.StandardController stdController)
        {
        
                
                   leadUtility=new LeadDedupUtility();
                   //this.leadList  = ( Prospect__c )stdController.getRecord();
               //this.id=ApexPages.currentPage().getParameters().get(id);
                 id= 'a0Jc00000032sxs';
                   system.debug('Requested ID--->'+id);
                   
                   leadList =leadUtility.getProspect(id);
                   org=leadUtility.getorganization();
                       //selected=FALSE;
                  
                   //org=leadUtility.getorganization();
                  // system.debug('Requested object is--->'+org);
        }
      
      



}

We have custom domain enabled which uses Windows ADFS for SSO. Salesforce is a Service Provider and Windows ADFS is Identity Provider - hence it's a SP-initiated login.

Everything was working fine until recently the SSO login has stopped working for external apps like Apex Data Loader, SF1, etc.

Everything works fine when we login using browser, but it shows below error when we login using  "OAuth" in Apex Data Loader and select Custom Domain for login. Same happens when we use Custom Domain login in SF1 mobile app. 
 
Server Error

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Snapshot below:

User-added image


Please let me know if anyone has faced this issue. 
I am trying to assign QuoteLineItem ID to an Order Item record so that it can be linked and referred later. I tried both insert and update but it throws error.

Any work around to use this ?

Thanks in advance :)
I am trying to post a simple text comment to FeedItem. The comment has line breaks.

Following is my code:
 
String comment = 'Test1\r\n\r\nTest2';

String access_token = AuthController.getJIRAOAuthToken();

String authVal = 'OAuth '+access_token;
HttpRequest req = new HttpRequest();
String endpoint = system.label.JIRA_OAuth_SFDC_REST_API_Endpoint+'/services/data/v35.0/chatter/feed-elements/';


System.debug(endpoint); 
req.setEndpoint(endpoint);
req.setMethod('POST');
req.setHeader('Content-Type','application/json; charset=UTF-8');

req.setHeader('Authorization', authVal);




req.setBody('{"body":{"messageSegments":[{"type":"Text","text":"'+comment+'"}]},"feedElementType":"FeedItem","subjectId":"a3gm0000000066S"}');


Http http = new Http();
//System.debug(req);
HTTPResponse res = http.send(req);
System.debug('**'+res);

I am getting below response.
System.HttpResponse[Status=Bad Request, StatusCode=400]

If I am trying the same code without "\r\n" then it works perfectly fine. Any suggestions please ?

I tried replacing "\r\n" with "&nbsp;" as per the rich text feed item https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/quickreference_post_feed_element_rich_text.htm but even that didn't help. The comment is posted along with "&nbsp;" in text.
I am trying to post a simple text comment to FeedItem. The comment has line breaks.

Following is my code:
 
String comment = 'Test1\r\n\r\nTest2';

String access_token = AuthController.getJIRAOAuthToken();

String authVal = 'OAuth '+access_token;
HttpRequest req = new HttpRequest();
String endpoint = system.label.JIRA_OAuth_SFDC_REST_API_Endpoint+'/services/data/v35.0/chatter/feed-elements/';


System.debug(endpoint); 
req.setEndpoint(endpoint);
req.setMethod('POST');
req.setHeader('Content-Type','application/json; charset=UTF-8');

req.setHeader('Authorization', authVal);




req.setBody('{"body":{"messageSegments":[{"type":"Text","text":"'+comment+'"}]},"feedElementType":"FeedItem","subjectId":"a3gm0000000066S"}');


Http http = new Http();
//System.debug(req);
HTTPResponse res = http.send(req);
System.debug('**'+res);

I am getting below response.
System.HttpResponse[Status=Bad Request, StatusCode=400]

If I am trying the same code without "\r\n" then it works perfectly fine. Any suggestions please ?

I tried replacing "\r\n" with "&nbsp;" as per the rich text feed item https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/quickreference_post_feed_element_rich_text.htm but even that didn't help. The comment is posted along with "&nbsp;" in text.
 
I am trying to post a simple text comment to FeedItem. The comment has line breaks.

Following is my code:
 
String comment = 'Test1\r\n\r\nTest2';

String access_token = AuthController.getJIRAOAuthToken();

String authVal = 'OAuth '+access_token;
HttpRequest req = new HttpRequest();
String endpoint = system.label.JIRA_OAuth_SFDC_REST_API_Endpoint+'/services/data/v35.0/chatter/feed-elements/';


System.debug(endpoint); 
req.setEndpoint(endpoint);
req.setMethod('POST');
req.setHeader('Content-Type','application/json; charset=UTF-8');

req.setHeader('Authorization', authVal);




req.setBody('{"body":{"messageSegments":[{"type":"Text","text":"'+comment+'"}]},"feedElementType":"FeedItem","subjectId":"a3gm0000000066S"}');


Http http = new Http();
//System.debug(req);
HTTPResponse res = http.send(req);
System.debug('**'+res);

I am getting below response.
System.HttpResponse[Status=Bad Request, StatusCode=400]

If I am trying the same code without "\r\n" then it works perfectly fine. Any suggestions please ?


I tried replacing "\r\n" with "&nbsp;" as per the rich text feed item https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/quickreference_post_feed_element_rich_text.htm but even that didn't help. The comment is posted along with "&nbsp;" in text.





 

I am trying to invoke 3rd party web-services from Salesforce using WSDL2APEX. The client has also shared a .p12 certificate which I need to use for client authentication while making web-service call from Salesforce along with username and password.

I converted above .pfx into base64 using openSSL and tried below:
stub.clientCert_x = 'base64encodedstring'; 
stub.clientCertPasswd_x = 'password used for importing .pfx (password used for protecting private key)'


I am not sure above password is same as keystore password. But this method is not working.

I converted .p12(.pfx) into .jks and imported the same in Salesforce and used below:
 
​stub.clientCertName_x = 'CertificateUniqueName';



Even above method didn't work. Tried the same with HTTP callouts, but no luck.

I am not sure where I am going wrong. I am getting response from the server that authentication certificate is missing, hence I believe that the callout is successful.

My client has used "GlobalSign Root CA" which is supported by Salesforce.

Please let me know if my approach is wrong. Should I first export .p12 into public and private keys and then use it ?
I want to implement Territory Management and Forecasts but the new orgs offer Enterprise Territory Management and Collaborative Forecasts, which are not integrated to work. Can I shift to Customizable forecasts along with Enterprise Territory Management (Territory Management 2.0) ?

I want to use the features of Enterprise Territory Management (Territory Management 2.0) but I also need forecasting based on territories.

 
I want to create a validation rule to prevent EchoSign Agreement to be sent for signing until the Opportunity Probability has reached 90%. Please help it's urgent.
Hi,

I want to develop a scheduled batch class which will run all the test classes on my org. I am aware about how to schedule a batch class and also about the JAVA code to implement this.

I am looking for some solution where I can implement this functionality using APEX itself by importing the API or similar stuff. Please help.

Thanks,
Prakash
Hi,

I want to create a visualforce page like Advanced filters in List View.

I will give the Rule Criteria like 1 OR (2 AND 3) and Apex should query the object accordingly. I have tried replacing the numbers with field names and generating a dynamic query but it's not helping.

Please help.

I am using Salesforce as the Idp.

 

When tryin to login to GoogleApps using SSO, I am getting the RelayState Error as follows:

 

Google Apps - The required response parameter RelayState was missing.

 

 

The required response parameter RelayState was missing.

We are unable to process your request at this time, please try again later.

 

Any suggestions?

 

 

Hi,

 

I have a large amount of data in a custom object - ( around 1lakh records).

 

I want a scheduler class which can export the data in a csv and attach to chatter files daily. I have tried many things but it is hitting one or the other limit. String limit, Collection limit, Code Statements limit.

 

Is it possible? Is there any API for this purpose?

 

Thanks!

Hi,

 

I want to use Salesforce as an IDP and Box.com as a SP. I want to login to Box.com from my customer portal.

In other words, I want to use the portal credentials to login to Box. The appExchange app for Box will allow the integration of Salesforce.com platform and Box. Not the portal.

 

Please help.

 

Thanks,

Prakash

Hi everyone,

 

I want to change the look-and-feel of the default Chatter page.  Basically, I want to apply my own CSS, make minor layout adjustments, and hide the default salesforce menu at the top.  Does anyone know how I can do this?  Is it possible to get the VisualForce code for that page somehow to allow me to make the modifications?  I don't want to rewrite a custom Chatter page from scratch, since I'd be reusing the existing functionality and page layout as is.

 

Any help is appreciated!  Many thanks!

Hi everyone,

 

I want to change the look-and-feel of the default Chatter page.  Basically, I want to apply my own CSS, make minor layout adjustments, and hide the default salesforce menu at the top.  Does anyone know how I can do this?  Is it possible to get the VisualForce code for that page somehow to allow me to make the modifications?  I don't want to rewrite a custom Chatter page from scratch, since I'd be reusing the existing functionality and page layout as is.

 

Any help is appreciated!  Many thanks!

Hi,

 

I have enabled communities for my org. Everything is working fine but the chat widget is missing. Please help.

Hi,

 

I have activated Salesforce Communities for my org, but I need to use my own custom login page and not the default one. We have an option to override the Login Page in Normal Sites but I cannot see the same in the site created for community (Force.com community).

 

Please help

 

 

Hi,

 

I want to use Gmail/Google credentials of the users to login into Salesforce. I tried few things but it didn't work. Somebody had suggested to have Google apps Premier account. I need to test before investing.

 

Is there any free solution ?

 

Please help.

 

Thanks,

Prakash.

Hi,

 

I am unable to update the LetterHead of an email template. Don't have time to recreate all of them again.. any quick solution via Schema or Eclipse IDE ?

Hi,

 

I have two objects A and B. B has a look up to A.

 

//Test class code

 

A ob1 = new A();

ob1.Date1__c= Date.today();

ob1.Date2__c=Date.today()+2;

insert ob1;

 

B ob2 = new B();

ob2.A_Value__c=ob1.Id;

insert ob2;

 

 

Now, in apex code I am checking the dates from Object A via B as follows:

 

 

if(date.today()<=ob2.A_Value__r.Date1__c)

{

// Code block

}

 

The code inside IF is never covered in test coverage, it is not able to fetch the value of Date1 and hence the condition is not satisfied. I think some assignment issue in test class. Please help.

 

 

 

Hi,

I want to create a visualforce page like Advanced filters in List View.

I will give the Rule Criteria like 1 OR (2 AND 3) and Apex should query the object accordingly. I have tried replacing the numbers with field names and generating a dynamic query but it's not helping.

Please help.

Hi,

 

I have activated Salesforce Communities for my org, but I need to use my own custom login page and not the default one. We have an option to override the Login Page in Normal Sites but I cannot see the same in the site created for community (Force.com community).

 

Please help

 

 

We have custom domain enabled which uses Windows ADFS for SSO. Salesforce is a Service Provider and Windows ADFS is Identity Provider - hence it's a SP-initiated login.

Everything was working fine until recently the SSO login has stopped working for external apps like Apex Data Loader, SF1, etc.

Everything works fine when we login using browser, but it shows below error when we login using  "OAuth" in Apex Data Loader and select Custom Domain for login. Same happens when we use Custom Domain login in SF1 mobile app. 
 
Server Error

404 - File or directory not found.

The resource you are looking for might have been removed, had its name changed, or is temporarily unavailable.
Snapshot below:

User-added image


Please let me know if anyone has faced this issue. 
I was trying to use array.filter method of js in my controller js but it is not recognizing filter method.
I tried placing the code in helper also, but no help.

Please suggest.

Hello,

I want to know if salesforce provides any mock tests(free or paid) to prepare for the developer I certification.

The test I could find online are mostly outdated or their syllabus differs from the original syllabus mentioned in SALESFORCE CERTIFIED PLATFORM DEVELOPER I.

Any help is appreciated.

Regards

Shubham Nandwana

id- shubhamnandwana18@gmail.com

We have developed a custom opportunity closure screen using lightning component. It has HTML elements such as readio buttons,  custom buttons and text fields.  When specific users navigate through the screen, the elements appear to be frozen and user is unable to provide any input.  The backend page inspection shows that the users inputs are getting recorded.  e.g. changing radio button option does not appear on screen, however on mouse click it changes the field values (set in console.log).
The issue is not recorded if the same functionality is initiated by System Administrator user or any other user.  This is critical issue for our lightning go live.
How do I create a Global Action button to use on a Lightnint Page layout connected to a VF page to open in a new tab rather than over the existing page?

Label = Generate New Application
VF page = Loan Application
 
  • September 25, 2017
  • Like
  • 0

Hello, 
befor I ask my question..I hope I'm in the right forum.. if not, please let me know.

 

Question:

If I add in the same row a  <ui:inputSelect and  <lightning:input type="text"  why they have difference size ?

User-added image

cheers from germany ;D

marcel

 

I am trying to assign QuoteLineItem ID to an Order Item record so that it can be linked and referred later. I tried both insert and update but it throws error.

Any work around to use this ?

Thanks in advance :)
I am trying to post a simple text comment to FeedItem. The comment has line breaks.

Following is my code:
 
String comment = 'Test1\r\n\r\nTest2';

String access_token = AuthController.getJIRAOAuthToken();

String authVal = 'OAuth '+access_token;
HttpRequest req = new HttpRequest();
String endpoint = system.label.JIRA_OAuth_SFDC_REST_API_Endpoint+'/services/data/v35.0/chatter/feed-elements/';


System.debug(endpoint); 
req.setEndpoint(endpoint);
req.setMethod('POST');
req.setHeader('Content-Type','application/json; charset=UTF-8');

req.setHeader('Authorization', authVal);




req.setBody('{"body":{"messageSegments":[{"type":"Text","text":"'+comment+'"}]},"feedElementType":"FeedItem","subjectId":"a3gm0000000066S"}');


Http http = new Http();
//System.debug(req);
HTTPResponse res = http.send(req);
System.debug('**'+res);

I am getting below response.
System.HttpResponse[Status=Bad Request, StatusCode=400]

If I am trying the same code without "\r\n" then it works perfectly fine. Any suggestions please ?

I tried replacing "\r\n" with "&nbsp;" as per the rich text feed item https://developer.salesforce.com/docs/atlas.en-us.chatterapi.meta/chatterapi/quickreference_post_feed_element_rich_text.htm but even that didn't help. The comment is posted along with "&nbsp;" in text.
We have a requirement where we need to connect to salesforce from an intranet website with code written in JavaScript. We have the ConnectedApp created in Salesforce and we are following Username-Password OAuth2 flow. We are passing all the required parameters given below. We are POSTing this to the request URL given below.

var requestUrl = 'https://login.salesforce.com/services/oauth2/token';
requestUrl += '?username=USERNAME&password=PASSWORD_SECURITY_TOKEN&grant_type=password&client_id=CLIENT_ID_FROM_CONNECTED_APP&client_secret=AGAIN_FROM_CONNECTED_APP;
We tried connecting using JQuery AJAX call and JSforce libraries. We have also whitelisted the required domain in Salesforce via Setup --> Security Controls --> CORS.

We tried connecting to salesforce via the intranet site as well as another salesforce org using the same code. for both of the situations we are getting below error. 

User-added image

In case if image does not load 
 
XMLHttpRequest cannot load https://login.salesforce.com/services/oauth2/token. No 'Access-Control-Allow-Origin' header is present on the requested resource. Origin 'https://lightningcheck-dev-ed--c.ap2.visual.force.com' is therefore not allowed access.

The origin is there in the Request Header as checked in Browser Console, however, the 'Access-Control-Allow-Origin' parameter is not there in response header from Salesforce.

Am I missing any setting here or it is not something Salesforce currently supports? Any help appreciated, thanks.
 
Hi,

I want to create a visualforce page like Advanced filters in List View.

I will give the Rule Criteria like 1 OR (2 AND 3) and Apex should query the object accordingly. I have tried replacing the numbers with field names and generating a dynamic query but it's not helping.

Please help.

Hi,

 

How do I make a custom field on a custom object available to a related list of a standard object. Is this possible?

 

Thanks ahead of time.

 

I have  contact as Master and policy as detailed . i want to retrive records from contact. but this gives error.

 

the error is the subsequent querry contact.id is not recognised. how to write querry for this?

 

List<Contact> Con = [Select Id, Name from Contact where Id In (Select contact.Id from Policy__c)];

  • October 25, 2013
  • Like
  • 0

Contact is Master and policy__c is detailed. i want to retrive policy records which is associated with contact. need SOQL querry for this

  • October 25, 2013
  • Like
  • 0

Hi ,

 

Iam trying to convert String (Mon Oct 14 00:00:00 GMT 2013) to Date

 

String sDate=  'Mon Oct 14 00:00:00 GMT 2013';

Date startDate = date.parse(sDate);
 system.debug('**********eDate*********'+startDate);

 

iam getting the below error:

 

07:56:48.075 (75842000)|SYSTEM_METHOD_ENTRY|[76]|Date.parse(String)
07:56:48.076 (76008000)|EXCEPTION_THROWN|[76]|System.TypeException: Invalid date: Mon Oct 14 00:00:00 GMT 2013
07:56:48.076 (76189000)|SYSTEM_METHOD_EXIT|[76]|Date.parse(String)
07:56:48.076 (76269000)|FATAL_ERROR|System.TypeException: Invalid date: Mon Oct 14 00:00:00 GMT 2013

Class.workingSFDCHrsController.loadOpps: line 76, column 1
07:56:48.076 (76279000)|CODE_UNIT_FINISHED|VFRemote: workingSFDCHrsController invoke(loadOpps)
07:56:48.076 (76285000)|EXECUTION_FINISHED

 

 

Please help me.

 

Thanks advance,

Santhosh.A

I have an unusual requirement. From within a set of child records (I will use Invoices as an easy example) I need to find whether the current invoice record is larger or smaller than the previous largest invoice as of the date of that line item

 

This needs to show in each record the status as of the date of that record so it's not just a simple rollup of the MAX of all records. It also needs to dynamically update if prior invoices are deleted or updated as well. 

 

Think of this as a cascading value that will possibly be different with each record. I think of it as a "Roll Down" or "Roll Previous"  or a max of prior siblings. 

 

I am looking for a good way to implement this that doesn't max out governor limits. 

 

Any thoughts would be appreciated. 

  • September 24, 2013
  • Like
  • 0

hii,

 

i have a pageblock table  which has columns

 

one of the column has data coming from field whose data type is text(256)

 

i have fixed the width of the column as

<apex:column width="30%" >

 

but when i write a long text value in the field.........the column width goes beyond 30%

 

so i want to wrap the text to second line when the width is 30% so that it cannot go beyond 30%

 

please provide me way of doing it !!!!!!

Hi,

 

I want to use Salesforce as an IDP and Box.com as a SP. I want to login to Box.com from my customer portal.

In other words, I want to use the portal credentials to login to Box. The appExchange app for Box will allow the integration of Salesforce.com platform and Box. Not the portal.

 

Please help.

 

Thanks,

Prakash