• puja
  • NEWBIE
  • 125 Points
  • Member since 2012

  • Chatter
    Feed
  • 5
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 27
    Questions
  • 29
    Replies

I am trying to implement online exam functionality in which I would like to restrict user to submit answers till time assigned for that page i.e. 10 minutes.

 

I tried like this in VF page.

<script>
function  myfunction()
    {
     if(c!=0.00)
     {
      var temp;
      temp=setTimeout(function(){alert("You can not submit your answers now ")},1000); 
     
     }
     
     
    
    }
</script>

 This is the syntax for commandButton.

 

<apex:commandButton value="Submit" action="{!submit}" onclick="myfunction();"/>

   But every time when user tries to click on "Submit" button before time end it's allowng to click.

 

I would like to show an alert if user is cliclking on Submit before time end.

 

Could anyone suggest in this case.

 

Thanks,

JaanVivek

 

 

Hi can any one help me on this problem.

In below i have created a task in a specific contact.while i am click the send button in visualforce page the following task will be created and goes to particular contact page whic id we have passed.but i dont want to go my contact page.I want to go my task page which i have previously created in the following code.

here be my sample code.

 

private final Contact contact;

public Task smsTask;

public SendSMSHttpContact(ApexPages.StandardController controller) {
this.contact = (Contact)controller.getRecord();
}

 

public PageReference SendSMS() {

 

smsTask = new Task (Type='SMS',
WhoID = contact.id,
Status = 'Completed',
ActivityDate = System.today(),
Description = msg.replace('%20',' '),
Subject = 'SMS Sent'
);
try {
insert smsTask;
} catch (System.Dmlexception e) {
System.debug('Error: Unable to insert task: ' + e);
}
return new ApexPages.StandardController(contact).view();/*here i am returning to contact page,I want to go task page which i have created*/

}

 

Help??????????

HI.......

Anyone help me to write test case for below Extension controller ,I am facing problem to define contructor in testmethod.

 

public class quickEmailController{

ApexPages.StandardSetController setCon;


public quickEmailController(ApexPages.StandardSetController controller)
{
setCon = controller;
}

public pageReference doSomething()
{
for ( contact acc : (contact[])setCon.getSelected() )
{
}
return null;
}
}

 

thanks in advance.......

 

 

 

Hi Everyone,

 

I am getting the following Err "" Compile Error: set must have exactly 1 type argument at line 1 column 1"

 

 

trigger Test123 on Lead(before insert, before update) {
        //Set<Id,Integer> ownerids=new Set<Id,Integer>();
        
        Set<Id> ownerids=new Set<Id>();
    
//reterving the owner id for the lead
for(Lead l : Trigger.new)
{
        Id ownerId=l.OwnerId;
        ownerids.add(ownerId);
    //User theower1=[SELECT Id, Region__c FROM User where Id = :l.OwnerId];
    //User theowner=[SELECT id,region__c FROM USER WHERE id=l.ownerId];u
}   
List<User> theower1=[SELECT Id, Region__c FROM User where Id IN:ownerids];
Map<Id.User> userownerlead=new Map<Id.User>(theower1);

    
    for(Lead l : Trigger.new)
        l.Region__c=theower1.Region__c;
         l.Region__c=userownerlead.get(l.OwnerId).Region__c;
         
}
}

 

Can u please what is going wroing in my code

thanks for help in advance

Hi,

I want to create thumbnail of the images via image url.

 

Please help

 

Thanks

  • September 18, 2012
  • Like
  • 0

Hi,

Please help me 

I want to display the recent activity from the facebook page in visual force page.

Please help ..its urgent

 

 

 

Thanks

  • July 19, 2012
  • Like
  • 0

Hi,

I have read in net facebook provides the social plugin by which we can display the recent activity in our page .

i have used the code:

 

<apex:page >

<div id="fb-root"></div>
<script>(function(d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (d.getElementById(id)) return;
js = d.createElement(s); js.id = id;
js.src="//connect.facebook.net/en_US/all.js#xfbml=1";
fjs.parentNode.insertBefore(js, fjs);
}(document, 'script', 'facebook-jssdk'));</script>

 


