• Manid
  • NEWBIE
  • 60 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 31
    Replies
i have a string variable str
 
list<string> strAll=str.split(';');//str is string which contains list of ids as string separated by ;
//after some conditions i create a string variable 
string strs;//with some content of the strAll
i want to remove strs from the strAll any suggestions?
  • September 04, 2018
  • Like
  • 0
how to create a one-to-one relation ship between two objects in triggers? 
is it possible? i wonder when a hear this from the interviewer in an interveiw. please post the code if solution is there.
  • July 13, 2018
  • Like
  • 0
And what we can create or don't in sand box. I don't know which can develop in production environment and sandbox . Please give the some Clarificatioon regarding these
  • April 26, 2018
  • Like
  • 0
i saw in documentation maximum batch size is 200. if we enabled bulk Api its is upto 10000 .
But how we can import more than 50000 - 5M records if it exceed the size? please anyone explain the overall dataloader process
  • April 11, 2018
  • Like
  • 0
i downloaded a zip file from a blog which contains .cls and .page files . And i instal force.com ide eclipse tool . i don't know how to view those files in the eclipse and deploye to the organization. anybody have any idea help me
  • April 06, 2018
  • Like
  • 0
 write a trigger on Account, While inserting a account  name value as ‘someName’ ended with ‘text’ ex: ‘renuText’.
 it should through an error On Account Object if name field has 'text' 
  • January 31, 2018
  • Like
  • 0
Create a new Custom objects Application and BlackList
 Object Name                          Field Names
--------------------                           -----------------
  Application                               Name,Pancard ,Phone
  BlacKList                                  Name,Pancard,phone

a. When ever we are inserting new Application it has to check pancard no of the new application record is 
in the Blakc list or not .
b.If the pancard of the Appliction is in the blacklist object then update the blackList phone with new application phone no  and throw error


below code is throws error as per scenario but it not update the phone number in the object please help any one
trigger Application on Applications__c (before insert) {
    
    list<blacklist__c> balack=[select name,pancard__c,mobile_num__c from blacklist__c];
    list<blacklist__c> newre=new list<blacklist__c>();
    for(Applications__c c: trigger.new){
        for(blacklist__c bp:balack){
            if(bp.pancard__c==c.Pancard__c){
                bp.mobile_num__c=c.mobile_num__c;
                newre.add(bp);
                c.name.adderror('applicant is in blacklist');
            }
        }
        update newre;
    }
}

 
  • January 22, 2018
  • Like
  • 0
i dont know the meaning of the some symbols int he validation rules like ^(exponential) but this is used in the text fields. what is the meaning of this and [0-9]&[a-z] and like those some are not understanding plz give the some explanation regarding these
  • November 26, 2017
  • Like
  • 0
i want to develop custom vf page with some side bar components.How to create a sidebar components ?like below 

User-added image
  • November 15, 2017
  • Like
  • 0
public class DmlExample{
    public account acc{get;set;}
    public DmlExample(){
        acc=new account();
    }
    public pagereference DmlExam(){
        integer c=[select count() from account where name=:acc.Name];
        if(c>0){
            apexpages.Message msg=new apexpages.Message(apexpages.Severity.ERROR,'duplicate is trying to insert');
            apexpages.addmessage(msg);
            return null;
        }
        else{
         	insert acc;
        	pagereference p=new pagereference('/'+acc.id);
        	return p;
        }
    }
    public void cancelling(){
        acc=null;
    }
}

 
  • October 21, 2017
  • Like
  • 0
global class inboundEmailattachment implements messaging.inboundemailhandler {
    global messaging.inboundemailresult handleinboundemail(messaging.inboundemail email,messaging.inboundEnvelope evn){
        messaging.inboundemailresult res=new messaging.inboundemailresult();
        contact con=[select lastname,email from contact where email=:email.fromaddress];
        case c=new case();
        c.Subject=email.subject;
        c.Description=email.plaintextbody;
        c.origin='web';
        c.status='new';
        c.priority='high';
        c.contactid=con.id;
        insert c;
        messaging.inboundemail.binaryattachment[] attach=email.binaryattachments;
        list<attachment> mylist=new list<attachment>();
        for(messaging.inboundemail.binaryattachment b:attach){
            attachment a=new attachment();
            a.name=b.filename;
            a.Body=b.body;
            a.parentid=c.id;
            mylist.add(a);
        }
        insert mylist;
        return res;
    }
}
for this i write test class but it not cover all lines of code
test class:
@istest
public class inboundemailattachmentTest {
    
