-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
3Questions
-
2Replies
i am writing class account and contact insert record. same class i write the test class but not code coverage 100% . were i am miss the logic
class
---------------
public class textex2 {
public string lastname ;
public string phone;
public void create(){
if(phone == '123'){
account acc = new account();
acc.name = lastname;
acc.Phone = phone;
insert acc;
}else{
contact c = new contact();
c.lastname = 'test1';
c.phone = '0223';
insert c;
}
}
}
------------------------
test
@istest
public class testclassex2 {
@istest
static void testdata2(){
textex2 ts = new textex2();
ts.lastname = 'test1';
ts.phone = '125';
ts.create();
if(ts.phone == '123'){
integer count = [select count() from account];
system.assertEquals(count, 1);
}
ts.phone ='0234';
ts.create();
if(ts.phone != '123'){
integer size = [select count() from contact];
system.assertEquals(size,1);
}
}
}
---------------
public class textex2 {
public string lastname ;
public string phone;
public void create(){
if(phone == '123'){
account acc = new account();
acc.name = lastname;
acc.Phone = phone;
insert acc;
}else{
contact c = new contact();
c.lastname = 'test1';
c.phone = '0223';
insert c;
}
}
}
------------------------
test
@istest
public class testclassex2 {
@istest
static void testdata2(){
textex2 ts = new textex2();
ts.lastname = 'test1';
ts.phone = '125';
ts.create();
if(ts.phone == '123'){
integer count = [select count() from account];
system.assertEquals(count, 1);
}
ts.phone ='0234';
ts.create();
if(ts.phone != '123'){
integer size = [select count() from contact];
system.assertEquals(size,1);
}
}
}
-
- Giri Kumar B
- January 16, 2017
- Like
- 0
- Continue reading or reply
want to override vf page to Standard Salesforce.com Page for link buttons but dont know how to remove vf page from default
I want to over ride to Standard Salesforce.com Page which was earlier set to vf page but after making the change on clicking save the changes gone. It again set to vf page. Also, the default is set to the same vf page .any help how we can change to Standard Salesforce.com Page or change the default value in override properties.
Thanks in advance.
Thanks in advance.
-
- Adam Gilchrist
- January 09, 2017
- Like
- 0
- Continue reading or reply
I need to change the record type name but before that i need check in what components it has been used.
I have to change the record type name but i do not know in what components it has been used. Is there any way to find the usage of a particular record type in all the components of the org. for example workflows Approval process validation rule etc.
-
- Adam Gilchrist
- December 14, 2016
- Like
- 0
- Continue reading or reply
rendered text input field value not getting saved(sometimes) on vf page
I have 4 comments field which rerender on the value of corresponding picklist value. The problem is the value of these 4 comment fields sometimes gets saved some times not. If i have given vaue in all 4 comments then randomly any of them showed blank after save.
I have added the code.
Any help?
I have added the code.
Any help?
VF Page <apex:page standardController="FA_Attestation__c" extensions="FAAttestation2"> <apex:form > <font size = "3"> <b> <center>DaVita Hospital Services Arrangements Performance Monitoring Attestation </center> </b> </font> <br/> <apex:pageBlock > <apex:pageBlockButtons > <apex:commandButton value="Save form" action="{!saveform}"/> </apex:pageBlockButtons> <apex:pageBlockSection > <apex:pageBlockSectionItem > <apex:outputLabel value="1. Do you understand the scope of services required to be provided to this hospital under the HSA?" /> <apex:actionRegion > <apex:outputField value="{!FA_Attestation__c.best_of_your_knowledge_and_belief__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.best_of_your_knowledge_and_belief__c}" required="True" rendered="{!ISNULL(FA_Attestation__c.id)}" > <apex:actionSupport event="onchange" reRender="comment1" /> </apex:inputField> </apex:actionRegion> </apex:pageBlockSectionItem> <apex:outputPanel id="comment1"> <apex:pageBlockSection rendered="{!FA_Attestation__c.best_of_your_knowledge_and_belief__c=='No'}" > <apex:outputField value="{!FA_Attestation__c.Enter_Comments_if_no_1__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.Enter_Comments_if_no_1__c}" label="If no then enter comments" rendered="{!ISNULL(FA_Attestation__c.id)}"></apex:inputField> </apex:pageBlockSection> </apex:outputPanel> <!--question 2 begins here--> <apex:pageBlockSectionItem > <apex:outputLabel value="2. To the best of your knowledge and belief, are all services being performed for this hospital included in the HSA?" /> <apex:actionRegion > <apex:outputField value="{!FA_Attestation__c.performed_for_this_hospital__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.performed_for_this_hospital__c}" required="True" rendered="{!ISNULL(FA_Attestation__c.id)}" > <apex:actionSupport event="onchange" reRender="comment2"/> </apex:inputField> </apex:actionRegion> </apex:pageBlockSectionItem> <apex:outputPanel id="comment2"> <apex:pageBlockSection rendered="{!FA_Attestation__c.performed_for_this_hospital__c=='No'}"> <apex:outputField value="{!FA_Attestation__c.If_no_enter_comments_2__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.If_no_enter_comments_2__c}" label="If no then enter comments" rendered="{!ISNULL(FA_Attestation__c.id)}"/> </apex:pageBlockSection> </apex:outputPanel> <!--question 3 begins here--> <apex:pageBlockSectionItem > <apex:outputLabel value="3. To the best of your knowledge and belief, have any services been performed for this hospital that are not included in the HSA?" /> <apex:actionRegion > <apex:outputField value="{!FA_Attestation__c.provided_to_this_hospital__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.provided_to_this_hospital__c}" required="True" rendered="{!ISNULL(FA_Attestation__c.id)}" > <apex:actionSupport event="onchange" reRender="comment3"/> </apex:inputField> </apex:actionRegion> </apex:pageBlockSectionItem> <apex:outputPanel id="comment3"> <apex:pageBlockSection rendered="{!FA_Attestation__c.provided_to_this_hospital__c=='No'}"> <apex:outputField value="{!FA_Attestation__c.Enter_Comments_if_no_3__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.Enter_Comments_if_no_3__c}" label="If no then enter comments" rendered="{!ISNULL(FA_Attestation__c.id)}"></apex:inputField> </apex:pageBlockSection> </apex:outputPanel> <!--question 4 begins here--> <apex:pageBlockSectionItem > <apex:outputLabel value="4. To the best of your knowledge and belief, have all services that have been provided to this hospital been accurately billed for?" /> <apex:actionRegion > <apex:outputField value="{!FA_Attestation__c.understand_the_scope_of_services__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.understand_the_scope_of_services__c}" required="True" rendered="{!ISNULL(FA_Attestation__c.id)}" > <apex:actionSupport event="onchange" reRender="comment4"/> </apex:inputField> </apex:actionRegion> </apex:pageBlockSectionItem> <apex:outputPanel id="comment4"> <apex:pageBlockSection rendered="{!FA_Attestation__c.understand_the_scope_of_services__c=='No'}"> <apex:outputField value="{!FA_Attestation__c.Enter_Comments_if_no_4__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.Enter_Comments_if_no_4__c}" label="If no then enter comments" rendered="{!ISNULL(FA_Attestation__c.id)}"></apex:inputField> </apex:pageBlockSection> </apex:outputPanel> <apex:inputField value="{!FA_Attestation__c.Confirmation__c }" required="True" label="Are you sure you want to submit the form?" rendered="{!ISNULL(FA_Attestation__c.id)}"></apex:inputField> <apex:outputField value="{!FA_Attestation__c.Confirmation__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> <apex:inputField value="{!FA_Attestation__c.Name_of_the_user__c }" required="True" label="Please enter your name." rendered="{!ISNULL(FA_Attestation__c.id)}"></apex:inputField> <apex:outputField value="{!FA_Attestation__c.Name_of_the_user__c}" rendered="{!NOT(ISNULL(FA_Attestation__c.id))}"/> </apex:pageBlockSection> </apex:pageBlock> </apex:form> </apex:page> --------------------Controller---------------------------- public class FAAttestation2 { ApexPages.StandardController std; public FAAttestation2(ApexPages.StandardController FAA2) { std= FAA2; } public pageReference saveform() { std.save(); return null; } }
-
- Adam Gilchrist
- December 14, 2016
- Like
- 0
- Continue reading or reply
Track history fields not showing up in related list
I have a custom object in which I have selected 20 fields to track. When changing these fields, it doesn't seem to add anything to the related list on the object page.
Any idea what would cause these not to show up or are there any type of additional configuration that needs to take place so users with access to the object see all the tracked field changes?
Any idea what would cause these not to show up or are there any type of additional configuration that needs to take place so users with access to the object see all the tracked field changes?
- JJames
- January 16, 2017
- Like
- 0
- Continue reading or reply
i am writing class account and contact insert record. same class i write the test class but not code coverage 100% . were i am miss the logic
class
---------------
public class textex2 {
public string lastname ;
public string phone;
public void create(){
if(phone == '123'){
account acc = new account();
acc.name = lastname;
acc.Phone = phone;
insert acc;
}else{
contact c = new contact();
c.lastname = 'test1';
c.phone = '0223';
insert c;
}
}
}
------------------------
test
@istest
public class testclassex2 {
@istest
static void testdata2(){
textex2 ts = new textex2();
ts.lastname = 'test1';
ts.phone = '125';
ts.create();
if(ts.phone == '123'){
integer count = [select count() from account];
system.assertEquals(count, 1);
}
ts.phone ='0234';
ts.create();
if(ts.phone != '123'){
integer size = [select count() from contact];
system.assertEquals(size,1);
}
}
}
---------------
public class textex2 {
public string lastname ;
public string phone;
public void create(){
if(phone == '123'){
account acc = new account();
acc.name = lastname;
acc.Phone = phone;
insert acc;
}else{
contact c = new contact();
c.lastname = 'test1';
c.phone = '0223';
insert c;
}
}
}
------------------------
test
@istest
public class testclassex2 {
@istest
static void testdata2(){
textex2 ts = new textex2();
ts.lastname = 'test1';
ts.phone = '125';
ts.create();
if(ts.phone == '123'){
integer count = [select count() from account];
system.assertEquals(count, 1);
}
ts.phone ='0234';
ts.create();
if(ts.phone != '123'){
integer size = [select count() from contact];
system.assertEquals(size,1);
}
}
}
- Giri Kumar B
- January 16, 2017
- Like
- 0
- Continue reading or reply