<div class="fb-activity" data-site="[Site URL]" data-width="300" data-height="300" data-header="true" data-recommendations="false" data-max_age="0"></div>

</apex:page>

 

But it is not display the recent activities ....

Please help.

Thanks

  • July 19, 2012
  • Like
  • 0

Hi,

I need an urgent help.

I want to customize salesforce home page of my org.

I want to show 

1).A Banner

2).Chatter Feed

3).Facebook Feed( with aparticular Facebook Page )

4).Custom Link

 

Please help me ....

how i add facebook feed in Home page

 

 

Thanks in advanced

 

  • July 17, 2012
  • Like
  • 0

Hi,

I have a requirement . I want to send mail to 50k contacts through batch .

Please help me ..Can I do this....

Please suggest me some needful....

Please please help......

 

 

Thanks

  • July 12, 2012
  • Like
  • 0

Hi,

I need help ...it's urgent

i have created an VF page in which the email template is dispalyed in drop down .User can select one of the email template and when they select any template a link " template Preview " is appear.

After clicking this link a new vf page is open with a popup which is a standard Email template previe page with url:  /p/email/template/EmailTemplatePreview?preview_template_id=00X30000001I7wS&setupid=EmailTemplates

 

same as a standard salesforce page when we click on the send and varify the merge field button. after click on the ok button they do not go to the another page same as standard salesforce it gives me error 

"Unsafe java script call..."

 

 

Please help

My requirement is when user click on the template previes Link a new popup is open same as standard salesforce when we click on the send and verify the merge field button in email template.

 

 

Thanks 

Plz help

 

  • July 04, 2012
  • Like
  • 0

Hi,

I have a requirement to edit the email template via apex code.

i need to display all the email template name in drop down and when we select one of them and i want to edit that email template through code...

 

please help me because it's very urgent.

  • June 23, 2012
  • Like
  • 0

I want to create a report on case where closedDate >: System.Today().addMonths(-6)

i not able to understand how i add the filter on Closed date as "cosedDate >: System.Today().addMonths(-6)"

 

Please help .It's urgent 

 

Thanks in advanced

  • June 13, 2012
  • Like
  • 0

Hi,

I want to insert data from apex controller into contentVersion .

 

Please help me.

 

Thanks in Advanced.

  • June 12, 2012
  • Like
  • 0

Hi,

 

I want to Update the content of old version.

 

as:

List<ContentVersion> llList = [Select c.VersionNumber,c.Title, c.Description,c.ContentDocumentId From ContentVersion c                                                              where ContentDocumentId = '069U0000000I1j4' and VersionNumber =:'1'];

if(llList != null && llList.size() > 0 ) {
 llList[0].Description = 'Hello This is the Testing';
}
update llList;

 

But it gives an error "You cannot update a version that is not the latest version of a document. Please use the latest version of document"

 

Please help

  • June 12, 2012
  • Like
  • 0

Hi,

 

i want to read the data from the Goole Document Api.I get the name of the Word document from the google doc in my apex controller.But i have no idea about how i read that document file.

 

 

Please help

 

Thanks in advanced.

  • June 06, 2012
  • Like
  • 0

Hi,

 

Can  we subscribed any content via apex code.

 

Please suggest me some needful.

 

 

Thanks in advanced

 

 

 

 

  • June 04, 2012
  • Like
  • 0

Hi,

 

I have a wrapper list which contains an integer value, a product record and a boolean value. 

my requirement is to sort that list according to the product name..

 

please help...its urgent.

 

 

 

 

 

Thanks in advanced

  • May 19, 2012
  • Like
  • 0

Hi,

 

I want to refresh the parent window when close the child window...I have used

 

<body onunload="opener.location=('/{!selectedId}');" >

 

this is work correctly in all browser but not in IE....

 

