• dev401has
  • NEWBIE
  • 125 Points
  • Member since 2010

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 26
    Questions
  • 59
    Replies

This is the scheduler we have:

 

global class ScheduleImportData implements Schedulable {
   
    global void execute(SchedulableContext context) {
       ImportExcelWebservice.getExcelDetails();
    }

}

 

 

We need to write test class.  How can we write we need to do this by today end!

Currently examining an update that we want to make to our system where daily, our system checks the date of particular items, and if they're past the current date, an action is ran. I've been looking into batch apex and some other features of SF trying to determine what may be the best route for this, and was curious as to whether batch apex would be the best route for this? Can anyone shine some possible light on what the best instances are to use batch apex?

 

Thanks!

Condition:

  • When any event is synced from Outlook to Salesforce it gets synced properly in Salesforce on base of the subject and time. i.e. if an event with same subject and time is present, it updates that event or creates a new one.
  • What if two Users are using Salesforce for Outlook and both are having same event at same time say 1PM. So when events are synced from Outlook to Salesforce, will Salesforce be able to detect the same event and update the event accordingly to keep only 1 event or 2 separate events will be created?

Also if single event is created then 'assigned to' field in event will be populated by which user?

Hi All,

 

I have a workflow on Opportunity object with evaluation criteria: "When a record is created, or when a record is edited and did not previously meet the rule criteria".

In the rule I check that I am checking one boolean field  (xyz__c) whether it is set as true or not and then I send a notification.

 

Condition1: When I update the record by changing some field value, (when that boolean xyz__c = true) then the workflow does not fire and that is fine as per the conditions.

 

Condition 2: When i update the account Lookup for the Opportunity (still xyz__c = true) then the workflow should not fire but its not the case. This time workflow fires. This is a strange situation only for Account lookup field.

 

Has anyone come across anything as such?

Hello

 

I have issue with exporting to excel using Visualforce:

 

I am having around 30 columns and around 1000 records....

 

When I click on export to excel button then it shows error - "unable to read file". Then when we open that file then data is present but it shows that error of unable to read file.

 

Also if I reduce the records by limiting the query to 500 then I don't get the error. If I keep all records and reduce the columns to 4 or 5 then also error does not come but if I keep all columns and all records then error is coming...

 

VF page line:

<apex:page controller="CONTROLLER" contentType="application/vnd.ms-excel#FILENAME.xls" cache="true">

 

Has anyone faced anything like this?? I came across few blogs and few communities but found no alternative that solves my problem.

 

 

Hi All

 

I would like to replicate the dashboard component functionality on homepage.

 

I can get the list of dashboards available but on selection of a dashboard it should be visible in the component I have prepared.

 

I have to restrict few dashboards and have done some customization hence i have gone for my own component and cannot use the standard dashboard snapshot component in home page.

 

