• AyanHore
  • NEWBIE
  • 40 Points
  • Member since 2013
  • Salesforce Technical Leader/Architect
  • Cognizant Technology Solutions

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 11
    Questions
  • 2
    Replies
Hi All,

Just recently I came across one strange issue. I'm still investigating it. Posting the problem here in case anyone has faced the same issue earlier, or if I'm missing anything.
I'm an sys admin in GMT+5:30 timezone (India) and I've logged in on behalf of another user with GMT - 7:00 (US) and created a record (The logged-in users current date is 2016-06-14). The object field I'm checking is a DateTime field (holding the created datetime) and I noticed that when I extract the date part (using the <DateTimeField>.date() ) method, the date is "2016-06-13 00:00:00". However, when I'm simply printing out the dateTime field in debug (minus the .date() part), I'm getting "2016-06-14 00:00:00".

Due to this issue, the code is not working properly and I would appreciate if anyone can help me with this. I'm still investigating this and if anyone has faced similiar issues before, would really appreciate the inputs.

Regards,
Ayan
Hi,

I'm trying to create a dynamic filter where the user can select any fields from a SObject to filter the data (something like the lookup filters). It is working fine, however, the below scenario throws an error:
If the inputField is having a previous value selected (say a String) and I selected a DateTime field in the filter, it tried to convert the string into DateTime and throwing a error. Below is the line in question:
<apex:inputField value="{!inputObj[FieldName]}" required="false" rendered="true" style="width:50%"/>
Getting the below error:.
Error: Value 'Provisional' cannot be converted from Text to DateTime
FieldName refers to the field API name. Any ideas on how to solve this would be very much appreciated.

~Ayan
 
Hi,

I'm using the "list" attribute in apex:InputText tag in Visualforce to feed a list of String for autocomplete (html-autocomplete="on"). I've a requirement to display results in a sorted manner. Modifying/Sorting the underlying List<String> does not seem to have any impact. 

Syntax:
<apex:inputText id="InputBox" value="{!selectecValue}" list="{!autocomplete}" html-autocomplete="on"/>
--- Here autocomplete is of type: List<String>. Even after sorting the list in controller (as per business requirement) the display order in visualforce page remains the same.

Is there any way to do that? Any help will be appreciated..!!

Regards,
Ayan
Hi,

I'm developing a mobile optimized VF page (with JQuery Mobile framework) which needs to run in Salesforce1 app. In the Object's details page, there is a link that leads to the mobile optimized page. However, when I'm trying to navigate back to Salesforce1 object detail page, using a link in the VF page, I'm unable to do so. A couple of points I noted:
1. I think navigating to a visualforce page (using a link in Salesforce1 object detail page) removes the sforce.one binding, as a result I'm unable to navigate back (I tried sforce.one.navigateToURL(ObjectId,'detail') method),
2. Not sure if there is currently any way to navigate from a visualforce page to Salesforce1 mobile navigation.

If any of you have faced/resolved this type of issue or know about it, please let me know.

~Ayan
Hi,

I'm developing a mobile optimized VF page (with JQuery Mobile framework) which needs to run in Salesforce1 app. In the Object's details page, there is a link that leads to the mobile optimized page. However, when I'm trying to navigate back to Salesforce1 object detail page, using a link in the VF page, I'm unable to do so. A couple of points I noted:
1. I think navigating to a visualforce page (using a link in Salesforce1 object detail page) removes the sforce.one binding, as a result I'm unable to navigate back (I tried sforce.one.navigateToURL(ObjectId,'detail') method),
2. Not sure if there is currently any way to navigate from a visualforce page to Salesforce1 mobile navigation.

If any of you have faced/resolved this type of issue or know about it, please let me know.

~Ayan
Hi,

I'm trying to list and display all metadata components in a VF page. It should ideally have two dropdowns: one for metadata types (apex class, visualforce page, custom settings, apex component, etc) and another (dependent on the first one) will list all the available ones in the org. Is there any way to list them programmatically using Apex code?  It will be something similiar to "Metadata Types & Components" in the Workbench Tool.

I understand that need to use dynamic apex, however any help/directions will be very helpful to me.

~Ayan
Hi,

I've a rather "unique" condition which I'm trying to resolve and need help to do it. Below is the scenario:

I've a large number of data (>1000) which I need to display in a selectlist. I've implemented the same by breaking the list into lists of 1000 values each and have methods like: getValue0() -- which fetches the data for offset 0, getValue1() -- for offset 1 and so on... based on the volume of data, I'm calculating the offset and want to call those methods from the VF page. I want to do something like this:
Suppose I've 2500 records for the selectlist. So, dividing them in chunks of 1000 each gives me 3 offsets (0,1 and 2). So, I would like to call only getValue0(), getValue1() & getValue2() from the VF page. I've a apex repeat going on to loop for the total number of offsets and another variable initialized to 0. What I'm trying to do is combine the String: getValue and the variable count from the loop (0,1 and 2 in this case) to get the controller variable name dynamically and then invoke them within the repeat. I'm not able to do that and need help.

Could you please tell me if this is even possible? And if so, how can I do this?

Any help in this regard will be very helpful for me.

Regards,
~Ayan
Hi,

I'm working on a custom object which requires me to replace the standard edit page of the same with a VF page. Once the "Edit" button is clicked on the detail page (Salesforce standard detail page), it should redirect to the VF page.

However, I require the id of the object to be passed as a parameter to the VF page.

I'm able to override the "Edit" button with the VF page, but not able to pass the Id as a parameter. As a result, it is not working properly for me.

If anyone can point me in the right direction on how to do this, will be very helpful..!!

Regards,
~Ayan
Hi,

I've a link in my visualforce page, which renders the data as Excel. However, post developement, I wanted to do some performance tuning and to reduce the view state size, have declared the list variable (having the complete set of data to be displayed) as transient. As a result, no values are being passed to the next VF page.

As of the moment, I've removed the transient type and it is working fine. However, if there is any way to pass transient values to subsequent pages, it will be very useful as I'm worried about the view state size in case of a huge volume of data.

Thanks...!!

~Ayan
Hi,

I'm currently working on an Apex test class. However, the controller I'm trying to test is divided into several sections, each meant to be for diffferent profiles.
As a result, I've to test each profile using a single runAs() method for each profile users, but those were only able to test parts of the controller and not completely.
My test class has different methods for each profiles and they cover roughly 25-30 % of the code, so it is nowhere near 75% (let alone 100%).

I've tried to club different runAs() method calls in a single test method, but I'm hitting the maximum number of SOQL limit of 100.

Right now I'm stuck with 40% code coverage of my controller. Any help/suggestion will be very welcome..!!

Thanks,
~Ayan

Hi,

 

I am relatively new to Apex coding. I noticed that there is no functionality for upding the user's manager details automatically when the user's role changes. So, I am trying to implement the same using a trigger on User object. While I am getting satisfactory results when I am updating the user manually (editing the user and changing the role). However, when I am assigning the user to another role from the role hierarchy, the manager details are not getting updated.

 

On a hunch, I decided to edit the user (after such transaction) and save without modifying anything and the trigger picked up the changes.

 

So, this essentially means assigning users to different roles using role hierarchy is not considered as a "User" transaction and hence will not be picked up by the trigger (before/after update).

 

Any idea on how to work around this? Because in a large organizations, usually these types of transactions are done in bulk, specially during a re-alignment period.

 

Any help/suggestions will be welcome..!!

 

~Ayan

Hi,

I'm trying to create a dynamic filter where the user can select any fields from a SObject to filter the data (something like the lookup filters). It is working fine, however, the below scenario throws an error:
If the inputField is having a previous value selected (say a String) and I selected a DateTime field in the filter, it tried to convert the string into DateTime and throwing a error. Below is the line in question:
<apex:inputField value="{!inputObj[FieldName]}" required="false" rendered="true" style="width:50%"/>
Getting the below error:.
Error: Value 'Provisional' cannot be converted from Text to DateTime
FieldName refers to the field API name. Any ideas on how to solve this would be very much appreciated.

~Ayan
 
Hi,

I'm using the "list" attribute in apex:InputText tag in Visualforce to feed a list of String for autocomplete (html-autocomplete="on"). I've a requirement to display results in a sorted manner. Modifying/Sorting the underlying List<String> does not seem to have any impact. 

Syntax:
<apex:inputText id="InputBox" value="{!selectecValue}" list="{!autocomplete}" html-autocomplete="on"/>
--- Here autocomplete is of type: List<String>. Even after sorting the list in controller (as per business requirement) the display order in visualforce page remains the same.

Is there any way to do that? Any help will be appreciated..!!

Regards,
Ayan