• ajmerakavita
  • NEWBIE
  • 105 Points
  • Member since 2011

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 13
    Replies

Could someone explain why the slash "/' is required for the link to work in the example below?

 

When I use this  code, the link does not work. I get an error: "The name '...' can only contain alphanumeric characters, must begin with a letter, and must be unique."

 

<apex:column headerValue="Contract Number">
<apex:outputLink value="{!c.Id}">{!c.ContractNumber}</apex:outputLink>
</apex:column>

 

However when I add the slash "/" everything works as expected. Is this documented somewhere? I have not found an explanation yet.

 

<apex:column headerValue="Contract Number">
<apex:outputLink value="/{!c.Id}">{!c.ContractNumber}</apex:outputLink>
</apex:column>

  • December 13, 2011
  • Like
  • 0

Hello,

 

Does anyone know is the columns of the Tasks can be modified under the Home tab?

 

thanks for the help!

 

Mirko

Hii all ,

I have the requirement that i have 5 pageblock section  such that each pageblocksection  contains the all feilds and the entire page contains only one save button such that i have to insert the all the fields

i'm giving the code can u get me the correct approach for the code

 

 

<apex:page controller="file2">
<apex:form >
<apex:pageBlock >

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" />
</apex:pageBlockButtons>

<apex:pageBlockTable value="{!f1}" var="f" id="form1">

<apex:column headerValue="Name">
<apex:inputField value="{!f.Name}"/>
</apex:column>
<apex:column headerValue="Description">
<apex:inputField value="{!f.Description__c}"/>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!f1}" var="f" id="form2" >

<apex:column headerValue="Name">
<apex:inputField value="{!f.Name}"/>
</apex:column>
<apex:column headerValue="Description">
<apex:inputField value="{!f.Description__c}"/>
</apex:column>
</apex:pageBlockTable>

</apex:pageBlock>
</apex:form>
</apex:page>

 

 

controller

-----------------------------------

public with sharing class file2 {

public file2() {
f1 = new List<File__c>();
f1.add(new File__c());

}


public List<File__c> f1 {get; set;}

public PageReference save()
{
insert f1;

return null;
}
}

 

Select FieldA__c, Contact__c FROM Account WHERE Contact__c = '+123,+321,+456,+654,+789,+987,+741,+147' 

 

I cannot get any results. Can you please point me in the right direction?

I have Orders and Order Entry two objects (Master Detail relationship)

 

so Far gud

 

For example say i have entered one record in Order Entries

 

When i am making a second record entry in order entry  can i use the values or referencing of the first record which belong to the same Order.

 

 

Hi All , 

please help me out.

I want to delete the case notes & attachment and I am a user with Read , Create , Edit , Delete  permission.

Once I try to delete attchment raise error Insufficient prevelages.

 

Once I did it Modify All Data Permission then only I am able to delete the case attachment. But I dont want to give Modify All data permission.

 

How can be do that , is there any other way to handle this .

 

 

Thanks in advance..

 

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Chk_Unique_Email caused an unexpected exception, contact your administrator: Chk_Unique_Email: execution of BeforeInsert caused by: System.NullPointerException: Attempt to de-reference a null object: Trigger.Chk_Unique_Email: line 62, column 9

 

I am getting this error when I'm trying to enter a new lead in Lead Object. Though it should give error that this email id already exist that what i have done in trigger but it's showing this error and strange thing is it's showing this error for a single user only, when trying to enter data for another user whos email id already exist it shows normal error. Can any one please explain me why.??

 

Do also tell me if i need any change in trigger..