I went through a link (http://boards.developerforce.com/t5/General-Development/Dashboard-to-PDF/td-p/304139) which says about having the charts in visualforce pages but i want it in dynamic format.

 

Can anyone having prior worked on something like this provide any help?

Hi

 

I was checking out the application Contact Viewer.

I took the code from https://github.com/ForceDotComLabs/Contact-Viewer

And also performed all the steps mentioned there.

 

Now once i go back and hit the URL of my site, then instead of the application I get the following error:

error=redirect_uri_mismatch&error_description=redirect_uri%20must%20match%20configuration

 

I check out few things. The redirecturi is coming null in the URL and hence this error is coming. 

redirectUri is equivalent to the callback URL provided in the Remote access detail and i have provided the same (Call back URL = my force.com site's address).

 

Can anyone guide me as to how to solve this error?

I have a standard page on which I have kept a custom button.
On click of custom button it opens a visualforce page in same window. When I fill in the values in that and click on save button then as per my pagereference method it should redirect back to that standard deal page and it does.

But the URL at top does not change and on click of refresh in browser it directs me back to that visualforce page.

Why is URL at top not changing?

 

pageref= new Pagereference ('/' + customobject.Id);
pageref.setRedirect(true);
return pageref;

 

 

Scenario: To make components appear and hide using the 'rendered' attribute on base of a selected value in picklist. 

 

I have used an ouput panel around the pageblocksectionItem to be shown and hidden, and by using the id of the output panel in the 'reRender' attribute of the action support.

 

but by using OutputPanel the aligment is distrurbed and even the outputlabel is not coming in bold as it should be with standard functionality.

 

can anyone provide solution without using OutputPanel or keep the styling same as Salesforce even using OutputPanel?



Hi All,

 

I have a requirement where I need to serialize batch apex.

I came across this link in cookbook: http://developer.force.com/cookbook/recipe/serialize-batch-apex

 

This is a good example but I have a concern regarding passing parameters in the batch apex.

In the example the queries in Start method are simple with Limit 1000. I have to query with where condition of ID. I wil get ID value in first batch apex but while calling second batch apex i wont get that ID as it will become null. How can i pass the ID from one batch apex to another? or is there any other method where we can keep that ID as global and use in batch apex?

 

 

Hi

 

I can upload my attachment to myFiles in chatter using API.

 

Can anyone help me out how to associate the attached files with record i.e. share them with a record using API.

 

this will be a great help to me.

When will Force.com IDE version 21 be available for Eclipse?

 

I found it nowhere. Is it available then can anyone post the link from where i can update it?

 

I went to check updates from force.com startup page in eclipse but i am not getting the latest IDE.

 

I want to use contentdocumentLink object released in spring11 which is available for API version 21 but cannot use it in eclipse because of IDE version 20.

Hi

 

I am uploading document in a workspace from a visualforce page. It works fine for the user who is having access to workspace but when some other user who does not have access to that workspace tries to upload it then it gives error

 

Is there any way we can add user as member to workspace using API/Code?

Hi

 

I have created a chatter group (Collaboration type is public). I am trying to post a feed into that using a trigger

 

the trigger goes like this:

 

trigger postfeed on  custom_object__c(after insert) {

    for(custom_object__c c: trigger.new)
    {
       try
       {
            FeedPost fpost = new FeedPost();
         // fpost.Type = 'TextPost';
            fpost.ParentId = chattergroup.Id;
            fpost.Body = 'Feedpost to be posted in chatter group';
            insert fpost;
       }

    }

}

 

 

and it works for system admin (owner of that chatter group).

 

but when i log in using another user having different profile (the profile has access to that custom object and user is member of that Chatter group) then it gives following error:

 

 

04:20:11.963|DML_BEGIN|[25]|Op:Insert|Type:FeedPost|Rows:1
04:20:12.625|DML_END|[25]
04:20:12.625|EXCEPTION_THROWN|[25]|System.DmlException: Insert failed. First exception on row 1; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
04:20:12.626|METHOD_ENTRY|[29]|ApexPages.addMessages(APEX_OBJECT)
04:20:12.626|VF_PAGE_MESSAGE|Insufficient Privileges
04:20:12.626|METHOD_EXIT|[29]|ApexPages.addMessages(APEX_OBJECT)

 

 

Can anyone help me out on how to get rid of this access error?

Is there anything like we need to give access to chatter group for some profiles???

 

Hi All

 

I am preparing a Visualforce page which is having a dependent picklist i.e Picklist A (Controlling picklist) and Picklist B (Dependent picklist). There is one more textarea field which is supposed to be rendered/visible only when there is a specific value in dependent picklist i.e picklist B.

 

I am facing the problem in rendering the textarea field.

Extension:

 

 

public boolean check;
public boolean isCustom{
        get{
            check=false;
            if(dependent picklist val == 'specific_val')
            {
                check = true;
                system.debug('check-------->'+check);
            }   
            else
            {
                check=false;
            }
            return check ;
           }
           set;
        
    }

 

Visualforce page:

 

<apex:pageBlockSectionItem >
<apex:outputLabel > dependent picklist </apex:outputLabel>
<apex:inputField value="{!dependentpicklist}" id="etype" >
<apex:actionSupport event="onchange" reRender="cust, atp"/>
</apex:inputField>
</apex:pageBlockSectionItem>    
<apex:pageBlockSectionItem >
<apex:pageBlockSectionItem id="cust" rendered="{!isCustom}" >
<apex:outputLabel > Custom textarea </apex:outputLabel>
<apex:inputField value="{!textarea}" id="atp"/>
</apex:pageBlockSectionItem>

 

 

 

I am unable to find where the error is.

I checked in debug logs that when its a specific value in the picklist then boolean value check is getting true but in rendered its not working.

Hi

 

I have prepared two dependent picklist

Picklist A (1, 2) controls Picklist B (3, 4, 5)

Picklist B controls Picklist C (6, 7, 8, 9)

 

Its working fine on normal page layout and Visualforce page if i display picklist A.

but i dont want Picklist A to be displayed on page. I am calculating its value at back end in Apex and updating it.

but then picklist B and C are not working as expected.

 

I dont want to display picklist A and want Picklist B and C to function properly as expected!

 

Any solutions?

Can i write savepoint in one method and rollback in other method?

 

I am having a visualforce page and on call of one method i am setting savepoint and then few records are inserted and updated then later on click of a button it calls another method which should rollback the changes.

 

If I declare savepoint inside a method then it gives error for variable does not exist in rollback and if it is declared outside then it gives error of System.SerializationException: Not Serializable: System.Savepoint

Hi

 

I am having two extensions for two different visualforce pages.

In extension class 1 i am having a list which I want to use in extnsion class 2.

How can i retrieve the values of that List in extension class 2?

 

I declared that list as global in extension 1 and tried to use it but it always comes null.

In what other ways can i get that values in extension 2?

 

Looking forward to your expert solutions.

Hi All,

 

I have a situation where I am not able to figure out what is going wrong with my rendered attribute.

 

I have a picklist field in my object which has values like PDF, Excel, Word etc.

 

I am simply firing a query on that object. Retrieving all the records based on condition and displaying them on Visualforce page using <apex:outputlink> under <apex:repeat>

I simply want is that it should display icon PDF if value for record is PDF and Excel icon if value for record is Excel

 

code:

<apex:repeat value="{!List}" var="c" id="theRepeat" >

<apex:image value="{!URLFOR($staticresource, 'folder/pdf.jpg')}" rendered="{!c.picklistfield__c=='PDF'}" />

<apex:image value="{!URLFOR($staticresource, 'folder/excel.jpg')}" rendered="{!c.picklistfield__c=='Excel'}" />

<apex:outputLink value="{!c.url__c}" >

{!c.Name}

</apex:outputLink>

</apex:repeat>

 

This works very well in Visualforce page but when i use this page in Force.com Site then rendered portion is not working.

If I directly use rendered = true then it works in site.

I want to add Caption above PageBlockTable.

 

Now the situation is that I am having List of List coming from extension. On my VF page I am using repeater and in that I am using Pageblock table. So repeater repeats pageblock table as many times there are lists in the main list and then pageblock table displays data of those lists. So how to add caption over each Pageblock Table.

 

I tried using <apex:facet name="caption"> but of no use. I have a list of values so cannot get caption.

 

I hope I have explained my criteria clearly. Any solution on this??

Hi


I am trying to get some data from a list to Page block table in VF page.

I have used an OUTPUT PANEL outside and in that I have kept PageBlock Table.


As the record keep on varying the size of Pageblock table varies. I want the size to remain static. If the no. of  records increase then scrollbars should come instead of increased size of pageblock table. (Lets say it should display 10 records only. If more than 10 records are there then scroll bars should come)


I tried keeping Output Panel layout as 'block' and assigning fixed height to it but it does not work exactly when there are many records.


Can anyone provide insight whether how to get the size of Pageblock table or output panel to remain same despite varying no. of records??

Or in any other way this can be done?

Hi

 

I have prepared a site http://nbcuni.force.com/commops

My Force.com domain name is nbcuni.force.com

 

I have prepared a robots.txt file (VF page which allows all bots) and uploaded it in Site Robots.txt.

That robots.txt is visible at http://nbcuni.force.com/commops/robots.txt infact it should be visible at http://nbcuni.force.com/robots.txt  (in domain)

 

In Google Webmaster tools the bot crawls at http://nbcuni.force.com/robots.txt and are unable to find the file hence give crawl error (503)

 

How to get Robots.txt at the http://nbcuni.force.com/robots.txt

Hi All,

 

I have a workflow on Opportunity object with evaluation criteria: "When a record is created, or when a record is edited and did not previously meet the rule criteria".

In the rule I check that I am checking one boolean field  (xyz__c) whether it is set as true or not and then I send a notification.

 

Condition1: When I update the record by changing some field value, (when that boolean xyz__c = true) then the workflow does not fire and that is fine as per the conditions.

 

Condition 2: When i update the account Lookup for the Opportunity (still xyz__c = true) then the workflow should not fire but its not the case. This time workflow fires. This is a strange situation only for Account lookup field.

 

Has anyone come across anything as such?

Hello

 

I have issue with exporting to excel using Visualforce:

 

I am having around 30 columns and around 1000 records....

 

When I click on export to excel button then it shows error - "unable to read file". Then when we open that file then data is present but it shows that error of unable to read file.

 

Also if I reduce the records by limiting the query to 500 then I don't get the error. If I keep all records and reduce the columns to 4 or 5 then also error does not come but if I keep all columns and all records then error is coming...

 

VF page line:

<apex:page controller="CONTROLLER" contentType="application/vnd.ms-excel#FILENAME.xls" cache="true">

 

Has anyone faced anything like this?? I came across few blogs and few communities but found no alternative that solves my problem.

 

 

For example,there is a text field like total marks,secured marks and percentage.
if i enter total marks =1000, and secured marks=781 and it automatical generate the field like 78.1% in percentage field.
we are able to do this after clicking on save button,but i wanna do this on screen an user can see it,when he clicks a tab button...

do u got it what i am saying.......??

 

Scenario: To make components appear and hide using the 'rendered' attribute on base of a selected value in picklist. 

 

I have used an ouput panel around the pageblocksectionItem to be shown and hidden, and by using the id of the output panel in the 'reRender' attribute of the action support.

 

but by using OutputPanel the aligment is distrurbed and even the outputlabel is not coming in bold as it should be with standard functionality.

 

can anyone provide solution without using OutputPanel or keep the styling same as Salesforce even using OutputPanel?



Hi,

 

I have three objects, Account, Contact, Merge_Account_Contact(It has all the contact fields and one account name field)

When i create new Account and its related Contacts, trigger event should occur and Merge_Account_Contact should be Created.

One account has many contacts. So i am confused how to retrive those values and save into the Merge_Account_Contact.


It would be greate if anyone helps me in writting this trigger.


Thanks in advance.

Cheers,
Devendra S 

This is the scheduler we have:

 

global class ScheduleImportData implements Schedulable {
   
    global void execute(SchedulableContext context) {
       ImportExcelWebservice.getExcelDetails();
    }

}

 

 

We need to write test class.  How can we write we need to do this by today end!

Hi,

 

I would like to know who are the members of a workspace (library), how can i know this via a soql query?

Currently examining an update that we want to make to our system where daily, our system checks the date of particular items, and if they're past the current date, an action is ran. I've been looking into batch apex and some other features of SF trying to determine what may be the best route for this, and was curious as to whether batch apex would be the best route for this? Can anyone shine some possible light on what the best instances are to use batch apex?

 

Thanks!

I have a visualforce page in which user will specify time in seconds(say 180seconds) and using this time , a class should run in intervals of the specified time. That is it should run for every 3 minutes if  the user enters 180 seconds in visualforce page and saves. In that class I use call outs to fetch data from external database and update it here. Can you please provide me a solution for this scenario?

Hi!

 

When I create an event for multiple contacts as attendees, I have two possibilities for save this record "Save" and "Save & Send update". I want to hide the "Save & Send Update" but I don´t know where I can do it. In the form there is not this button and I don't want users create events for multiple contacts and send e-mails to them until someone read it and confirmed that it's OK.

 

Regards,

Silvina

Hi,

 

Here, I have an object, in which there are 2 lookup fields, Account and CustomObject__c. CustomObject__c is a filtered lookup and its value depends on the value of Account Lookup value.

 

I am using both Account and Filtered Lookup in VF page. Because of the CustomObject__c field, if I perform any AJAX call from the VF page irrespective of the rerender attribute, whole page gets rerendered and focus always goes back to first input field.

 

How can I eliminate rerendering of the whole page and focus change?

 

Thanks,

Sunil

Hi,

 

Actually I am displaying the accounts one page block table on visual force page and i keep the command link for account name. If i click on that command link it will display the related contacts in another page block of same visual force page.

 

 

Now My requirement is, i want to display the contacts after the account name if i click on the account name. It is not mandotary to use the pageblock. How can i display the contacts after the account name if i click on the account name.  Any one please help me how to solve this.

 

Thanks,

 

Lakshmi

 

 

Hi

 

I have created a chatter group (Collaboration type is public). I am trying to post a feed into that using a trigger

 

the trigger goes like this:

 

trigger postfeed on  custom_object__c(after insert) {

    for(custom_object__c c: trigger.new)
    {
       try
       {
            FeedPost fpost = new FeedPost();
         // fpost.Type = 'TextPost';
            fpost.ParentId = chattergroup.Id;
            fpost.Body = 'Feedpost to be posted in chatter group';
            insert fpost;
       }

    }

}

 

 

and it works for system admin (owner of that chatter group).

 

but when i log in using another user having different profile (the profile has access to that custom object and user is member of that Chatter group) then it gives following error:

 

 

04:20:11.963|DML_BEGIN|[25]|Op:Insert|Type:FeedPost|Rows:1
04:20:12.625|DML_END|[25]
04:20:12.625|EXCEPTION_THROWN|[25]|System.DmlException: Insert failed. First exception on row 1; first error: INSUFFICIENT_ACCESS_ON_CROSS_REFERENCE_ENTITY, insufficient access rights on cross-reference id: []
04:20:12.626|METHOD_ENTRY|[29]|ApexPages.addMessages(APEX_OBJECT)
04:20:12.626|VF_PAGE_MESSAGE|Insufficient Privileges
04:20:12.626|METHOD_EXIT|[29]|ApexPages.addMessages(APEX_OBJECT)

 

 

Can anyone help me out on how to get rid of this access error?

Is there anything like we need to give access to chatter group for some profiles???

 

Can i write savepoint in one method and rollback in other method?

 

I am having a visualforce page and on call of one method i am setting savepoint and then few records are inserted and updated then later on click of a button it calls another method which should rollback the changes.

 

If I declare savepoint inside a method then it gives error for variable does not exist in rollback and if it is declared outside then it gives error of System.SerializationException: Not Serializable: System.Savepoint

Hi


I am trying to get some data from a list to Page block table in VF page.

I have used an OUTPUT PANEL outside and in that I have kept PageBlock Table.


As the record keep on varying the size of Pageblock table varies. I want the size to remain static. If the no. of  records increase then scrollbars should come instead of increased size of pageblock table. (Lets say it should display 10 records only. If more than 10 records are there then scroll bars should come)


I tried keeping Output Panel layout as 'block' and assigning fixed height to it but it does not work exactly when there are many records.


Can anyone provide insight whether how to get the size of Pageblock table or output panel to remain same despite varying no. of records??

Or in any other way this can be done?

I read on the board that the solution to aligning fields using outputLabel and selectOption is to put them inside a pageBlockSectionItem.  However, my code already is inside a pageBlockSectionItem, but is rendering left aligned and with the labels not bold.  I'm using an outputPanel as well, as I'm wondering if that is the problem?

 

Here is version 1 of the code:

 

<apex:page standardController="Call_Meeting_Report__c" extensions="ReportSearchController" showHeader="true" sidebar="true" action="{!loadDefaults}">
<apex:form >
<apex:pageBlock title="Call/Meeting Report" mode="edit" id="thePageBlock">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Cancel" action="{!cancel}" immediate="true"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2">
<apex:inputField value="{!Call_Meeting_Report__c.Account__c}" >
<apex:actionSupport event="onChange" action="{!getDetails}" rerender="Choose" />
<apex:actionSupport event="onkeyup" action="{!getDetails}" rerender="Choose"/>
<apex:actionSupport event="onclick" action="{!getDetails}" rerender="Choose"/>
</apex:inputField>
<apex:inputField value="{!Call_Meeting_Report__c.Date__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Type__c}"/>
<apex:pageBlockSectionItem >
<apex:outputPanel id="Choose">
<apex:outputLabel value="Choose Opportunity "/>
<apex:selectList value="{!Call_Meeting_Report__c.Opportunity__c}" id="opps" size="1">
<apex:selectOptions value="{!Opps}"/>
</apex:selectList>
<p/>
<apex:outputLabel value="Choose Contact "/>
<apex:selectList value="{!Call_Meeting_Report__c.Primary_Contact__c}" id="conts" size="1">
<apex:selectOptions value="{!Conts}"/>
</apex:selectList>
<p/>
</apex:outputPanel>
</apex:pageBlockSectionItem>
<apex:inputField value="{!Call_Meeting_Report__c.Purpose__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Other_people_present__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Discussion__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Next_actions__c}"/>
<apex:pageBlockSectionItem />
</apex:pageBlockSection>
</apex:pageBlock>

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

(Sorry about the tabbing, looks fine in eclipse).

 

I tried putting the outputPanel outside of the pageBlockSectionItems in version 2:

 

 

<apex:page standardController="Call_Meeting_Report__c" extensions="ReportSearchController" showHeader="true" sidebar="true" action="{!loadDefaults}">
<apex:form >
<apex:pageBlock title="Call/Meeting Report" mode="edit" id="thePageBlock">
<apex:pageMessages />
<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}"/>
<apex:commandButton value="Cancel" action="{!cancel}" immediate="true"/>
</apex:pageBlockButtons>
<apex:pageBlockSection columns="2">
<apex:inputField value="{!Call_Meeting_Report__c.Account__c}" >
<apex:actionSupport event="onChange" action="{!getDetails}" rerender="Choose" />
<apex:actionSupport event="onkeyup" action="{!getDetails}" rerender="Choose"/>
<apex:actionSupport event="onclick" action="{!getDetails}" rerender="Choose"/>
</apex:inputField>
<apex:outputPanel id="Choose">
<apex:pageBlockSectionItem>
<apex:outputLabel value="Opportunity "/>
<apex:selectList value="{!Call_Meeting_Report__c.Opportunity__c}" id="opps" size="1">
<apex:selectOptions value="{!Opps}"/>
</apex:selectList>
</apex:pageBlockSectionItem>
<p/>
<apex:pageBlockSectionItem>
<apex:outputLabel value="Contact "/>
<apex:selectList value="{!Call_Meeting_Report__c.Primary_Contact__c}" id="conts" size="1">
<apex:selectOptions value="{!Conts}"/>
</apex:selectList>
</apex:pageBlockSectionItem>
<p/>
</apex:outputPanel>
<apex:inputField value="{!Call_Meeting_Report__c.Date__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Type__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Purpose__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Other_people_present__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Discussion__c}"/>
<apex:inputField value="{!Call_Meeting_Report__c.Next_actions__c}"/>
<apex:pageBlockSectionItem />
</apex:pageBlockSection>
</apex:pageBlock>

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

 but got the same result.  I must be missing something - can anyone advise?

 

 

 

 

  • February 01, 2010
  • Like
  • 0