• Srinu@dreams
  • NEWBIE
  • 30 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 34
    Questions
  • 10
    Replies

Really need some help!  I created a Trigger that inserts records into a custom object.  The after insert is working.  However, the trigger just keeps inserting records.  Need help with the after update part.  How do I use Old.map New.Map in this trigger?  OppShipMonthAssociation__c is a junction object.  Ship_Month__c is a custom object.  Code is below:

 

trigger insertOppShipMoAssoc on Opportunity (after insert, after update) {
	List<OppShipMonthAssociation__c> osmas = new List<OppShipMonthAssociation__c>();
    for (Opportunity newOpportunity: Trigger.New) {
    	for (integer i = 0; i < newOpportunity.Number_of_Ship_Months__c; i++ ) {
            if(newOpportunity.Book_Ship_in_QTR__c == 'Yes' && newOpportunity.ForecastCategoryName == 'Commit') {
                Osmas.add(new OppShipMonthAssociation__c(
                        Name = newOpportunity.Id,
                    	Opportunity__c = newOpportunity.Id,
                		Ship_Month__c = ));
                
                
            }
		}
		 insert Osmas;
	}
}

 

My batch apex was working fine before the creation of validation rule,

After the creation of a validation rule I was not able to update records due to validation rule.

could you people please tell me,How can I avoid this error in batch class?

{!REQUIRESCRIPT("/soap/ajax/24.0/connection.js")}
{!REQUIRESCRIPT("/soap/ajax/20.0/apex.js")}
{!REQUIRESCRIPT("{!URLFOR($Resource.jquery)}")}

 

 

Where can I find "/soap/ajax/24.0/connection.js", "/soap/ajax/20.0/apex.js" these files in salesforce?

What is the purpose of using these files?

How to add users who are above hierarchy to account team member?

In visualforce page, I have a link once I click on that link it should change from red color to green color, I am getting in html but it is not working in visualforce?

String a = 'Java';
String b = new String(a);
String c = 'Java';
System.Debug('***'+a);
System.Debug('***'+b);

Is it possible to create like this in apex,? In java it is possible.

According to my understanding we can retrive data form model, this might be the silly question but I need to know.

How can I resolve above error?

 

For these line I am getting the error

<a href="syntax/css/shCore.css" rel="stylesheet" type="text/css" />
<a href="syntax/css/shThemeDefault.css" rel="stylesheet" type="text/css" />

 

Is it possible to import data from .csv file using batch apex?

What is the main difference between dataloader and batch apex?

Really need some help!  I created a Trigger that inserts records into a custom object.  The after insert is working.  However, the trigger just keeps inserting records.  Need help with the after update part.  How do I use Old.map New.Map in this trigger?  OppShipMonthAssociation__c is a junction object.  Ship_Month__c is a custom object.  Code is below:

 

trigger insertOppShipMoAssoc on Opportunity (after insert, after update) {
	List<OppShipMonthAssociation__c> osmas = new List<OppShipMonthAssociation__c>();
    for (Opportunity newOpportunity: Trigger.New) {
    	for (integer i = 0; i < newOpportunity.Number_of_Ship_Months__c; i++ ) {
            if(newOpportunity.Book_Ship_in_QTR__c == 'Yes' && newOpportunity.ForecastCategoryName == 'Commit') {
                Osmas.add(new OppShipMonthAssociation__c(
                        Name = newOpportunity.Id,
                    	Opportunity__c = newOpportunity.Id,
                		Ship_Month__c = ));
                
                
            }
		}
		 insert Osmas;
	}
}

 

My batch apex was working fine before the creation of validation rule,

After the creation of a validation rule I was not able to update records due to validation rule.

could you people please tell me,How can I avoid this error in batch class?

I have VP/Apex Class that updates a record.When the page first loads it grabs the first record that meets a particular criteria.

 

Here is the code that runs when the record is submitted. What should happen is upon submission it should update a checkbox (and some other fields) and then set the PageReference to the same page and then reload that page.

 

One of the criteria for the selected record is that the Resume Review Completed field should be false therefore after a submission the current record should drop out. (which it does if I reload manually)

 

 

public pageReference doSubmitReview()
	{
        
        if (ResumeStatus != '' && ResumeStatus != null)
        {
        	cRC.Status__c = ResumeStatus;	
        }
        cRC.Resume_Review_Completed__c = true;
        Update cRC;

        nextlink = '/apex/TBR_Resume_Review';
        PageReference nextPage = new PageReference(nextlink);
        return nextPage;
			
	}

