• Sindhu Ambarkar
  • NEWBIE
  • 60 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 26
    Questions
  • 41
    Replies
Hi,

Iam facing issue in wrapper class
Custom object:Doctor__c,Patient__c is having lookup to Doctor__c

Controller

public class doctor
{
public List<Doctor__c> d{get;set;}
public List<Patient__c> l{get;set;}
public set<string> member=new set<string>();
public List<selectwrapper> li{get;set;}
PUBLIC map<string,Doctor__c> dm=new map<string,Doctor__c>();
public map<string,Patient__c> tm=new map<string,Patient__c>();
public doctor()
{
li=new List<selectwrapper>();
d=[select name,Type__c from Doctor__c];
if(d.size()>0)
{
For(Doctor__c Ls:d)
{
member.add(Ls.Name);
dm.put(Ls.Name,ls);
}
}
l=[select Name,DoctorSpec__c from Patient__c where DoctorSpec__c IN:member];
if(l.size()>0)
{
for(Patient__c pl:l)
{
if(!tm.containskey(pl.DoctorSpec__c))
{
tm.put(pl.DoctorSpec__c,pl);
}
}
for(String i:tm.keyset())
{
li.add(new selectwrapper(dm.get(i),tm.get(i)));
}
}
system.debug('list'+li);
}
public  class selectwrapper
{
public Doctor__c dt{get;set;}
public Patient__c td{get;set;}
public selectwrapper(Doctor__c dt,Patient__c td)
{
this.dt=dt;
this.td=td;
}
}
}

page

<apex:page controller="doctor">
<apex:form >
<apex:pageblock >
<apex:pageblocktable value="{!li}" var="c">
<apex:column value="{!c.dt.Name}"/>
<apex:column value="{!c.dt.Type__c}"/>
<apex:column>
<apex:pageblocktable value="{!c.td}"  var="l">
<apex:column value="{!l.Name}"/>
</apex:Pageblocktable>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
Facing issue in the page

Please help me out
I have two custom objects Job_Application_c,review__c
I need to write child to parent relationship soql query.
Please help me
Thanks & Regards,
Sindhu Ambarkar.
Hi.
I need to override standard new buuton on account to display custom message to user.
Please help me.
Thanks & Regards,
Sindhu Ambarkar.
Hi,
I need to fetch the records from grantparent-parent-child
Please help me.
Thanks & Regards,
Sindhu Ambarkar.
Hi,

When the account is created contact is created automatically.
trigger childc on Account (before insert) {
List<contact> con=new List<contact>();
    for(Account a:trigger.new)
    {
        contact c=new contact();
        c.Accountid=a.id;
        c.lastname=a.name;
        con.add(c);
    }
    insert con;
}
Please help
Thanks & Regards,
Sindhu Ambarkar.
Hi,

I have to restrict the number of child records on master record upto 5
Job application is master,review is child.
Number of review is roll up field on master object.

trigger Saivenkat on review__c (before insert) {
    List<id> parent=new List<id>();
    List<job_application__c> a=new List<job_application__c>(); 
    for(review__c ar:Trigger.new)
    {
        parent.add(ar.job_application__c);
    }
   a=[select Name,number_of_review__c from job_application__c where Name in:parent ];
    for (job_application__c vara:a)
    {
      if(vara.number_of_review__c>=5)
      {
            Apexpages.addMessage(new Apexpages.message(Apexpages.Severity.ERROR,'it is not filter match'));
        }
    }
}
Please help me
Thanks & Regards,
Sindhu Ambarkar.
Hi

My requirement is when i click on first radio button 5 fields tto be displayed
when i click on the another radio button other fields to  bedisplayed
can Someone help me

public class sectiondisplay
{
public Account acc{get;set;}
public string atop{get;set;}
public boolean ename{get;set;}
public sectiondisplay(Apexpages.standardcontroller controller)
{
atop='company';
acc.search__c=atop;
}
public void m1()
{
ename=true;
}
public List<Selectoption> getvalues()
{
List<Selectoption> optionvalues = new List<selectoption>();

optionvalues.add(new Selectoption('Company', 'company'));
optionvalues.add(new selectoption('talent','talent'));
return optionvalues;
}
}
<apex:page standardcontroller="Account" extensions="sectiondisplay">
<apex:form >
<apex:selectradio value="{!atop}">
<apex:selectoptions value="{!values}"/>
<apex:actionsupport event="onchange" action="{!m1}" rerender="cpblock"/>
</apex:selectradio>
<apex:pageblock id="cpblock">
<apex:pageblocksection title="details">
<apex:inputfield value="{!Account.type}" rendered="{!ename}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:form>
</apex:page>
Thanks & Regards,
Sindhu Ambarkar.
Hi,
Based on change in the picklist value the value should be displayed in outputtext in visualforce page.Can someone help with the sample code for the actionsupport or actionfunction for onchange event.

