• Vishal_Thoriya
  • NEWBIE
  • 204 Points
  • Member since 2011

  • Chatter
    Feed
  • 8
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 31
    Questions
  • 46
    Replies
When we try to format some datetime using DateTime.format(dateTime,'EST'). Does it observes the daylight-time or not?
I mean does salesforce format the datetime as per EDT if EDT is running?

I have written following code on my custom visualforce page.

 

It seems that pagesize attribute is not working on relatedList tag.

 

<apex:relatedList id="Assignments" list="Assignments__r" pageSize="2" title="Assignments" rendered="{!$ObjectType.Assignment__c.accessible}"/>

 

My related list still shows me more than 2 records on page load.

 

I am wondering is it a known issue of salesforce?

 

Please help me if anyone knows about this issue.

 

Thanks,

Vishal Thoriya.

I have developed a visualforce page and and it is being shown on standard layout.

When i try ti pull the records i am recieving following error.

XMLHttpRequest cannot load https://c.cs2.visual.force.com/apex/AccountPerformance?id=001R000000gidwJ&core.apexpages.devmode.url=1. Origin http://c.cs2.visual.force.com is not allowed by Access-Control-Allow-Origin.

Is there any way to open any visualforce page within visualforce page with parent domain?

It is working without issue when i try to open my page with https.

Please suggest me any workaround for this.

Thanks,
VIshal Thoriya.

Guys,

 

i found following solution but this one shows the result based on days in month.

 

select day_only(createdDate) createdonDate,
count(createdDate) numCreated
from account
group by day_only(createdDate)
order by day_only(createdDate) desc

 

But i want result based on month.

 

 

 

Regards,

Vishal Thoriya.

 

 

Imeant, Do we have any way to show the time in user timezone using Outputtext?

 

I am trying to show date time with Apex:outputtext using the below code:

 

I am not using apex code only use for visualforce.

 

<apex outputLink rendered="{! fld == 'Due__c'}" onclick="updateDueDate('{!r.Id}');return false;" styleClass="actionLink">

<apex outputText value="{0,date,M/d/yyyy h:mm a}" ><apex param value="{!r[fld]}"/></apex outputText>

</apex outputLink>

Hi All,

 

I have a problem with sosl

 

This is working fine :-

 

List<List<SObject>> searchList = null;
string startAddress = 'hello';
searchList = Search.query('FIND \'' +startAddress + '\' IN ALL FIELDS RETURNING Account(Id,Stage__c,Tower_ID__c,Name,ShippingStreet,ShippingCity,ShippingState,ShippingPostalCode,ShippingCountry where Tower_ID__c = :startAddress OR Name = :startAddress LIMIT 1),Opportunity(Id,Name,Vehicle_Year__c,Vehicle_Make__c,Vehicle_Model__c,Vehicle_Sub_Model__c,Claim_Status__c,Vehicle_Street_Address__c,Vehicle_City__c,Vehicle_State__c,Vehicle_Zip__c,Vehicle_Country__c where Name = :startAddress OR Opportunity__c = :startAddress LIMIT 1)');
system.debug('searchList[0]---->'+searchList[0].size());
system.debug('searchList[1]---->'+searchList[1].size());

 But it is giving me an error if i write some what like this:

 