In IE when we click on the DONE button it is not go back to  the parent window...it is open the new tab/window and refresh the parent window

 

 

please help...

 

 

Thanks

 

  • May 08, 2012
  • Like
  • 0

I created a test class but it gives a compilation error : Error: Compile Error: Invalid type: FeedPost at line 20 column 31

Please Help:

 

@isTest

private class TestChatterPostOnOpprty {

public static testMethod void unitTest() {

Opportunity opp = new Opportunity(
Name='Test',
StageName='Prospecting',
CloseDate=Date.today()
);
insert opp;

FeedItem fd= new FeedItem(
Body = 'aaaaa#nextstep @rrr eeeeeeeeee #nextstep',
parentId = opp.id
);
insert fd;

FeedPost feedPo = new FeedPost(
FeedItemId = fd.Id
);
insert feedPo;

opportunityFeed effdPo = new opportunityFeed(
FeedPostId = feedPo.Id
);
insert effdPo;

List<opportunityFeed> oppFeedList = new List<opportunityFeed>();


}
}

  • May 04, 2012
  • Like
  • 0

Hi,

 

i want to hide Standard page edit button for Partner user....or display a page.

 

 

 

Please help...

Its Urgent

 

 

 

 

 

Thanks

 

  • May 04, 2012
  • Like
  • 0

Hi,

I have a problem ....

 

i have a test class in which the Assert is failed in Production when i deploy the code into the production...but it is correct on the Sandbox...............

 

please help...it's very urgent

 

 

 

 

 

Thanks

Puja

  • May 02, 2012
  • Like
  • 0

Hi,

 

 

.swf File is not playing in salesforce..

 

I have used 

 

var dialogMarkup = '<embed src="'+ downloadURL +'" quality="high" pluginspage="http://www.adobe.com/shockwave/download/download.cgi?P1_Prod_Version=ShockwaveFlash" type="application/x-shockwave-flash" width="1000" height="760"></embed>';

$('.watch-video-dialog .middle').html(dialogMarkup);

 

 

it is not working.....Please help

  • April 25, 2012
  • Like
  • 0

Hi ,

 

 

 

      i have created a trigger by which the customer portal have the Read/Write permission on their own a/c....

 

 

     But when we login from that user ,it not showing the "EDIT" button their a/c record......

 

 

      It's very urgent .

 

 

Thanks

  • April 25, 2012
  • Like
  • 0

Hi,

 

    I have a very strange problem ..I have a button on my Page when i click on that button it is not calling the method ,after that when i click on it again then its calling the method ...............

 

 

Can anyone suggest me what is the actual problem.Please help.....

 

 

 

 

 

Thanks in advanced.

  • April 24, 2012
  • Like
  • 0

I wrote the following trigger, but when it fires I get an error message saying: Apex trigger TagSalesPlanner caused an unexpected exception, contact your administrator: TagSalesPlanner: execution of AfterUpdate caused by: System.ListException: List index out of bounds: 1: Trigger.TagSalesPlanner: line 22, column 1

 

trigger TagSalesPlanner on Opportunity (after update) {

   for (Opportunity opp : Trigger.new) {
    Opportunity OldOpp = Trigger.oldMap.get(opp.ID);
    if ((opp.ProposalApprovers__c == null || (opp.ProposalApprovers__c != OldOpp.ProposalApprovers__c)) && opp.ApprovalStatus__c == 'Approved'){
        
//get list of Approved Opportunities
    List<Opportunity> ApprovedOpps = [SELECT ID, ProposalApprovers__c
                                      FROM Opportunity
                                      WHERE Id in: trigger.new];
    
//get list of related Approval Processes
    List<ProcessInstance> ap = [SELECT ID, TargetObjectID
                                       FROM ProcessInstance
                                       WHERE TargetObjectID in : ApprovedOpps];   
                                       
    List<ProcessInstanceStep> actor = [SELECT ActorID 
                                       FROM ProcessInstanceStep
                                       WHERE ProcessInstanceID in: ap]; 
                                       
    for (Integer i=0; i<actor.size(); i++){
    ApprovedOpps[i].ProposalApprovers__c += actor[i].ActorId;}
    
    update ApprovedOpps;                                                                  
}  
}
}

 Can someone please help me understand what this error message means and what I can do to fix it? Thank you so much!

 