   static testMethod void TestinBoundEmail()
   {
       Messaging.InboundEmail email = new Messaging.InboundEmail() ;
       Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();
      
      email.subject = 'Create Contact';
      email.fromAddress = 'someaddress@email.com';
      email.plainTextBody = 'email body';
      Messaging.InboundEmail.BinaryAttachment attachment = new Messaging.InboundEmail.BinaryAttachment();
      attachment.body = blob.valueOf('my attachment text');
      attachment.fileName = 'textfileone.txt';
      attachment.mimeTypeSubType = 'text/plain';
      email.binaryAttachments = new Messaging.inboundEmail.BinaryAttachment[] { attachment };
     
      inboundEmailattachment  testInbound=new inboundEmailattachment ();
      testInbound.handleInboundEmail(email, env);
   }
}
please teach me test class 
 
  • September 24, 2017
  • Like
  • 0
public class ExtentionExample1 {
    public account acc   {get;set;}
    public ExtentionExample1(apexpages.standardcontroller cont){
        string[] names=new string[]{'name','phone','industry','rating'};
            cont.addfields(names);
        acc=(account)cont.getrecord();
    }
    public pagereference save(){
        string str=acc.name;        
        integer count=[select count() from account where name =: str];
        if(count>0){
            acc=[select name,phone,industry,rating from account where name =: str];
            return null;
        }
        else{
            insert acc;
        	pagereference pag=new pagereference('/'+acc.Id);
        	return pag;
        }
    }
}
plz write the test class for the above code
 
  • September 24, 2017
  • Like
  • 0
public class MassDelete {
    public list<account> accs {get;set;}
    public MassDelete(apexpages.StandardSetController cont){
        string[] fields=new string[]{'name','industry','rating','phone'};
            cont.addfields(fields);
        accs=new list<account>();
        accs=(list<account>)cont.getselected();
    }
    public pagereference deletes(){
        delete accs;
        pagereference p=new pagereference('/search/UndeletePage');
        return p;
    }
}
my test class:
@isTest
public class MassDeleteTest {
    
    testmethod static void testme(){
        list<account> accs=new list<account>();
        account a=new account(name='Test name');
        insert a;
        account a2=new account(name='Acme pro');
        insert a2;
        accs.add(a);
        accs.add(a2);
        test.startTest();
        pagereference pref=page.massDeleteAcc;
        test.setCurrentPage(pref);
        apexpages.standardsetcontroller std=new apexpages.StandardSetController(accs);
        std.setselected(accs);
        MassDelete obj=new Massdelete(std);
        test.stopTest();
        
    }
}
i didn't get full coverage why?
 
  • September 24, 2017
  • Like
  • 0
i have list of records send the records to the user. I don't have any idea plz explain
  • September 18, 2017
  • Like
  • 0
i am not understanding the some methods in the email file attachment. Plz explain the methods
  • September 14, 2017
  • Like
  • 0
i want to pass the trigger.new or trigger.old list values to the batch apex and perform the loginc in the execute method. It is possible?
  • September 12, 2017
  • Like
  • 0
wrapper class:
public class AccountWrapper {
    public account acc {get;set;}
    public boolean flag  {get;set;}       
}
class:
public class Dmlexamle6 {
    public string allrec                 {get;set;}
    public list<AccountWrapper> aws      {get;set;}
    
