• Abhishek_Pareek
  • NEWBIE
  • 115 Points
  • Member since 2011
  • Consultant
  • Appirio

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 22
    Replies
Someone else created a class and test class that works fine: CRequestForm_SearchController and CRequestForm_SearchController_test.
I made some edits to the class in sandbox, and copied the test class, so now I have a new class and a new test class: TESTCRequestForm_SearchController and TESTCRequestForm_SearchController_test. But I can't push it to production because the code coverage is only 68%. I have mannually tested it as an end-user and it works fine. Can anyone please help?
I have a visualforce page with a standard controller which creates a new record on click of my commandButton. This function works using just standard controllers at the moment.

What I would like to do if insertion is successful, to redirect the page to my own custom detail page (mysite.force.com/detailPage?id=) instead of the salesforce's default one. I need to also pass the ID parameter of the newly created record so I can pull up the infomation on the page.
Hi,

I've created a new button so that I can convert Leads when they have a Time Based workflow running. However, I'm getting an error when click the button:

"Unexpected Token ILLEGAL" 

The code for my OnClick JavaScript button is:

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject(“Lead”);
c.id =”{!Lead.Id}”;
c.Cancel_Time_Based_Workflow__c = “TRUE”;
newRecords.push(c);
result = sforce.connection.update(newRecords);

window.parent.location.href=”/lead/leadconvert.jsp?id={!Lead.Id}&RetURL=/{!Lead.Id}”;



This happens when I actually click on the Convert button.

Thanks,
Jag
I have a trigger that I want to change the substatus based on the profile of the Case Owner field.  This is what I have, but its not updating the Substatus and I'm not sure if this (objCase.Owner.Profile.Name) is right.  Any help would be grately appreciated.

trigger CW_Update_Substatus_based_on_Case_Owner on Case (before update)
{
    for (Case objCase : Trigger.new)
    {
        if (objCase.Owner.Profile.Name == 'CW Dealer Portal User')               
        {
            objCase.Substatus__c = 'Open with Dealer';
        }else{
            if (objCase.Owner.Profile.Name == 'CW MineStar Support - Tier 2')               
            {
            objCase.Substatus__c = 'Open with Support Advocates';
            }
            else
                {
                objCase.Substatus__c = 'Open with Product Specialists';
                }
    }        }
}
  • October 02, 2014
  • Like
  • 0
I have two custom tables Produce_Order__c is a parent to Produce_Order_Item__c.

If I put in the <apex:detail /> component. I see the related list for the child records. If I put in <apex:relatedList > I get a Visualforce Error that it is not a valid child relationship name for entity Produce Order. I have tried a dozen different options for <apex:relatedList list="Child LIst" > with always the same error. 

Here is a snippet of my code.

<apex:page standardController="Produce_Order__c" sidebar="false" >
    <apex:sectionHeader title="{!Produce_Order__c.Name} - {!Produce_Order__c.Pickup_Date__c}" subtitle="{!Produce_Order__c.Pickup_Site__r.Name}" />
    <apex:pageBlock title="{!Produce_Order__c.Farmers_Market_Producer__r.Name}" >
        <apex:pageblockSection columns="1">
            <apex:relatedList list="Produce Order Items"/ >
        </apex:pageblockSection>
    </apex:pageBlock>
</apex:page>

Thanks!
Q:I have created new pagelayout ON LEAD and given all standard buttons and Required field to that page layout and assigined to user profile,but when user login and converting to lead..the lead convert button not apper on pagelayout and he is unable to convert lead.!

How to give permission to user to convert the lead.if any proceduce is theire..

plz any one can help me..........!
  • October 08, 2014
  • Like
  • 0
Error Error: Apex class 'LoginAuthentication' does not exist
Quick Fix Create Apex class 'public with sharing class LoginAuthentication'
Quick Fix Create Apex class 'public class LoginAuthentication'




2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105

<apex:page sidebar="false" showheader="false" tabStyle="Employee__c" controller="LoginAuthentication">
<apex:form >
  <apex:pageMessages />
  <apex:pageBlock >
   <div align="left">
    <!-- <apex:image value="{!$Resource.Emplyee_VF_Logo}" style="margin-left:20px"/> -->
    <apex:image url="{!URLFOR($Resource.Emplyee_VF_imgs, 'images/Employees.jpg')}"/>
   </div>
   <div align="center">
    <apex:outputLabel value="Employee Login" style="font-weight:bold;font-size:25px;color:#B80000"/>   
   </div>
   <hr/><br/><br/>
   <apex:pageBlockSection columns="1" title="Please enter your username and password" collapsible="false">
    <apex:pageBlockSectionItem >
     <apex:outputLabel value="Username"/>
     <apex:inputtext value="{!username}"/>
    </apex:pageBlockSectionItem>
    <apex:pageBlockSectionItem >
     <apex:outputLabel value="Password"/>
     <apex:inputsecret value="{!password}"/>
    </apex:pageBlockSectionItem>   
   </apex:pageBlockSection>
   <apex:panelGrid columns="3" style="margin-left:60px">
    <apex:commandButton value="Login" action="{!loginCheck}"/>
    <apex:commandButton value="Cancel"/>
    <apex:commandButton value="Register"/>
   </apex:panelGrid>
  </apex:pageBlock>
