• Karthi Xavi
  • 35 Points
  • Member since 2015
  • Salesforce Developer
  • Congruent Info-Tech

  • Chatter
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
  • 12
Dear All,
I have the related object " Named Driver" in the Quote object, i need that the users can only delete a named driver record only when the premium field in the quote field is zero (0), if any value present , they shouldnt able to delete. Can you plz suggest how this can realize, thanks
User-added image
I want to compare a text with a attachment that is added to a custom object ex: Word "Test" has to checked whether it is placed in the attachment body. using apex I want to check it using apex, Kindly help me with it.
hello, i'm trying to open a new visualforce from a button and it works, the problem is that i need to open it in a new window, not in te same page, is it possible to do that?
first i was doing this:
<button id="vpre" hidden="hidden" type="button" onClick="window.open('/apex/vistaauth?ida='{!res},'Vista Previa','width=700,height=650');">V. Previa</button>
and it work very well but i cant pass values from the controller to the new vf

now i can pass them but i cant set the new page in a new window or customize the size
public PageReference abrir()
       PageReference pageRef= new PageReference('/apex/vistaauth');
       pageRef.getParameters().put('tp', tipoo);
       return pageRef;           

Dear All,
I have the related object " Named Driver" in the Quote object, i need that the users can only delete a named driver record only when the premium field in the quote field is zero (0), if any value present , they shouldnt able to delete. Can you plz suggest how this can realize, thanks
User-added image
HI All

I have 3 object Contact,Boutique and Opportunity.All are relationship with each other.I need to auto opportunity record creation when boutique will be created .I have created this trigger but its showing in boutique layout .but i need in contact layout.
trigger CreateOpportunity on Boutique__c(after insert) {
    List<Opportunity> Childs = new List<Opportunity>();

    for(Boutique__c a : trigger.new)
       Opportunity Child = new Opportunity();
       Child.Boutique__c= a.Customer_Name__c;
       Child.Name= a.Name;
        Child.StageName= 'Generate Opportunity';
         Child.CloseDate= System.Today()+150;

    Insert Childs;
User-added image
Hi All,

I have the following code that checks duplicate for email and phone for contact records. For instance, R1 contact record can have phone, email as "123","a@abc.com" and R2 contact record can have "123","b@abc.com". Error thrown only when BOTH EMAIL, PHONE matches existing records.
This works for single record insert/update, but when bulk insert through data import wizard if I insert 10 records with same email,phone values, 9 records are inserted with duplicate values, with error on the 10th record. 

Need help.


trigger ContactTrigger_AT on Contact (before insert, before update)
    Set<String> setEmail = new set<String>();
    Set<String> setPhone = new set<String>();
    Set<String> setExistingEmail = new set<String>();
    Set<String> setExistingPhone = new set<String>();
    for(Contact con : Trigger.new)
    for(Contact con : [SELECT Phone,Email FROM contact WHERE email in : setEmail AND phone in : setPhone])
    for(Contact a:trigger.new)
        if(setExistingEmail.contains(a.email) && setExistingPhone.contains(a.Phone))
            a.adderror('This Phone and email already exists');


I want to add custom button beside of new contact button in Contact section inside detail page of account, I am abble to add custom button inside to detail page but i want add that same custom button section of Contact. Pelase hepl me.

Thanks &  Regards
Bhushan Singh
Referring to this post: https://developer.salesforce.com/forums/?id=906F00000008l8SIAQ
I tried the "best answer" from that thread, but I get the error "expecting right curly bracket, found '<'".

The "best answer" was:
trigger populateParentAccount on Account (before Insert){<br> List<Lead> convertedLeads=[SELECT Id, ConvertedAccountID, Lead_Parent__c<br> FROM Lead WHERE IsConverted=True AND ConvertedAccountId IN :trigger.new];<br> Map<ID,ID> acctParentMap=new Map<ID,ID>();<br> for (lead l: convertedleads){<br> acctParentMap.put(l.ConvertedAccountId,l.Lead_Parent__c);<br> }<br> for (account a:trigger.new){<br> if (acctParentMap.containsKey(a.Id)){<br> a.<font color="#ff0000">ParentId</font>=acctParentMap.get(a.Id);<br> }<br> }<br>}

Note, I'm using Salesforce Professional edition so Apex isn't natively opened to me. Upgrading everyone to enterprise is out of the question, so  I was hoping to create a trigger in d eveloper edition, then install it as a package in my production, as suggested here: https://developer.salesforce.com/docs/atlas.en-us.packagingGuide.meta/packagingGuide/dev_packages_apex_ge_pe.htm . 

Automating this "Parent Account" field would be a lifesafer, because the way our sales works is ALL of our leads have a Lead Parent (a custom picklist which I've added in Lead Stage).

I am also new to Salesforce, please be nice! :( Just started using it a couple of weeks ago and I'm trying to get all our sales processes streamlined before the volume of our leads pick up.

 Having to manually add the Parent Account everytime a Lead is converted is very inefficient, so I would really like to find a way to make this automatic. Since I can't map the lead fields to Parent Account because that is a look-up field.

Thank you!
I'm looking at creating a validation rule to be mandatory only if the record was created today. Any help on creating this would be great.
I have many accounts in my org and when I execute (in Query Editor) "SELECT Name FROM Account" I am receiving "Line: 1, Column: 0
required (...)+ loop did not match anything at input 'SELECT'" 

I am not sure why. If I test this through Apex code, i still don't receive any results. For example:

Account[] accs = [SELECT Name  FROM Account];
System.debug('@@accounts: ' + accs);

I've also tried
List<Account> accs = [SELECT Name  FROM Account];

returns an empty array.

Any suggestions? This is bugging me incredibly. I've tried Contacts too and still does not return any results.
Hi All,

I want a formula for the below scenario.

If the value of field 'A' is 'One' , then i want the value of field 'B' (number field) 'B+1'.

It may be simple but mind is not working today..

Hey all,

I am trying to make a field required if the values of a pick list meet certain criteria.

heres how i want it to work;

If "Visit_Type__c" equals "follow up - Home" or "Phone Call" 
Make "Care_Plan_Issues_Interventions_Addressed__c" Required

Below is a picture of the object. It's a simple clinical note for our business. I have the field required from the page layout right now but i would like to impliment this Validation rule.

User-added image
I have a checkbox in my vf page which is using custom controller. I need to get check box value true in apex class controller when it is checked, so that I can perform my logic based on that checkbox value. How to do that?