I have a input field--  <apex:inputField value="{!Registration__c.Event__c}" label="Event" id="Event" />

Now i want to fetch the field value before saving the data into database..

I have called a JScript on clicking of save button..

function Check()
{
var data=document.getElementById('page:form:block:section:Event');-->differenrt page level ids
alert("Do you want to register for "+data.value.name+"?");
}

But it is returning "Undefined" !!! I think it is because the data is not saved yet! Please guide...

 

I am trying to implement online exam functionality in which I would like to restrict user to submit answers till time assigned for that page i.e. 10 minutes.

 

I tried like this in VF page.

<script>
function  myfunction()
    {
     if(c!=0.00)
     {
      var temp;
      temp=setTimeout(function(){alert("You can not submit your answers now ")},1000); 
     
     }
     
     
    
    }
</script>

 This is the syntax for commandButton.

 

<apex:commandButton value="Submit" action="{!submit}" onclick="myfunction();"/>

   But every time when user tries to click on "Submit" button before time end it's allowng to click.

 

I would like to show an alert if user is cliclking on Submit before time end.

 

Could anyone suggest in this case.

 

Thanks,

JaanVivek

 

 

I'm getting System.TypeException: DML operation INSERT not allowed on on object that I have created.

The error occurs when running many of the tests with asUser with a profile of "Standard User".

The object  Deployment Status is In Development, and all of the fields are Editable except

CreatedBy, LastModifiedBy, formula fields, and Name which is of type Auto Number

I've had it working before but did a retreive, changed test code and deploy using ant.


I've had similar problem in the past when performing an UPDATE but managed to fix it.

None of the fields are required. Some fields are Lookups but those are not set and not required either.

There are no master-detail types.

 

 

 

 

Hi can any one help me on this problem.

In below i have created a task in a specific contact.while i am click the send button in visualforce page the following task will be created and goes to particular contact page whic id we have passed.but i dont want to go my contact page.I want to go my task page which i have previously created in the following code.

here be my sample code.

 

private final Contact contact;

public Task smsTask;

public SendSMSHttpContact(ApexPages.StandardController controller) {
this.contact = (Contact)controller.getRecord();
}

 

public PageReference SendSMS() {

 

smsTask = new Task (Type='SMS',
WhoID = contact.id,
Status = 'Completed',
ActivityDate = System.today(),
Description = msg.replace('%20',' '),
Subject = 'SMS Sent'
);
try {
insert smsTask;
} catch (System.Dmlexception e) {
System.debug('Error: Unable to insert task: ' + e);
}
return new ApexPages.StandardController(contact).view();/*here i am returning to contact page,I want to go task page which i have created*/

}

 

Help??????????

HI.......

Anyone help me to write test case for below Extension controller ,I am facing problem to define contructor in testmethod.

 

public class quickEmailController{

ApexPages.StandardSetController setCon;


public quickEmailController(ApexPages.StandardSetController controller)
{
setCon = controller;
}

public pageReference doSomething()
{
for ( contact acc : (contact[])setCon.getSelected() )
{
}
return null;
}
}

 

thanks in advance.......

 

 

isUpdateable() - 

Returns true if the field can be edited by the current user, false
otherwise.

Is this a correct syntax ?

if(!CategoryMobileConfig__c.Active__c.getDescribe().isUpdateable()) // FLS 

{

update mobileAppConfig;

}

 

Hi,

I need an urgent help.

I want to customize salesforce home page of my org.

I want to show 

1).A Banner

2).Chatter Feed

3).Facebook Feed( with aparticular Facebook Page )

4).Custom Link

 

Please help me ....

how i add facebook feed in Home page

 

 

Thanks in advanced

 

  • July 17, 2012
  • Like
  • 0