trigger Chk_Unique_Email on Lead (before insert,before update) 
{
  Map<String, Lead> PrgEid = new Map<String, Lead>();
    for(Lead led:System.Trigger.new)
    {
        if((led.PRG_Employee_ID__c!=null) && (led.PRG_Employee_ID__c!=''))
        {
          if(Trigger.isInsert) 
            {
              String AccountID = led.PRG_Company__c;
              Account[] SalesForceAccunt = [Select Name from Account where ID=:AccountID];
              for(Account Acc:SalesForceAccunt)
              {
                String AccName = Acc.Name;
                AccName += ' ' + led.PRG_Employee_ID__c;
                PrgEid.put(AccName,led);
              }
             }
            if(Trigger.isUpdate)
            {
              if(led.PRG_Employee_ID__c != System.Trigger.oldMap.get(led.Id).PRG_Employee_ID__c)
                {
                  String AccountID = led.PRG_Company__c;
                Account[] SalesForceAccunt = [Select Name from Account where ID=:AccountID];
                for(Account Acc:SalesForceAccunt)
                {
                  String AccName = Acc.Name;
                  AccName += ' ' + led.PRG_Employee_ID__c;
                  PrgEid.put(AccName,led);
                }
              }
      }
        }
    }
    if(PrgEid.size()>0)
    {
      Lead[] ExistLead = [select ID, PRG_Company__c, PRG_Employee_ID__c, PRG_Unique_Identifier__c, Name from Lead where PRG_Unique_Identifier__c in : PrgEid.keySet() and IsConverted=false and IsDeleted=false limit 1000];
      if(ExistLead.size()>0)
      {
        for(Lead CheckLead:ExistLead)
        {
          Lead MapLead = PrgEid.get(CheckLead.PRG_Unique_Identifier__c);
          if(CheckLead.Id != MapLead.Id)
          {
            MapLead.PRG_Employee_ID__c.addError('Employee ID is exist for lead: <b><a href="/'+CheckLead.Id+'"/>'+CheckLead.Name+'</a></b>');
            break;
          }
        }
      }
      else
      {
        //For Sandbox
        //Contact[] ExistContact = [select ID, PRGUnique_Emp_ID__c, Name from Contact where PRGUnique_Emp_ID__c in : PrgEid.keySet() and IsDeleted=false and Rec_Typ__c='01270000000DVFp' limit 1000];
        //Contact[] ExistContact = [select ID, PRGUnique_Emp_ID__c, Name from Contact where PRGUnique_Emp_ID__c in : PrgEid.keySet() and IsDeleted=false and RecordTypeId='01270000000DVFpAAO' limit 1000];
        //For Production
        Contact[] ExistContact = [select ID, PRGUnique_Emp_ID__c, Name from Contact where PRGUnique_Emp_ID__c in : PrgEid.keySet() and IsDeleted=false and RecordTypeId='01270000000DVFpAAO' limit 1000];
        if(ExistContact.size()>0)
        {
          for(Contact CheckContact:ExistContact)
          {
            Lead MapLeadContact = PrgEid.get(CheckContact.PRGUnique_Emp_ID__c);
            MapLeadContact.PRG_Employee_ID__c.addError('Employee ID is exist for Contact: <b><a href="/'+CheckContact.Id+'"/>'+CheckContact.Name+'</a></b>');
            break; 
          }
        }
      } 
    }
}

 


these are the two trigger splz help me bulkify them

 

trigger Auto_Populate_salesteam_create_splits on Opportunity (after insert) 
{
for(opportunity o:trigger.new)
{
//GET ALL ACCOUNT TEAM MEMBERS EXCEPT THE OWNER OF THE OPPORUNITY
integer comm =0;
opportunityteammember[] otm = [select id,UserId from opportunityteammember where opportunityid=:o.id];
Integer otmcount = otm.size();
system.debug('otmcount:'+otmcount);
splits__c spl4oppowner = new splits__c();
spl4oppowner.opportunity__c = o.id; 
spl4oppowner.user__c = o.ownerid; 
spl4oppowner.Split__c = (100/(otmcount+1));
insert spl4oppowner;

for(opportunityteammember otm1:otm){

comm =  (otmcount);
splits__c spl = new splits__c();

spl.opportunity__c = o.id;
spl.user__c = otm1.userid;
spl.Split__c = (100/(comm+1));
insert spl;
//comm= comm+1;

}
}

}
trigger 2:
trigger Auto_Populate_salesteam on Opportunity (after insert) 
{
public list<opportunityteammember> o1 {get;set;}
o1 =new list<opportunityteammember>();
for(opportunity o:trigger.new)
{
//GET ALL ACCOUNT TEAM MEMBERS EXCEPT THE OWNER OF THE OPPORUNITY

accountteammember[] atm=[select id,UserId,TeamMemberRole from accountteammember 
where userid!=:o.ownerid AND(accountid=:o.Primary_Agency_Buyer__c or accountid=:o.brand__c or accountid=:o.Accountid)];
for(accountteammember atm1:atm)
{
//if(o.ownerid!=atm1.userid){
//FOR EACH ACCOUNT TEAM MEMBER CREATE A NEW OPPORTUNITY TEAM MEMBER ON OPPORTUNITY
opportunityteammember otm = new opportunityteammember();
otm.userid=atm1.userid;
otm.opportunityid=o.id;
otm.TeamMemberRole = atm1.TeamMemberRole;
o1.add(otm);
//}
}
insert o1;
}
}

 

 

