• MM Saikumar
  • NEWBIE
  • 55 Points
  • Member since 2015
  • Cognizant


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 2
    Questions
  • 12
    Replies

I'm trying  to change object permissions   on particular profile from  my system administrator account on Standard user profile. When i'm clicking edit button on my custom object, checkboxes are still not editable. What can be the matter?

User-added image

look at button marked
I need to create a button to add more rows in property editor for a custom lightning component in community page Napili Template. Is it possible to add button as it is displayed in above screenshot is a standard functionality.  I need code for that similar functionality.  Please help me.
i am unable to pass parameters into controller from actionsupport

<apex:page controller="paramtest">
<apex:form >
  <apex:pageBlock >
      <apex:pageBlockTable value="{!acclist}" var="a">
          <apex:column ><apex:inputCheckbox ><apex:actionSupport action="{!nothing}" event="onchange"><apex:param value="{!a.id}" name="{!bee}" assignTo="{!bee}"/></apex:actionSupport></apex:inputCheckbox></apex:column>
          <apex:column ><apex:outputText value="{!a.name}"></apex:outputText></apex:column>
      </apex:pageBlockTable>
  </apex:pageBlock>
  </apex:form>
</apex:page>


public with sharing class paramtest {

    public PageReference nothing() {
    string beenn= ApexPages.currentPage().getParameters().get('bee');
    system.debug('from constructor '+beenn);
        return null;
    }


    public list<account> acclist { get; set; }
    public string bee {get;set;}
    
    public paramtest(){
    
    
    acclist=[select id,name from account];
    
    }
}
I may be overthinking this, but want to make sure they aren't twisting the terminology on us like they tend to do with Superbadges.

For the final part of Challenge 2, under the "Support Is a Team Sport" portion of the requirements, it talks about creating Customer Contact and Support Lead roles. Are those actual Salesforce Roles or more akin to Case teams?

The main reason I ask this is because the Error Message I get mentions something not spelled out in the requirements that I could see:

"Challenge Not yet complete... here's what's wrong:
We can't find the 'Customer Case Team' role. Ensure the Customer Contact can be tracked on Cases."

However, the requirements don't specifically mention creating a 'Customer Case Team' role.

I'm trying  to change object permissions   on particular profile from  my system administrator account on Standard user profile. When i'm clicking edit button on my custom object, checkboxes are still not editable. What can be the matter?

User-added image

I've created an Apex class to do a test and I need to execute it. I would like to know how to execute it with a button for example (I've created a button that is related with a Visualforce page).
Here is the code that I want to test: 
public class Teste {

    public void teste1(){
        // Insert Product
        Product2 pr = new Product2();
        pr.Name='Moto - G1';
        pr.isActive=true;
        insert pr;
        
        // Insert Pricebook
        PriceBook2 customPriceBook = new PriceBook2();
        customPriceBook.Name='Custom Pricebook';
        customPriceBook.IsActive=true;
        insert customPriceBook;
        
        // Query Standard and Custom Price Books
        Pricebook2 customPriceBookRec=[select Id from Pricebook2 where id=:customPriceBook.Id];
        Id stdPriceBookRecId = Test.getStandardPricebookId();
        
        // Create Standard PriceBookEntry
        PriceBookEntry stdPriceBookEntry = new PriceBookEntry();
        stdPriceBookEntry.Product2Id=pr.Id;
        stdPriceBookEntry.Pricebook2Id=stdPriceBookRecId;
        stdPriceBookEntry.UnitPrice=2000;
        stdPriceBookEntry.IsActive=true;
        insert stdPriceBookEntry;
        // Create Custom PriceBookEntry
        PriceBookEntry customPriceBookEntry = new PriceBookEntry();
        customPriceBookEntry.Product2Id=pr.Id;
        customPriceBookEntry.Pricebook2Id=customPriceBookRec.Id;
        customPriceBookEntry.UnitPrice=5000;
        customPriceBookEntry.IsActive=true;
        insert customPriceBookEntry;
        
        // Create Opportunity
        Opportunity opp = new Opportunity();
        opp.Name = 'Test';
        opp.CloseDate= System.Today();
        opp.StageName='Prospecting';
        insert opp;
        
        // Add product and Pricebook to the particular opportunity using OpportunityLineItem 
        OpportunityLineItem oppLineItem = new OpportunityLineItem();
        oppLineItem.OpportunityId = opp.Id;
        oppLineItem.PricebookEntryId = customPriceBookEntry.Id;
        oppLineItem.UnitPrice = 7000;
        oppLineItem.Quantity = 5;
        insert oppLineItem;
    }
}
Could you help me please?
I need to get First day from the date given.

For example consider 30/04/2015 date and it is Thrusday all I need to get next month's first Thrusday i.e, 07/05/2015 in batch class.

Please help me out of this.

Many thanks in advance
Can anybody tell how to read the barcode from the image and display the product information details regarding the barcode image.

Using EAN 128 image format. It should accept only EAN 128 image format. 

Thanks in advance.
How to write trigger to avoid duplicate email when bulkfying the trigger

my trigger is:

trigger AvoidDuplicate on contact (before insert,before update)
{
   if(Trigger.isInsert||Trigger.isUpdate)
      for(contact a:trigger.new)
     {
         integer count=[select count from contact where email=:a.email];
         if(count>0)
          {
                 a.Email.adderror('This email already exists');
          }
     }
}

this is working fine when inserting single records

but it shows error when working with dataloader...... Please help to to over come this error


I would appriciate for any kind of replay...............
Hello all,

I'm unable to complete the challenges for steps 3-5 in the "Apex Basics & Database" Trailhead module. I can't figure out what could be wrong with any of my classes. The message I get for all three is a variation on:

"Executing the 'searchContactsAndLeads' method failed. Either the method does not exist, is not static, or does not return the expected search results."

All of the classes are public. All of the methods are public and static. I've checked the return types and have successfully run them all with test data. I've tried re-entering the test data provided in the module to make sure it's accurate. No idea what I'm doing that makes this fail. (I'm not using a custom namespace.)

I'll paste my code below. Any tips would be greatly appreciated!

Thanks,
Mike

public class AccountHandler {
    public static ID insertNewAccount(String acctName) {
        Account newAcct = new Account(Name=acctName);
        try {
            insert newAcct;
        } catch (DMLException e) {
            System.debug('A DML exception has occurred: ' +
                         e.getMessage());
            return Null;
        }        
        return newAcct.Id;
    }
}

public class ContactSearch {
    public static List<Contact> searchForContact(
        String lastName, String postalCode) {
            List<Contact> contacts = new List<Contact>();
            contacts = [SELECT Name
                        FROM Contact
                        WHERE LastName = :lastName AND
                        MailingPostalCode = :postalCode ];           
            return contacts;
        }
}

public with sharing class ContactAndLeadSearch {
    public static List<List<SObject>> searchContactsAndLeads(String srch) {
        List<List<SObject>> results = [FIND :srch IN NAME FIELDS];
        }
}

I write a apex class to import csv file from the VF page. The 'BLOB is not a valid UTF-8 string' raising.I don't how to set the csv encode. or is there any way to convert the file to UTF-8 by apex code.

Any suggestion would be appriciate.

Thanks.

  • May 16, 2012
  • Like
  • 0

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.