Hi,

I have a requirement to edit the email template via apex code.

i need to display all the email template name in drop down and when we select one of them and i want to edit that email template through code...

 

please help me because it's very urgent.

  • June 23, 2012
  • Like
  • 0

I want to create a report on case where closedDate >: System.Today().addMonths(-6)

i not able to understand how i add the filter on Closed date as "cosedDate >: System.Today().addMonths(-6)"

 

Please help .It's urgent 

 

Thanks in advanced

  • June 13, 2012
  • Like
  • 0

Hi

 

   I am trying to copy the value of a text field(Contact__C)in a custom object to a look up field(TPF_Primary_Contact__c) in a standard object with the following trigger.

 

trigger ContactUpdateonAccount on Customcontact__c(after insert,after update)
{
Map<Id, Customcontact__c> mapcustomcontactByAccountId = new Map<Id, Customcontact__c>();
for (Customcontact__c objcustomcontact: Trigger.new)
{
mapcustomcontactByAccountId.put(objcustomcontact.Account__c,objcustomcontact);
}

if( mapcustomcontactByAccountId.size() > 0)
{
List<Account> lstAccounts = [Select TPF_Primary_Contact__c from Account where ID IN : mapcustomcontactByAccountId.keySet()];
if(!lstAccounts.isEmpty())
{
for(Account objAccount : lstAccounts)
{
Customcontact__c objcustomcontact = mapcustomcontactByAccountId.get(objAccount.Id);
objAccount.TPF_Primary_Contact__c=objcustomcontact.Contact__C;

update objAccount;

}
}
}
}

 

When I use the trigger to update a text field in the standard object it works. But when i try to update look up field with the same trigger it doesn't allow me to save the record and throws the following error when the record in the custom object is saved.

 

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger ContactUpdateonAccount caused an unexpected exception, contact your administrator: ContactUpdateonAccount: execution of AfterInsert caused by: System.StringException: Invalid id: testc: Trigger.ContactUpdateonAccount: line 17, column 1

 

Please advise.

 

Thanks!

Hi,

 

i want to read the data from the Goole Document Api.I get the name of the Word document from the google doc in my apex controller.But i have no idea about how i read that document file.

 

 

Please help

 

Thanks in advanced.

  • June 06, 2012
  • Like
  • 0

Hi,

 

I want to refresh the parent window when close the child window...I have used

 

<body onunload="opener.location=('/{!selectedId}');" >

 

this is work correctly in all browser but not in IE....

 

In IE when we click on the DONE button it is not go back to  the parent window...it is open the new tab/window and refresh the parent window

 

 

please help...

 

 

Thanks

 

  • May 08, 2012
  • Like
  • 0

Hi,

 

    I have a very strange problem ..I have a button on my Page when i click on that button it is not calling the method ,after that when i click on it again then its calling the method ...............

 

 

Can anyone suggest me what is the actual problem.Please help.....

 

 

 

 

 

Thanks in advanced.

  • April 24, 2012
  • Like
  • 0

      

Can anyone help me for implementing this requirement .    

  • Search all Chatter posts for Open Opportunities and identify the most recent that contains “#nextstep”.
  • If a Chatter post is found, strip out the text of that post and update the Opportunity Next Step field with the Chatter text.

 

It's urgent ....i have tried this but i have not understood what is the meaning for text of that Chatter post

 

 

 

Please help...

 

Thanks in advanced

  • April 21, 2012
  • Like
  • 0

hey i am trying to see the test vf page of the integration with facebook

and i am getting a black page

i am filling the facebookapplist object with the appkey and the appsecret values and after

trying to load the vf test page all the rest of the fields in the facebookapplist are filled with values (the values which equals to the facebook application like the app_id)

 

 

maybe the problem is that monthly_active_users = 0 or weekly_active_users = 0 or  daily_active_users = 0

 

if you have any suggestions it would be very helpful

 

thanks 

  • March 24, 2009
  • Like
  • 0