Thanks & Regards,
Sindhu Ambarkar.
Hi,

I have 3 objects A,B and C .B is the junction object between A and C.How to get the C records from A.Please help with code.

Thanks & Regards,
Sindhu Ambarkar.
Hi,

Iam trying to copy the address field of account to contact whenever the contact is inserted or updated.It is working fine when the contact is created but when iam trying to update the contact getting the DML exception.CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
Please help me
* After the contact is created shipping address fields of account should be copied to contacts */
trigger ShippingAddresscopytoContact on Contact (after insert,after update) 
{
if(trigger.isInsert||trigger.isUpdate)
    {
            List<Contact> Listofcontacts=[SELECT id,OtherStreet,OtherCity,OtherCountry,OtherPostalCode,OtherState,Account.shippingStreet,Account.shippingCity,Account.shippingState,Account.shippingCountry,Account.shippingPostalCode FROM Contact WHERE ID IN:trigger.new];
            for(Contact c:Listofcontacts)
               {
                System.debug('c.Account.shippingStreet;'+c.Account.shippingStreet);
                c.OtherStreet=c.Account.shippingStreet;
                c.OtherCity=c.Account.shippingCity;
                c.OtherState=c.Account.shippingState;
                c.OtherCountry=c.Account.shippingCountry;
                c.OtherPostalCode=c.Account.shippingPostalCode;
             } //End of for loop
            Database.update(Listofcontacts);
     } //End of if
Hi,

I have used two values on checkbox text but it is not getting displayed.Please help me

Code for visuaalforce page
<apex:pageBlockSectionItem >
<apex:outputText value="Schedule"/>
<apex:selectCheckboxes value="{!Doc}">
<apex:selectOptions value="{!CheckList}"/>
</apex:selectCheckboxes>
</apex:pageBlockSectionItem>

Apex
public List<SelectOption> getCheckList()
 {
 
 List<SelectOption> options = new List<SelectOption>();
options.add(new selectOption('*yes','*yes'));
options.add(new selectOption('no,'*no'));
return options;
}\
On the visualforce page only checkbox is displayed without yes and no values
Hi,

I want to download the pdf automatically using render as pdf i tried using contenttype attribute.Its throwing error

Thanks & Regards,
Sindhu Ambarkar.
Hi,
I need to apply styling for pageblocksection.Here is the code

<apex:page standardcontroller="Account" showHeader="true" tabStyle="account">
  <style>
  .activetab {background-color:green color:white background-image:none>
  .inactivetab {background-color:white color:black background-image:none>
  </style>
<apex:form>
  <apex:tabPanel switchtype="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:pageblock>
<apex:pageblocksection title="Account" columns="1">
<apex:inputfield value="{!account.name}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:tab>
</apex:tabpanel>
</apex:form>
</apex:page>
I need to apply styling for pageblocksection 
Can someone help me

Thanks & Regards,
Sindhu Ambarkar.
Hi,

Iam using <apex:pageblocksection title="Info"> in render as pdf page.But this styling is not working when renderas pdf attribute is used.
Normally pageblocksection styling which it displays in box is not getting displayed in pdf.Can someone help me with CSS style and html

Thanks & Regards,
Sindhu Ambarkar.
Hi,

I have a visualforce page similar to registration form.I need to create tabs.In the each tab fields are present user should enter.How can i achieve this.Using pageblockblocksection it is working fine but Title should be in tabs.Please help me out
Hi,

Getting JSON error expecting curly brace on beginning of object.Code is looking fine
Can someone explain me.

Thanks & Regards,
Sindhu Ambarkar.
Hi,

trigger contactrecords on Account (before insert)
 {

    List<String> myname=new List<String>();
    for(Account a:trigger.new)
    {
    myname.add(a.name);
    }
    List<contact> mycontact=[select id,name from contact where name in:myname];
    delete mycontact;
}

Please help me.
rigger Acc_Con_Insert on Account (after update) {
    List<Account> acc = new List<Account>();
    List<Account> acc1 = new List<Account>();
    acc1 = [SELECT id, BillingAddress from Account WHERE id IN :Trigger.new];
    for(Account acc2: acc1) {
        if(acc2.BillingAddress != null)
        {
            acc.add(acc2);
        }
    }
    UpdateContact uc = new UpdateContact();
    uc.m1(acc);
}

public class UpdateContact {
public void m1(List<Account> accounts)
{
    List<Contact> con_upd=new List<Contact>();
    Map<Id,Account> m1=new Map<Id,Account>([select id,name,BillingStreet,(select id,lastname,MailingStreet from Contacts) from Account where id in:accounts]);
    for(Account acc: accounts){
        for(Contact c1:m1.get(acc.id).contacts){
            c1.MailingStreet=acc.BillingStreet;
            con_upd.add(c1);
        }
    }
    update con_upd;
}
}
Getting this error when trying to retrieve.When the contact is created shipping address fields of account should be copied to other address fields of contact.
trigger ShippingAddressFieldcopytoOtherAddress on Contact (after insert) {

//When contact is created shipping address fields from account should be copied to other address of contact
For(Contact con:trigger.new)
{
con.OtherCountry=con.account.ShippingCountry;
}
Hi,
I need to apply styling for pageblocksection.Here is the code

<apex:page standardcontroller="Account" showHeader="true" tabStyle="account">
  <style>
  .activetab {background-color:green color:white background-image:none>
  .inactivetab {background-color:white color:black background-image:none>
  </style>
<apex:form>
  <apex:tabPanel switchtype="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:pageblock>
<apex:pageblocksection title="Account" columns="1">
<apex:inputfield value="{!account.name}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:tab>
</apex:tabpanel>
</apex:form>
</apex:page>
I need to apply styling for pageblocksection 
Can someone help me

Thanks & Regards,
Sindhu Ambarkar.
Hi,

Iam facing issue in wrapper class
Custom object:Doctor__c,Patient__c is having lookup to Doctor__c

Controller

public class doctor
{
public List<Doctor__c> d{get;set;}
public List<Patient__c> l{get;set;}
public set<string> member=new set<string>();
public List<selectwrapper> li{get;set;}
PUBLIC map<string,Doctor__c> dm=new map<string,Doctor__c>();
public map<string,Patient__c> tm=new map<string,Patient__c>();
public doctor()
{
li=new List<selectwrapper>();
d=[select name,Type__c from Doctor__c];
if(d.size()>0)
{
For(Doctor__c Ls:d)
{
member.add(Ls.Name);
dm.put(Ls.Name,ls);
}
}
l=[select Name,DoctorSpec__c from Patient__c where DoctorSpec__c IN:member];
if(l.size()>0)
{
for(Patient__c pl:l)
{
if(!tm.containskey(pl.DoctorSpec__c))
{
tm.put(pl.DoctorSpec__c,pl);
}
}
for(String i:tm.keyset())
{
li.add(new selectwrapper(dm.get(i),tm.get(i)));
}
}
system.debug('list'+li);
}
public  class selectwrapper
{
public Doctor__c dt{get;set;}
public Patient__c td{get;set;}
public selectwrapper(Doctor__c dt,Patient__c td)
{
this.dt=dt;
this.td=td;
}
}
}

page

<apex:page controller="doctor">
<apex:form >
<apex:pageblock >
<apex:pageblocktable value="{!li}" var="c">
<apex:column value="{!c.dt.Name}"/>
<apex:column value="{!c.dt.Type__c}"/>
<apex:column>
<apex:pageblocktable value="{!c.td}"  var="l">
<apex:column value="{!l.Name}"/>
</apex:Pageblocktable>
</apex:column>
</apex:pageblocktable>
</apex:pageblock>
</apex:form>
</apex:page>
Facing issue in the page

Please help me out
Hi.
I need to override standard new buuton on account to display custom message to user.
Please help me.
Thanks & Regards,
Sindhu Ambarkar.
Hi,
I need to fetch the records from grantparent-parent-child
Please help me.
Thanks & Regards,
Sindhu Ambarkar.
Hi,

When the account is created contact is created automatically.
trigger childc on Account (before insert) {
List<contact> con=new List<contact>();
    for(Account a:trigger.new)
    {
        contact c=new contact();
        c.Accountid=a.id;
        c.lastname=a.name;
        con.add(c);
    }
    insert con;
}
Please help
Thanks & Regards,
Sindhu Ambarkar.
Hi,

I have to restrict the number of child records on master record upto 5
Job application is master,review is child.
Number of review is roll up field on master object.

trigger Saivenkat on review__c (before insert) {
    List<id> parent=new List<id>();
    List<job_application__c> a=new List<job_application__c>(); 
    for(review__c ar:Trigger.new)
    {
        parent.add(ar.job_application__c);
    }
   a=[select Name,number_of_review__c from job_application__c where Name in:parent ];
    for (job_application__c vara:a)
    {
      if(vara.number_of_review__c>=5)
      {
            Apexpages.addMessage(new Apexpages.message(Apexpages.Severity.ERROR,'it is not filter match'));
        }
    }
}
Please help me
Thanks & Regards,
Sindhu Ambarkar.
Hi,
Based on change in the picklist value the value should be displayed in outputtext in visualforce page.Can someone help with the sample code for the actionsupport or actionfunction for onchange event.

Thanks & Regards,
Sindhu Ambarkar.
Hi,

Iam trying to copy the address field of account to contact whenever the contact is inserted or updated.It is working fine when the contact is created but when iam trying to update the contact getting the DML exception.CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY
Please help me
* After the contact is created shipping address fields of account should be copied to contacts */
trigger ShippingAddresscopytoContact on Contact (after insert,after update) 
{
if(trigger.isInsert||trigger.isUpdate)
    {
            List<Contact> Listofcontacts=[SELECT id,OtherStreet,OtherCity,OtherCountry,OtherPostalCode,OtherState,Account.shippingStreet,Account.shippingCity,Account.shippingState,Account.shippingCountry,Account.shippingPostalCode FROM Contact WHERE ID IN:trigger.new];
            for(Contact c:Listofcontacts)
               {
                System.debug('c.Account.shippingStreet;'+c.Account.shippingStreet);
                c.OtherStreet=c.Account.shippingStreet;
                c.OtherCity=c.Account.shippingCity;
                c.OtherState=c.Account.shippingState;
                c.OtherCountry=c.Account.shippingCountry;
                c.OtherPostalCode=c.Account.shippingPostalCode;
             } //End of for loop
            Database.update(Listofcontacts);
     } //End of if
Hi,

I want to download the pdf automatically using render as pdf i tried using contenttype attribute.Its throwing error

Thanks & Regards,
Sindhu Ambarkar.
Hi,
I need to apply styling for pageblocksection.Here is the code

<apex:page standardcontroller="Account" showHeader="true" tabStyle="account">
  <style>
  .activetab {background-color:green color:white background-image:none>
  .inactivetab {background-color:white color:black background-image:none>
  </style>
<apex:form>
  <apex:tabPanel switchtype="client" selectedTab="tabdetails"
id="AccountTabPanel" tabClass="activeTab"
inactiveTabClass="inactiveTab">
<apex:tab label="Details" name="AccDetails" id="tabdetails">
<apex:pageblock>
<apex:pageblocksection title="Account" columns="1">
<apex:inputfield value="{!account.name}"/>
</apex:pageblocksection>
</apex:pageblock>
</apex:tab>
</apex:tabpanel>
</apex:form>
</apex:page>
I need to apply styling for pageblocksection 
Can someone help me

Thanks & Regards,
Sindhu Ambarkar.
Hi,

Iam using <apex:pageblocksection title="Info"> in render as pdf page.But this styling is not working when renderas pdf attribute is used.
Normally pageblocksection styling which it displays in box is not getting displayed in pdf.Can someone help me with CSS style and html

Thanks & Regards,
Sindhu Ambarkar.
Hi,

Getting JSON error expecting curly brace on beginning of object.Code is looking fine
Can someone explain me.

Thanks & Regards,
Sindhu Ambarkar.

trigger AccountDuplicateTrigger on Account (before insert, before update)
{
for(Account a:Trigger.new)
{
List<Account> acc="Select id from Account where Name=:a.Name";
if(acc.size()>0)
{
acc.Name.addError(‘You Cannot Create the Duplicate Account’);
}
}
}
It should display error when account name is duplicate please help me
 

I'm using VisualForce page to generate pdf, has anyone successfully added footer to pdf?

 

I've tried the solution below by using @page stylesheet, but with no luck, the footer element is basically disappeared.

http://help.salesforce.com/apex/HTViewSolution?id=000003705&language=en_US

 

 

  • November 18, 2013
  • Like
  • 0