List<List<SObject>> searchList = null;
string startAddress = 'Tom\'s Towing and Recovery';
searchList = Search.query('FIND \'' +startAddress + '\' IN ALL FIELDS RETURNING Account(Id,Stage__c,Tower_ID__c,Name,ShippingStreet,ShippingCity,ShippingState,ShippingPostalCode,ShippingCountry where Tower_ID__c = :startAddress OR Name = :startAddress LIMIT 1),Opportunity(Id,Name,Vehicle_Year__c,Vehicle_Make__c,Vehicle_Model__c,Vehicle_Sub_Model__c,Claim_Status__c,Vehicle_Street_Address__c,Vehicle_City__c,Vehicle_State__c,Vehicle_Zip__c,Vehicle_Country__c where Name = :startAddress OR Opportunity__c = :startAddress  LIMIT 1)');
system.debug('searchList[0]---->'+searchList[0].size());
system.debug('searchList[1]---->'+searchList[1].size());

 Error : System.QueryException: line 1:507 mismatched character '<EOF>' expecting '''

 

If Please suggest me a solution for this iussue.

Any kind of help would be greatly appriciated.

 

 

Hi,

 

I have encountered an issue with Live Agent.

 

It is not working in IE, in other browsers it is working well. is this bug or something?

I am working on Live agent chat.

 

I have created Live agent chat functionality and it is working fine.

 

Auto generated Live Chat Button coe is working as expected.

 

But is there any way to auto execute that auto generated button code("javascript") without clicking on that link/button ?

 

I want that script to be auto executed.

 

If there is a way to do so then please suggest....

 

 

Any kind of help will be greatly appriciated..

 

Thanks in advance.

 

Hi,

 

I am using <apex:detail relatedList="false"/> in my VF page.

 

so i am not able to show a history of opportunity..

 

I just want to show opportunity history

 

How can i show that?

 

i do not know the relationship between the Opportunity and opportunity field history object.

 

 

<apex:relatedlist subject="{!Opportunity}" list"___________">

 

i do not know what to write there?

 

 

Any kind of help wiil be greatly appriciated.

 

 

Thanks,

 

Vishal Thoriya.

How to remove Action column in <apex:relatedList> in VF Page without changing User permission ?

Page is: 

<apex:detail relatedList="false"/>
<apex:relatedList list="Engineering_Deployment_Elements__r"/>

 

I am having problem with Ext js style:

 

I am redering the grid of Ext js on my visualforce page but visualforce page is overiding the styles of my grid.

 

but it works fine if i write:

<apex:page standardStylesheet="false" showHeader="false" sidebar="false">

</apex:page>

but this is not a solution for me i want header and sidebar both in my page.

 

Any other solution ?

 

how can i prevent overridng the styles issue?

 

 

Any kind of help will be greatly appriciated.

 

Thanks,

Vishal Thoriya.



Following is my code:

 

 String regExp = '/^((([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+(\\.([a-z]|\\d|[!#\\$%&\'\\*\\+\\-\\/=\\?\\^_`{\\|}~]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])+)*)|((\\x22)((((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(([\\x01-\\x08\\x0b\\x0c\\x0e-\\x1f\\x7f]|\\x21|[\\x23-\\x5b]|[\\x5d-\\x7e]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(\\\\([\\x01-\\x09\\x0b\\x0c\\x0d-\\x7f]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))))*(((\\x20|\\x09)*(\\x0d\\x0a))?(\\x20|\\x09)+)?(\\x22)))@((([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|\\d|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])))\\.)+(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])|(([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])([a-z]|\\d|-|\\.|_|~|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF])*([a-z]|[\\u00A0-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFEF]))){2,}$/i';
            Pattern perObject=Pattern.compile(regExp);
            Matcher MyMatcher = perObject.matcher(email);
            if(MyMatcher.matches())
            {
               return true;  
            }
            ApexPages.addmessage(new ApexPages.message(ApexPages.severity.ERROR,'Email'));
            return false;

 

My code compiles successfully but it is not giving me desired output.

 

the regular expression is for validating email address:

 

i have used this regular expression in javascript also but, it is working fine and validating the email addresses like

 

vishal@vishal.vishal

 

 

for client side validation i am using this:

and it is working fine with vishal@vishal.vishal kind of email addresses.

 

function checkEMailAddress(value)
{	
	return false || /^((([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+(\.([a-z]|\d|[!#\$%&'\*\+\-\/=\?\^_`{\|}~]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])+)*)|((\x22)((((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(([\x01-\x08\x0b\x0c\x0e-\x1f\x7f]|\x21|[\x23-\x5b]|[\x5d-\x7e]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(\\([\x01-\x09\x0b\x0c\x0d-\x7f]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))))*(((\x20|\x09)*(\x0d\x0a))?(\x20|\x09)+)?(\x22)))@((([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|\d|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])))\.)+(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])|(([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])([a-z]|\d|-|\.|_|~|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF])*([a-z]|[\u00A0-\uD7FF\uF900-\uFDCF\uFDF0-\uFFEF]))){2,}$/i.test(value);
}

 

 

i want to achieve the same thing in my apex class

 

is it possible ?

 

Any kind of help will be greatly appriciated...

 

Thanks,

Vishal.

 

Hi,

 

I am having decimal number like this : 4.77080

 

but i want only 77 after decimal point notation.

 

How can i achieve this?

 

Any kind of help will be greatly appriciated.

 

Thanks in advance..

 

Vishal.

 

hi,all

 

Following is the sql database query.

 

SELECT * FROM suppliers WHERE supplier_name not like 'T%';

 

but i want to achieve in salesforce.

 

How can i achieve it ?

 

Any kind of help will be greatly appriciated.

 

Thanks in advance

Vishal.......

Hi everyone ,

 

I am having dout related to governor limit of salesforce ...

 

following is my trigger code

 

i am invoking this trigger for 'Before insert' and 'Before update'

 

How can i avoid my soql queries inside for loop  for this kind of situation....

 

 

if(personalTimeMap.size() > 0){
    	personalList = new List<Personal__c>();
    	for(List<Personal__c> personal : personalMap.values()){
    		personalTime.addAll(personal);
    	}
    	for(Personal__c personalTime : personalList){
    		if([SELECT count() FROM Personal__c WHERE Date_Applied__c = :personalTime.Date_Applied__c AND Assigned_to__c = :personalTime.Assigned_to__c AND Type__c = :personalTime.Type__c AND Type__c = 'Credit'] != 0){
    			personalTime.Date_Applied__c.addError('A personal time with the same applied date, assigned to and type values already exists.');
    		}
    	}
    	
      }

 my code is breaking the governor limit , but can any one help me to come out from this situation?

 

Any kind of help will be very greatly appriciated...

 

Thanks in advance...

 

Vishal.

hey Ragjesh your code helped me a lot but am getting null value in my controller can you suggest me the exact solution of this problem

 

 

here is my code:

Apex Code:

<apex:actionFunction name="sendTimeStamp" action="{!sendTimeStamp}">
    <apex:param name="x" value="x" assignTo="{!timeStampValue}" />
    </apex:actionFunction>

javascript code:

timeStamp = Number(new Date());
          sendTimeStamp(timeStamp);

controller code:


public string sendTimeStamp() 
    {
        return timeStampValue;
    }
    public string timeStampValue{
    get
    {
        timeStampValue = timeStamp;
        return timeStampValue;
    }
    set;}

 please Help me i am newbie in salesforce

 

i dont know where i am making mistakes?

 

hi all,

 

i am having an issue with passing the attachment to my javascript

 

here is my onclick function where i am not getting the value of my attachment

<apex:commandButton onclick="sendMail('{!attachment}');return false;" value="Send"  style="margin-left:110px;margin-top:10px;"/>

 

<apex:inputFile value="{!attachment.body}" filename="{!attachment.name}" style="margin-left:50px;margin-top:50px;">

 

 

and the controller side my code is:

public Attachment attachment
       {
       get
       {
            if(attachment == null)
            {
                Attachment attachment = new Attachment();
            }
            return attachment;
       }     
       set;
       }

  but i am not getting the attachment file ..........

 

i dont know what is going wrong?

 

please help me..........

 

any kind of help will be greatly appriciated........

hi all,

 

i have question ?

 

how can we send an email with our file attachment  to desired email address ?

 

like gmail and yahoo i want the same kind of page......

 

any kind of help will be gratly appriciated..........

 

thanks in advance........

 

Vishal Thoriya.

i have simple problem but i dont know how to solve..

 

here it is

<apex:outputLabel rendered="{!(agenda.Committed__c== false && agenda.Employee__r.Name == 'Vishal Thoriya' )}" ><span><apex:outputLink onclick="editAgendaPopUp('{!agenda.Id}');return false;" styleClass="Links">Edit</apex:outputLink></span>&nbsp;|&nbsp;<span><apex:outputLink onclick="commitAgenda('{!agenda.Id}');return false;" styleClass="Links">Commit</apex:outputLink></span>  &nbsp;|&nbsp;<span><apex:outputLink onclick="deleteAgenda('{!agenda.Id}');return false;" styleClass="Links">Del</apex:outputLink></span></apex:outputLabel>

 i am rendering the elements based on conditions 

 

here in my code i have passed 'Vishal Thoriya'

 

which is a value of userName in my code

 

userName is 

like

public string UserName{get;set;}

 

i am getting the value of userName as 'Vishal Thoriya'

 

but my problem is that how to pass it to my code like

 

rendered="{!(agenda.Committed__c== false && agenda.Employee__r.Name == !userNAme)}"

 

but this is giving me syntax error........

 

any suggestions for this kind of problem....

 

any kind of help will be appriciated..............

 

Thanks in Advance 

 

 

Vishal Thoriya

 

 

hi ,

 

how can i rerender the pageBlockTable by clicking on the command button?

 

any kind of help will be appriciated.........

 

thanks in advance

 

Vishal

Hi

 

I am using following Code.

 

<apex:page sidebar="false">
<apex:form >
<apex:tabPanel >
<apex:tab title="Tab1">
Tab1
</apex:tab>
<apex:tab title="Tab2">
Tab2
</apex:tab>
</apex:tabPanel>
<c:VFAttachmentSlider RecordId="a0190000007m4ys"/>
</apex:form>
</apex:page>

 

 

 

In "VFAttachmentSlider" Component i have included few jQuery releated files to design slider. When i am commecting those Jquery libraries then tabs are working fine. When i use jQuery then tabs are not working..

 

Any ideas!

Guys,

 

i found following solution but this one shows the result based on days in month.

 

select day_only(createdDate) createdonDate,
count(createdDate) numCreated
from account
group by day_only(createdDate)
order by day_only(createdDate) desc

 

But i want result based on month.

 

 

 

Regards,

Vishal Thoriya.

 

 

Hi All,

 

I have a problem with sosl

 

This is working fine :-

 

List<List<SObject>> searchList = null;
string startAddress = 'hello';
searchList = Search.query('FIND \'' +startAddress + '\' IN ALL FIELDS RETURNING Account(Id,Stage__c,Tower_ID__c,Name,ShippingStreet,ShippingCity,ShippingState,ShippingPostalCode,ShippingCountry where Tower_ID__c = :startAddress OR Name = :startAddress LIMIT 1),Opportunity(Id,Name,Vehicle_Year__c,Vehicle_Make__c,Vehicle_Model__c,Vehicle_Sub_Model__c,Claim_Status__c,Vehicle_Street_Address__c,Vehicle_City__c,Vehicle_State__c,Vehicle_Zip__c,Vehicle_Country__c where Name = :startAddress OR Opportunity__c = :startAddress LIMIT 1)');
system.debug('searchList[0]---->'+searchList[0].size());
system.debug('searchList[1]---->'+searchList[1].size());

 But it is giving me an error if i write some what like this:

 

List<List<SObject>> searchList = null;
string startAddress = 'Tom\'s Towing and Recovery';
searchList = Search.query('FIND \'' +startAddress + '\' IN ALL FIELDS RETURNING Account(Id,Stage__c,Tower_ID__c,Name,ShippingStreet,ShippingCity,ShippingState,ShippingPostalCode,ShippingCountry where Tower_ID__c = :startAddress OR Name = :startAddress LIMIT 1),Opportunity(Id,Name,Vehicle_Year__c,Vehicle_Make__c,Vehicle_Model__c,Vehicle_Sub_Model__c,Claim_Status__c,Vehicle_Street_Address__c,Vehicle_City__c,Vehicle_State__c,Vehicle_Zip__c,Vehicle_Country__c where Name = :startAddress OR Opportunity__c = :startAddress  LIMIT 1)');
system.debug('searchList[0]---->'+searchList[0].size());
system.debug('searchList[1]---->'+searchList[1].size());

 Error : System.QueryException: line 1:507 mismatched character '<EOF>' expecting '''

 

