• Rupal Kumar
  • NEWBIE
  • 339 Points
  • Member since 2015
  • Salesforce developer
  • Mirketa Software Pvt. Ltd.

  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 104
    Replies
Challenge is as below:--
To complete this challenge, add a validation rule which will block the insertion of a contact if the contact is related to an account and has a mailing postal code (which has the API Name MailingPostalCode) different from the account's shipping postal code (which has the API Name ShippingPostalCode).
Name the validation rule 'Contact must be in Account ZIP Code'.
A contact with a MailingPostalCode that has an account and does not match the associated Account ShippingPostalCode should return with a validation error and not be inserted.
The validation rule should ONLY apply to contact records with an associated account. Contact records with no associated parent account can be added with any MailingPostalCode value. (Hint: you can use the ISBLANK function for this check)


--------------------------------------------
My validation rule is as attached pictureUser-added image

And Error is- Challenge Not yet complete... here's what's wrong: 
The validation rule failed to enforce the business logic
Hi
I need to built a page with say two or more fields – their values will be Yes or No – based on if it is selected or not.
Get these field values in class and based on field values set variable values and call the function e.g:
VF Page:
Text1: Yes(it is a radio button)
Text2: Yes(radio)
call saveList from action button on VF page.
Apex Class:
Public String Cat
Public String Req
public PageReference saveList()
{
if(Text1 == Yes):
Cat = ‘abc’
Req = ‘abc’
CallFunction(Cat,Req)
}
if(Text2 == ‘Yes’){
Cat = ‘def’
Req = ‘def’
CallFunction(Cat,Req)
}
}
public void CallFuntion(String Cat, String Req)
{
statements;
}
what is pagination in vf ? how do I implement it with an example. Thanks
I am trying to learn Apex coding and I am unable to figure out how to write a test class for the code below:

public class FilterTasksCall {
   
    public Task[] tasks {get; private set;}
   
    public FilterTasksCall() {
        Id id = (Id) ApexPages.currentPage().getParameters().get('id');
         tasks = [Select
                    Who.Id,
                    Who.Name,
                    Id,
                    Subject,
                    What.Name,
                    ActivityDate,
                    Owner.Name,
                    Status,
                    LastModifiedDate
                    From Task
                    Where Subject Like '%Call%' and Who.Id=:ApexPages.currentPage().getParameters().get('id')];
    }

}

Thank you and your help is very much appreciated,
Jim
Hi all,
I have a test class something like this.

global class Maincontroller()
{
  global virtual class summary extends summary1
  {
    global virtual override void startPage()
    {    
    //Lines of code
    }
  }
}

Can anyone please tell me how to cover the startPage method in my test class.Since this method is inside the inner class, I have no idea how to write the test class for that.Any help would be greatly appreciated.
I have written a apex class with test class both are running but my code coverage is only 66%.Please help to solve the problem.
Apex Class-
global class Deleteoppotest implements Schedulable{

    global void execute(SchedulableContext SC) {
        deleteoppo();
    }

    public static void deleteoppo() {

        for(List<opportunity> objoppo : [SELECT Id FROM opportunity WHERE CreatedDate <= :(Date.Today() - 200) LIMIT 10])
            {
                delete objoppo;
            }    
    }
}

Test Class
@isTest
private class Deleteoppotestcls {

    static testMethod void myUnitTest() {
        // TO DO: implement unit test



        Opportunity op = new Opportunity();
        op.Name = 'test1';
        op.StageName = 'Qualified';
        op.CloseDate = Date.Today();
        op.Description ='testingoppotestcls';
        op.Business_Type__c = 'Domestic';


        insert op;


        Deleteoppotest.deleteoppo();

    }
}

 
Hi everyone,
I want to use <apex:actionregion > component in <div></div>tags in mycustom visualforce page. Can anyone help me over.

Regards,
mac
Hi All,

Q). what is the difference between actionFunction and actionSupport, Explain with funcionality?

can anyone reply for this post...
Thanks in advance..
I am trying to write a trigger that will copy the same attachment to all related contact when we insert an attachment to Account Object.
trigger CopyAttachmentsToCon on Attachment (after insert) {

    Set<Id> AccountIds = new Set<Id>();
    for(Attachment file : Trigger.new) {
     
        if(file.ParentId.getSObjectType() == Account.getSObjectType()) {
            AccountIds.add(file.ParentId);
        }
    }
Now how to get map of all the related contact of coresponding Account with Attachment?
 
Hi All,
I have one requirement that i need to use mid() String function in Apex class.I have a set called zip and in that i am adding all the Account.Billingpostal code .for this i need to fetch only first 5 to return.I used like zip.add(String.mid(Account.BillingPostalCode, 1, 5));
But error i scoming as variable string doesnot exist.How to do this mid() and add it to the set called Zip with all account Postal code.

​Kindly help me on this  
 
How to hide "Save & New Task" button from task page layout.
User-added image
How to make a input field readonly witth Java Script?
Hi All,

Why we are using custom controller and custom extensions in the same vf page? In which situation we are going to use both custom controller and extensions?

Can anyone reply for this post.......
Thanks in Advance............
Hi All,
Some body can help need to show column
1.out put text value red color if text value is closed 
2. out put text value green color if text value is open 
3. out put text value  grey color if text value is Existing

Below is the vf code
<apex:column >
<apex:facet name="header">PANEL STATUS</apex:facet>                                                
<p>  <span class="label label-default">{!objRecord.panel_status}</span></p>
 </apex:column>

 
Can somebody explain what are the scenarios for both and how to implement them:
1. Calling controller method from JavaScript
2. Calling Javascript Function from controller
I have captured the values.Now that I have to send those values to the email template.How to do that?
Please help.
hi Friends,

   I am created workflow rule for ending emails..my critiria is every tiime created And Edited..but when i am creting a record the email was not send to the emails ...
what is the reason....
rule critiria is: AND(NOT( ISBLANK(Focus_ID__c )), 
NOT(ISNULL(Focus_ID__c )))
means when  foccus_ID__C created my workflow sshold be triggerd..
what is the reason....