    public void searched(){
        aws=new list<AccountWrapper>();
        list<account> accs=[select name,phone,industry from account];
        for(account a:accs){
            AccountWrapper aw=new AccountWrapper();
            aw.acc=a;
            aw.flag=false;
            aws.add(aw);
        }
    }
    public void delects(){
        list<account> a= new list<account>();
        list<AccountWrapper> aes=new list<AccountWrapper>();
        for(AccountWrapper aw:aws){
               if(aw.flag==true){
               a.add(aw.acc);
               }
        }
        delete a;
    }
}
vf page:
<apex:page controller="Dmlexamle6">
    <apex:form >
        <apex:inputText value="{!allrec}"/>
        <apex:commandButton value="search" action="{!searched}"/>
        <apex:pageblock rendered="{! !isnull(aws)}">
            <apex:pageBlockButtons location="top">
                <apex:commandbutton value="delete" action="{!delects}"/>
            </apex:pageBlockButtons>
            <apex:pageblocktable value="{!aws}" var="b">
                <apex:column >
                    <apex:facet name="header"><apex:inputcheckbox /></apex:facet>
                    <apex:inputCheckbox value="{!b.flag}"/>
                </apex:column>
                <apex:column value="{!b.acc.name}"/>
                <apex:column value="{!b.acc.phone}"/>
                <apex:column value="{!b.acc.industry}"/>
            </apex:pageblocktable>
        </apex:pageblock>
    </apex:form>
</apex:page>

it gives  all records but after press delete button from database it delets but in list it not delets.User-added image
  • September 08, 2017
  • Like
  • 0
i have some confusion working with batch apex. We use batch apex working with larger set of data. give me one example of it and why its methods and implementing class is global?
  • August 31, 2017
  • Like
  • 0
And what we can create or don't in sand box. I don't know which can develop in production environment and sandbox . Please give the some Clarificatioon regarding these
  • April 26, 2018
  • Like
  • 0
i saw in documentation maximum batch size is 200. if we enabled bulk Api its is upto 10000 .
But how we can import more than 50000 - 5M records if it exceed the size? please anyone explain the overall dataloader process
  • April 11, 2018
  • Like
  • 0
 write a trigger on Account, While inserting a account  name value as ‘someName’ ended with ‘text’ ex: ‘renuText’.
 it should through an error On Account Object if name field has 'text' 
  • January 31, 2018
  • Like
  • 0
Lowly Admin here who doesn't know a bit of code...I have a custom object Location__c and I need to count the number of Products (Standard object called Product2) associated with that Location. I want the total to appear in a field on the Location object called Current_Lot_Inventory. Would any of you gracious developers be willing to help me out with the Apex needed?
Create a new Custom objects Application and BlackList
 Object Name                          Field Names
--------------------                           -----------------
  Application                               Name,Pancard ,Phone
  BlacKList                                  Name,Pancard,phone

a. When ever we are inserting new Application it has to check pancard no of the new application record is 
in the Blakc list or not .
b.If the pancard of the Appliction is in the blacklist object then update the blackList phone with new application phone no  and throw error


below code is throws error as per scenario but it not update the phone number in the object please help any one
trigger Application on Applications__c (before insert) {
    
    list<blacklist__c> balack=[select name,pancard__c,mobile_num__c from blacklist__c];
    list<blacklist__c> newre=new list<blacklist__c>();
    for(Applications__c c: trigger.new){
        for(blacklist__c bp:balack){
            if(bp.pancard__c==c.Pancard__c){
                bp.mobile_num__c=c.mobile_num__c;
                newre.add(bp);
                c.name.adderror('applicant is in blacklist');
            }
        }
        update newre;
    }
}

 
  • January 22, 2018
  • Like
  • 0
Dear Friends, 

Need your help, My Question is...

There is a Trigger Code on Task object, Which is going to update a custom field on Opporunity (There is DML Update operation on Task Object for Opportunity). And there is also a trigger code on Opportunity (after Update). So Whenever i create a task, and i am comparing (Task.WhatId==Opp.WhatID), In the Console it is saying that ' Attempt to Derefernce a null Object ',. How to over come on this. How to use Recursive trigger here. Please help me on this. Thank you.  
i dont know the meaning of the some symbols int he validation rules like ^(exponential) but this is used in the text fields. what is the meaning of this and [0-9]&[a-z] and like those some are not understanding plz give the some explanation regarding these
  • November 26, 2017
  • Like
  • 0
i want to develop custom vf page with some side bar components.How to create a sidebar components ?like below 

User-added image
  • November 15, 2017
  • Like
  • 0