If Please suggest me a solution for this iussue.

Any kind of help would be greatly appriciated.

 

 

Hi,

 

I have encountered an issue with Live Agent.

 

It is not working in IE, in other browsers it is working well. is this bug or something?

How to remove Action column in <apex:relatedList> in VF Page without changing User permission ?

Page is: 

<apex:detail relatedList="false"/>
<apex:relatedList list="Engineering_Deployment_Elements__r"/>

 

Hi ,

 

I am following the the code below for google map rendition in VF page in Account page layout yet it is coming blank. Please help

 

 

http://salesforce.phollaio.com/2010/03/18/inline_google_maps_using_visualforce/

 

Regards

 

Prazon

  • February 29, 2012
  • Like
  • 0

I am having problem with Ext js style:

 

I am redering the grid of Ext js on my visualforce page but visualforce page is overiding the styles of my grid.

 

but it works fine if i write:

<apex:page standardStylesheet="false" showHeader="false" sidebar="false">

</apex:page>

but this is not a solution for me i want header and sidebar both in my page.

 

Any other solution ?

 

how can i prevent overridng the styles issue?

 

 

Any kind of help will be greatly appriciated.

 

Thanks,

Vishal Thoriya.



Hi,

 

I am having decimal number like this : 4.77080

 

but i want only 77 after decimal point notation.

 

