• Apex-Trigger
  • NEWBIE
  • 0 Points
  • Member since 2011

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 5
    Replies

Hi ,

 

My apex code :

 

public class DelMerchandise {

int i;
public string[] products=new string[]{};
public string[] getproducts() {
return products;
}

public void setproducts(string[] products){
this.products=products;
}

public List<SelectOption> getproductslist() {
list <SelectOption> options=new list <SelectOption>();
for(Merchandise__c items:[select name ,price__c from Merchandise__c ])
{
options.add(new SelectOption(String.valueof(items.price__c),items.name ));
}
return options;
}

public pagereference del()
{
for(i=0;i<products.length;i++)
{
List <Merchandise__c> del1 =[ select name from Merchandise__c where name=products[i]];
delete del1;
}
 PageReference pageref=page.deletedsuccess;
return pageref;
}

 

I got error in marked line .....

 

My Visual force code :

 

<apex:page standardStylesheets="false" showHeader="false" sidebar="false" readOnly="true"
controller="DelMerchandise" >
<br/><br/>
<h2 > Select the product to delete :</h2><br/><br/>
<apex:stylesheet value="{!URLFOR($Resource.milestone_stylshet, 'style.css')}"/>
<apex:form >
<apex:selectCheckboxes value="{!products}" layout="pageDirection">
<apex:selectOptions value="{!productslist}" />
</apex:selectCheckboxes><br/><br/>
<apex:commandButton action="{!del}" value="Delete"/>
</apex:form>
</apex:page>

 

.....Any solution ?....

 

thanks ,

 

jana

Hi ,

 

  Do salesforce allow , salesforce platform profile user to create objects ?.....Can any one help?..

 

Thanks,

Hi ,

 

  Do salesforce allow , salesforce platform profile user to create objects ?.....Can any one help?

 

Thanks,

Hi ,

 

  Do salesforce allow , salesforce platform profile user to create objects ?.....Can any one help?

 

Thanks,

Hi ,

      I got a error , Account type is not visible . I checked sharing settings it is fine  , I am working as sys admin , My apex code is correct , I dont know where i gone wrong , Can any one help me ?..

 

What security settings i have to check . My apex code is fine , I have a problem in security settings can any one help me about security settings for account , 

 

Error : 'account type is not visible '

 

 

Thanks ,

 

Jana

Hi ,

      I got a error , Account type is not visible . I checked sharing settings it is fine  , I am working as sys admin , My apex code is correct , I dont know where i gone wrong , Can any one help me ?..

 

Thanks ,

 

Jana

Hi ,

      I got a error , Account type is not visible . I checked sharing settings it is fine  , I am working as sys admin , My apex code is correct , I dont know where i gone wrong , Can any one help me ?..

 

Thanks ,

 

Jana

trigger AccountDelete on Account (before delete) {

for(account a: trigger.old)
{
if(a.Name!='todelete')
{
a.addError('You Dont have access to delete this account');
}
}

}

I dont know what is wrong in that .What it means can any one help ...?

Hi ,

      I got a error , Account type is not visible . I checked sharing settings it is fine  , I am working as sys admin , My apex code is correct , I dont know where i gone wrong , Can any one help me ?..

 

Thanks ,

 

Jana

trigger AccountDelete on Account (before delete) {

for(account a: trigger.old)
{
if(a.Name!='todelete')
{
a.addError('You Dont have access to delete this account');
}
}

}

I dont know what is wrong in that .What it means can any one help ...?