Could someone explain why the slash "/' is required for the link to work in the example below?

 

When I use this  code, the link does not work. I get an error: "The name '...' can only contain alphanumeric characters, must begin with a letter, and must be unique."

 

<apex:column headerValue="Contract Number">
<apex:outputLink value="{!c.Id}">{!c.ContractNumber}</apex:outputLink>
</apex:column>

 

However when I add the slash "/" everything works as expected. Is this documented somewhere? I have not found an explanation yet.

 

<apex:column headerValue="Contract Number">
<apex:outputLink value="/{!c.Id}">{!c.ContractNumber}</apex:outputLink>
</apex:column>

  • December 13, 2011
  • Like
  • 0

Hi,

 

Currently i am displaying help text on VF Page instead of field label names because field names are having many characters in it.

I need to display poup help text on dat VF page where i am displaying  help text instead field label.

 

  • Help text pop-up are having more than 255 characters in it.
  • Every field is having different description in it.

 

  • MY Question:Is there anyway i can display  pop up help text on VF Page?

 

  • Thanks in Advance.Plz help me out 
  • December 12, 2011
  • Like
  • 0

Hello,

 

Is there a way to selecte the default "Relate to" lookup field value where a Task is created from the Home tab?

 

Currently when I click new task from the home tab, the "Relate to" value defaults to selecting an Opportunity.  I would like it to default to an Account.

 

thanks,

 

Mirko  

Hello,

 

Does anyone know is the columns of the Tasks can be modified under the Home tab?

 

thanks for the help!

 

Mirko

Hii all ,

I have the requirement that i have 5 pageblock section  such that each pageblocksection  contains the all feilds and the entire page contains only one save button such that i have to insert the all the fields

i'm giving the code can u get me the correct approach for the code

 

 

<apex:page controller="file2">
<apex:form >
<apex:pageBlock >

<apex:pageBlockButtons >
<apex:commandButton value="Save" action="{!save}" />
</apex:pageBlockButtons>

<apex:pageBlockTable value="{!f1}" var="f" id="form1">

<apex:column headerValue="Name">
<apex:inputField value="{!f.Name}"/>
</apex:column>
<apex:column headerValue="Description">
<apex:inputField value="{!f.Description__c}"/>
</apex:column>
</apex:pageBlockTable>
<apex:pageBlockTable value="{!f1}" var="f" id="form2" >

<apex:column headerValue="Name">
<apex:inputField value="{!f.Name}"/>
</apex:column>
<apex:column headerValue="Description">
<apex:inputField value="{!f.Description__c}"/>
</apex:column>
</apex:pageBlockTable>

</apex:pageBlock>
</apex:form>
</apex:page>

 

 

controller

-----------------------------------

public with sharing class file2 {

public file2() {
f1 = new List<File__c>();
f1.add(new File__c());

}


public List<File__c> f1 {get; set;}

public PageReference save()
{
insert f1;

return null;
}
}

 

Hi,

 


While creating Home page Components i choose component of Type HTML Area to display it in wide region.

 

From this i want to call Visual Force page for that i wrote like below

 

<HTML>

<a href=URL.getSalesforceBaseUrl().toExternalForm()+'/apex/UsePolicyTest'>Click Here</a>

</HTML>


But it is showing as is in the Home Page and it is not calling VisualForce Page.


Can anyone please share ideas on how to call Visual Force Page from here..

Hi,

 

When the tab gets loaded, how can we call A VisualForce page (with out any actions from side bar).

 

I am able to achieve this by having custom link in the Home tab(in the Side bar) and when the user clicks on the link it is calling that VisualForce page.

 

But our requirement to achive this without a link click in the sidebar and that VisualForce page has to be called in the Wide Area.

 

Your feedback is appeciated.

Select FieldA__c, Contact__c FROM Account WHERE Contact__c = '+123,+321,+456,+654,+789,+987,+741,+147' 

 

I cannot get any results. Can you please point me in the right direction?