How can i achieve this?

 

Any kind of help will be greatly appriciated.

 

Thanks in advance..

 

Vishal.

 

hey Ragjesh your code helped me a lot but am getting null value in my controller can you suggest me the exact solution of this problem

 

 

here is my code:

Apex Code:

<apex:actionFunction name="sendTimeStamp" action="{!sendTimeStamp}">
    <apex:param name="x" value="x" assignTo="{!timeStampValue}" />
    </apex:actionFunction>

javascript code:

timeStamp = Number(new Date());
          sendTimeStamp(timeStamp);

controller code:


public string sendTimeStamp() 
    {
        return timeStampValue;
    }
    public string timeStampValue{
    get
    {
        timeStampValue = timeStamp;
        return timeStampValue;
    }
    set;}

 please Help me i am newbie in salesforce

 

i dont know where i am making mistakes?

I have a Visualforce Page that displays the Opportunities.

 

<apex:page standardController="Opportunity" tabStyle="Opportunity" extensions="OpportunityViewExtension">
  <apex:form >
    <apex:detail id="mylists" relatedList="true" showChatter="true" relatedListHover="true" />

   ....

</apex:page>

 

One of the fields from the PageLayout is another Visualforce Page.

 

<apex:page standardcontroller="Opportunity" extensions="OpportunityFinancialsEditor">
<style>
body{background-color:rgb(243, 243, 236);}
</style>
    <apex:form >
    <apex:pageblock>
    <apex:pagemessages />
    <apex:pageblocktable value="{!grid}" var="row">
        ...

    </apex:form>
</apex:page>

 

When this gates displayed on my Visualforce Page it simply makes the section blank with scrollbars.  When I display the Page using InternetExplorer it does the same thing, but also tells me there is an error saying that a reference in my Visualforce page that is displayed on the page layout is null.

Is there any to pass to parameters from a javascript to a actionFunction?

For eg  I have a var 'x' in javascript set to some value. On some condition I need to call a actionFunction which calls a controller. I need to pass the value of x to the controller. I can pass using param tag of actionFunction to controller but how to pass x to the actionFunctio?

I am using inputfile component in VF page to upload file bt its working  and giving me error like :

 

 apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute.

 

 

I am using Rerender attribute in VF page ..If I removes that it works fine .

 

Please provide me some input ..

Hi,

I need to put a custom related list on the account detail page and put the Hover link on the top of the page for the custom related list.

 

I was able to do the custom related list displayed on the bottom of the Account detail page wiring a standard controller extension and visula force page.

 

Now the problem is How do I place the Hover link on the top of the page for the custom list? I saw couple of threads for the above, but the hover links issue was never discussed?.

 

Can any one please guide me how can I do this.

 

Thank you.