What I notice is the bottom part (not url) seems to reload, it almost appears as if its reloading cache of the prior page load. If I manually choose to click reload I get the results I expect.

 

Is there something else I should be doing to force a proper reload.

 

 

Hi all,

 

  i created related list, in that  one object data retrive to related list , this data add to another object when check box is true and   Add button click.  and return that data visible to same pageblock . 

 

my vf page:

 

<apex:page tabStyle="Container__c" standardController="Container__c" extensions="Container">
<apex:form >
<apex:detail relatedList="false" title="true"/>
<apex:pageBlock title="Container Line Items">
<center> <apex:commandButton value="ADD" action="{!save}"/></center>
<apex:outputPanel rendered="{!new1}">
<table>
<tr>
<th width="100">check</th>
<th width="150"><b>PPI Line item number </b></th>
<th width="100"><b>Order Quantity</b></th>
&nbsp;&nbsp;<th width="200"><b>PPI</b></th>
<th width="100"><b>Products</b></th>
<th width="100"><b>Shipped Quantity</b></th>
<th width="200"><b>Balance Quantity</b></th>
</tr>
<apex:repeat value="{!polist}" var="e" >
<!---<apex:outputPanel rendered="{!data}">--->
<tr>
<td><apex:inputCheckbox value="{!ch}">
<!--<apex:actionSupport event="onclick" />-->
</apex:inputCheckbox></td>
<td><apex:outputfield value="{!e.name}"/></td>
<td><apex:outputField value="{!e.Order_Quantity__c}"/></td>
<td><apex:outputField value="{!e.PPI__c}"/></td>
<td><apex:outputField value="{!e.Products__c}"/></td>
<td><apex:outputfield value="{!e.Shipped_Quantity__c}"/></td>
<td><apex:outputfield value="{!e.Balance_Quantity__c}"/></td>
</tr>
</apex:repeat>
<apex:repeat value="{!slist}" var="ee">
<apex:outputPanel rendered="{!new2}">
<tr>
<td></td>
<td><apex:outputfield value="{!ee.name}"/></td>
<td><apex:outputField value="{!ee.Order_Quantity__c}"/></td>
<td><apex:outputField value="{!ee.PPI__c}"/></td>
<td><apex:outputField value="{!ee.Products__c}"/></td>
<td><apex:outputfield value="{!ee.Shipped_Quantity__c}"/></td>
<td><apex:outputfield value="{!ee.Balance_Quantity__c}"/></td>
</tr>
</apex:outputPanel>
</apex:repeat>
</table>
</apex:outputPanel>
</apex:pageBlock>
</apex:form>
</apex:page>

 

Controller :

 

public class Container {
public Id poid{set;get;}
public boolean ch{set;get;}
public Container__c con{set;get;}
public boolean new1{set;get;}
public boolean new2{set;get;}
public map<id,Container_Lineitems__c> polmap{set;get;}
//public list<wrappo> pplist{set;get;}
public Container_Lineitems__c edu{set;get;}

public Container(ApexPages.StandardController controller) {
PoId=Apexpages.currentpage().getParameters().get('id');

polmap=new map<id,Container_Lineitems__c>();
//PPlist=new list<wrappo>();
new1=true;

general();
}
list<PPI_Line_items__c> polist = new list<PPI_Line_items__c>();

public void general()
{
con = [select id, PPI_No__c from Container__c where id=:PoId];

for(PPI_Line_items__c pp:[select id,Name,Order_Quantity__c,PPI__c,Products__c,Shipped_Quantity__c,Balance_Quantity__c from PPI_Line_items__c where PPI__c =:con.PPI_No__c])
{
polist.add(pp);
}
new1=true;
//new2=false;
//system.debug('new2!!!!!!!!'+ new2);
}
public list<Container_Lineitems__c> getslist()
{
return slist;
}
public list<PPI_Line_items__c> getpolist()
{
return polist;
}


list<Container_Lineitems__c> slist = new list<Container_Lineitems__c>();
list<PPI_Line_items__c> tempvalues = new list<PPI_Line_items__c>();
public void save()
{
for(PPI_Line_items__c p : tempvalues )
{
if(ch=true)
{

Container_Lineitems__c ss = new Container_Lineitems__c();
//ss.name = p.name;
ss.Order_Quantity__c = p.Order_Quantity__c;
ss.PPI__c =p.PPI__c;
ss.Products1__c = p.Products__c;
ss.Shipped_Quantity__c = p.Shipped_Quantity__c;
ss.Balance_Quantity__c =p.Balance_Quantity__c;

slist.add(ss);
insert slist;
system.debug('@@@@@@@@@'+ slist);
new2=true;
new1=false;
}
}

}
}

 

 