public class DmlExample{
    public account acc{get;set;}
    public DmlExample(){
        acc=new account();
    }
    public pagereference DmlExam(){
        integer c=[select count() from account where name=:acc.Name];
        if(c>0){
            apexpages.Message msg=new apexpages.Message(apexpages.Severity.ERROR,'duplicate is trying to insert');
            apexpages.addmessage(msg);
            return null;
        }
        else{
         	insert acc;
        	pagereference p=new pagereference('/'+acc.id);
        	return p;
        }
    }
    public void cancelling(){
        acc=null;
    }
}

 
  • October 21, 2017
  • Like
  • 0
global class inboundEmailattachment implements messaging.inboundemailhandler {
    global messaging.inboundemailresult handleinboundemail(messaging.inboundemail email,messaging.inboundEnvelope evn){
        messaging.inboundemailresult res=new messaging.inboundemailresult();
        contact con=[select lastname,email from contact where email=:email.fromaddress];
        case c=new case();
        c.Subject=email.subject;
        c.Description=email.plaintextbody;
        c.origin='web';
        c.status='new';
        c.priority='high';
        c.contactid=con.id;
        insert c;
        messaging.inboundemail.binaryattachment[] attach=email.binaryattachments;
        list<attachment> mylist=new list<attachment>();
        for(messaging.inboundemail.binaryattachment b:attach){
            attachment a=new attachment();
            a.name=b.filename;
            a.Body=b.body;
            a.parentid=c.id;
            mylist.add(a);
        }
        insert mylist;
        return res;
    }
}
for this i write test class but it not cover all lines of code
test class:
@istest
public class inboundemailattachmentTest {
    
   static testMethod void TestinBoundEmail()
   {
       Messaging.InboundEmail email = new Messaging.InboundEmail() ;
       Messaging.InboundEnvelope env = new Messaging.InboundEnvelope();
      
      email.subject = 'Create Contact';
      email.fromAddress = 'someaddress@email.com';
      email.plainTextBody = 'email body';
      Messaging.InboundEmail.BinaryAttachment attachment = new Messaging.InboundEmail.BinaryAttachment();
      attachment.body = blob.valueOf('my attachment text');
      attachment.fileName = 'textfileone.txt';
      attachment.mimeTypeSubType = 'text/plain';
      email.binaryAttachments = new Messaging.inboundEmail.BinaryAttachment[] { attachment };
     
      inboundEmailattachment  testInbound=new inboundEmailattachment ();
      testInbound.handleInboundEmail(email, env);
   }
}
please teach me test class 
 
  • September 24, 2017
  • Like
  • 0
public class ExtentionExample1 {
    public account acc   {get;set;}
    public ExtentionExample1(apexpages.standardcontroller cont){
        string[] names=new string[]{'name','phone','industry','rating'};
            cont.addfields(names);
        acc=(account)cont.getrecord();
    }
    public pagereference save(){
        string str=acc.name;        
        integer count=[select count() from account where name =: str];
        if(count>0){
            acc=[select name,phone,industry,rating from account where name =: str];
            return null;
        }
        else{
            insert acc;
        	pagereference pag=new pagereference('/'+acc.Id);
        	return pag;
        }
    }
}
plz write the test class for the above code
 
  • September 24, 2017
  • Like
  • 0
public class MassDelete {
    public list<account> accs {get;set;}
    public MassDelete(apexpages.StandardSetController cont){
        string[] fields=new string[]{'name','industry','rating','phone'};
            cont.addfields(fields);
        accs=new list<account>();
        accs=(list<account>)cont.getselected();
    }
    public pagereference deletes(){
        delete accs;
        pagereference p=new pagereference('/search/UndeletePage');
        return p;
    }
}
my test class:
@isTest
public class MassDeleteTest {
    
    testmethod static void testme(){
        list<account> accs=new list<account>();
        account a=new account(name='Test name');
        insert a;
        account a2=new account(name='Acme pro');
        insert a2;
        accs.add(a);
        accs.add(a2);
        test.startTest();
        pagereference pref=page.massDeleteAcc;
        test.setCurrentPage(pref);
        apexpages.standardsetcontroller std=new apexpages.StandardSetController(accs);
        std.setselected(accs);
        MassDelete obj=new Massdelete(std);
        test.stopTest();
        
    }
}
i didn't get full coverage why?
 
  • September 24, 2017
  • Like
  • 0

hello,
I want to create ".Zip" file by APEX which can include other files like .jpg,.txt etc...

 

THANXS..

  • August 22, 2012
  • Like
  • 0