</apex:form>
</apex:page>
Someone else created a class and test class that works fine: CRequestForm_SearchController and CRequestForm_SearchController_test.
I made some edits to the class in sandbox, and copied the test class, so now I have a new class and a new test class: TESTCRequestForm_SearchController and TESTCRequestForm_SearchController_test. But I can't push it to production because the code coverage is only 68%. I have mannually tested it as an end-user and it works fine. Can anyone please help?
I have a visualforce page with a standard controller which creates a new record on click of my commandButton. This function works using just standard controllers at the moment.

What I would like to do if insertion is successful, to redirect the page to my own custom detail page (mysite.force.com/detailPage?id=) instead of the salesforce's default one. I need to also pass the ID parameter of the newly created record so I can pull up the infomation on the page.
Hi,

I've created a new button so that I can convert Leads when they have a Time Based workflow running. However, I'm getting an error when click the button:

"Unexpected Token ILLEGAL" 

The code for my OnClick JavaScript button is:

{!REQUIRESCRIPT("/soap/ajax/20.0/connection.js")}
var newRecords = [];
var c = new sforce.SObject(“Lead”);
c.id =”{!Lead.Id}”;
c.Cancel_Time_Based_Workflow__c = “TRUE”;
newRecords.push(c);
result = sforce.connection.update(newRecords);

window.parent.location.href=”/lead/leadconvert.jsp?id={!Lead.Id}&RetURL=/{!Lead.Id}”;



This happens when I actually click on the Convert button.

Thanks,
Jag
Hi,
I want to refresh the form after click the Save button . There is method called in save button then i want to refresh th form.


Can any one help me out for this........




Thanks,
sarvesh.
Hello Everyone,

Trying to write the trigger using handler class.I am getting below error
nitial term of field expression must be a concrete SObject: LIST<Account> at line 7 column 6

Below is the intinal code

TRIGGER CLASS

trigger AccountTestTrigeer on Account (before insert, before update) {
    AccountTestTrigeerhandler handler = new AccountTestTrigeerhandler();
   
    if( Trigger.isInsert && Trigger.isbefore )
    {
        handler.OnAfterInsert( Trigger.New );
    }

}
####################



CALLING TRIGGER FROM THE BELOW CLASS.
public without sharing class AccountTestTrigeerhandler

{
  Account oAccount= new Account();
  public void OnAfterInsert()
  {
     oAccount.Industry = 'Cloud Computing';
  }
}

Thanks for the help
what is future annotation?how it works
I have a trigger that I want to change the substatus based on the profile of the Case Owner field.  This is what I have, but its not updating the Substatus and I'm not sure if this (objCase.Owner.Profile.Name) is right.  Any help would be grately appreciated.

trigger CW_Update_Substatus_based_on_Case_Owner on Case (before update)
{
    for (Case objCase : Trigger.new)
    {
        if (objCase.Owner.Profile.Name == 'CW Dealer Portal User')               
        {
            objCase.Substatus__c = 'Open with Dealer';
        }else{
            if (objCase.Owner.Profile.Name == 'CW MineStar Support - Tier 2')               
            {
            objCase.Substatus__c = 'Open with Support Advocates';
            }
            else
                {
                objCase.Substatus__c = 'Open with Product Specialists';
                }
    }        }
}
  • October 02, 2014
  • Like
  • 0
Hi folks,
        Can anyone give me the real time example for apex REST callout

I wanna like 
enpoint url and apex code for real time apex callout


Thanks in advance
Karthick
Hi All,

I created an Object Pint for Payroll Integration, it will show account information and payroll date etc.. We want the Pint to be self generated 5 business days before the payroll date. Say for biweekly payroll. Is there a way to do that? What trigger shall I use? Any suggestion appreciate. 

I am making a table with dyanmic value in vfpage & in one cell I want to show difference of two value but I tried the below thing but it shows in error as syntax error .

I tried the folllowing things to get difference....

value = {! ( {!Firstvalue} - {!Secondvalue} )}

but it prints the value as 5000-3000 not the difference of this as 2000.

Please tell me how can I do this...