Thank you.

 

Hi

frnds,

 

Am new to web services i dnt know any thing about webserivces ,

I have some doubts in webservices 

plz gve sugeestion to me

 

1. what is web services?

2. why we use web serivces?

3.what is the best way to learn webservices

4.if any one have regarding books or pdf for webservices plz send to me

5.throgh webservices how we conncect one organization to anther organtion

 

 

plz any one give me idea about these question

 

Thank u for advance all my frnds....

VF error

 

Hi friends,

 

        This is Praveen, is there any way to show field level validation error (Same line) like above shown image using visual force. If it's possible can you please share one example with me to solve my issue?

 

Thanks & Regards,

Praveen

 

* There are two sObjects A and B.

* For A sobject user has access, For B he dont have access.

* If he write a Trigger on A sobject which intern want to access B sObject What will happen

Hi . In my vf page i am getting an error like  " Unknown property 'SObject.name' "

Controller :

List<Account> accList=new List<Account>([SELECT Name,ID,owner.name FROM Account]);

public List<objectwrapper> getavailableObjects() {

if(selected_object=='ACCOUNT') {
for(Account a:accList) {
wrapperList.add(new objectwrapper(a));
SelectObject();
}
}
return wrapperList;
}

public class objectwrapper  {
public sObject Objectwrap{get;set;}
public boolean selected {get;set;}
public objectwrapper(sObject sob)
{
Objectwrap=sob;
selected=false;
}

}

vf page :

<apex:pageBlockTable value="{!availableObjects}" var="obj">

<apex:column >
<apex:inputCheckbox value="{!obj.selected}" id="checkeddone">
<apex:actionSupport event="onclick" action="{!GetSelected}" reRender="Sel_OBJ"/>

</apex:inputCheckbox></apex:column>

<apex:column headerValue="Name" value="{!obj.Objectwrap.name}"/>
<apex:column headerValue="ID" value="{!obj.Objectwrap.Id}"/>
<apex:column headerValue="Owner" value="{!obj.Objectwrap.Owner.name}"/>
</apex:pageBlockTable>
</apex:pageBlock>

 
Can anyone please help. I am struck up with this. Thanks in advance !!

* By default all the pageblocks should be in hide.

* On chaning picklist value corresponding page block section should display remaining should hide

   If, I select india, only india pageblock section should display

   If, I select Us, only Us pageblock section should display

* I did it with command buttons

VF 
<apex:page controller="coun">
<apex:form >

<apex:commandButton value="India" action="{!india}" reRender="India,Us,Uk"/>
<apex:commandButton value="Us" action="{!us}" reRender="India,Us,Uk"/>
<apex:commandButton value="Uk" action="{!uk}" reRender="India,Us,Uk"/>

<apex:pageBlock >

<apex:outputPanel id="India">
<apex:pageBlockSection title="India" rendered="{!mhide}">
</apex:pageBlockSection>
</apex:outputPanel>

<apex:outputpanel id="Us">
<apex:pageBlockSection title="US" rendered="{!m1hide}">
</apex:pageBlockSection>
</apex:outputpanel>

<apex:outputpanel id="Uk">
<apex:pageBlockSection title="UK" rendered="{!m2hide}">
</apex:pageBlockSection>
</apex:outputpanel>

</apex:pageBlock>

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

 

APEX

public class coun {

    public Boolean hide = false;
    public Boolean hide1 = false;
    public Boolean hide2 = false;
   
    public void setMhide(Boolean b) {
    this.hide = b;
    }
   
    public Boolean getMhide() {
    return this.hide;
    }//Passing input dynamically through another method
   
   
    public Boolean getM1hide() {
        return this.hide2;
    }
   
    public void setM1hide(Boolean b) {
      this.hide2 = b; 
    }
   
   
    public Boolean getM2hide() {
        return this.hide1;
    }
   
    public void setM2hide(Boolean b) {
        this.hide1 = b;
    }
   
   
   public PageReference india() {
        setMhide(true);
        setM2hide(false);
        setM1hide(false);       
        return null;
    }
//displaying only india information and hiding other information
   
     public PageReference us() {
        setM1hide(true);
        setM2hide(false);
        setMhide(false);
        return null;
    }
   
    public PageReference uk() {
        setM2hide(true);
        setM1hide(false);
        setMhide(false);
        return null;
    }  
   
}

 *While trying with picklist, I got partial result.

*How to retrieve selected picklist value form vf to controller class and compare?