• swethasfdc
  • NEWBIE
  • 0 Points
  • Member since 2011

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

I want to randomly assign leads to users through trigger. I don't want to use lead assignment rule and assign them to a queue. when a lead is created it should go to user  X and another lead to user Y randomly.

I want to delete one of my record type on Account. I dont want to use it anymore.

Does anyone know how to multi edit  i.e disable recordtypes for all profiles at a time and I dont want to go to each profile and deselect it.

Hi All,

 I know this is one of the dirty way of writing the code....but i am a navie...pardon me for that.

 

 I have a field on an object which needs to be converted to uppercase.

     1. It should get converted when insert happens.

     2. It should get converted when update happens.

I know simple way of writing the code in 3 lines. But how to write the correct code in this way.

When we use dml operation like i have used update acc.

I have read all accounts in a list and then iterate in a for loop (or) i can use trigger.new in for loop.....which is the best way...

And when writing code do i need to write seperate block of code if it is an insert (or) if it is an update like i did.

 

I need some best practices in order to make it an efficient code.

ANY HELP WILL BE APPRECIATED.

 

Thank you,

swetha.

 


 

trigger uppercasetestfield on Account (before insert,before update) {
    try{
    List<Account> acc=[Select id,name from Account acc where id in:Trigger.new];
    for(Account a:acc)
    {
    if(Trigger.isInsert)
    {
        if(a.test_field__c!=null)
        {
            a.test_field__c=a.test_field__c.toUpperCase();
        }
    
    }
    
    else if(Trigger.isUpdate)
    {
    if(a.test_field__c!=null)
        {
            a.test_field__c=a.test_field__c.toUpperCase();
        }
    }
    }
    update acc;
    }
    catch(Exception e)
    {
    System.debug(e);
    }
}

 

Hi all,

 I have a problem while opening Force.com IDE, i am getting a bunch of errors similiar tho this:

 

 Before i was able to run it and made the deployment also....but suddenly just a few days before it was not working and getting me that error.


 

JVM terminated. Exit code=-1

-Dfile.encoding=UTF-8

-Xms256m

-Xmx1024m

-XX:PermSize=128M

-XX:MaxPermSize=512M

-Djava.class.path=C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

-os win32

-ws win32

-arch x86

-showsplash

-launcher C:\Programme\salesforce.com\Force.com IDE\forceide.exe

-name Forceide

--launcher.library C:\Programme\salesforce.com\Force.com

IDE\../Common/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll

-startup C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

-install C:\Programme\salesforce.com\Force.com IDE

-configuration C:\Programme\salesforce.com\Force.com IDE\configuration

-clean

-vm C:/Programme/Java/jre6/bin\client\jvm.dll

-vmargs

-Dfile.encoding=UTF-8

-Xms256m

-Xmx1024m

-XX:PermSize=128M

-XX:MaxPermSize=512M

-Djava.class.path=C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

 

Can anyone fix this problem.

 

Thank you,

swetha

Hi all,

 I have a problem while opening Force.com IDE, i am getting a bunch of errors similiar tho this:

 

 

 

JVM terminated. Exit code=-1

-Dfile.encoding=UTF-8

-Xms256m

-Xmx1024m

-XX:PermSize=128M

-XX:MaxPermSize=512M

-Djava.class.path=C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

-os win32

-ws win32

-arch x86

-showsplash

-launcher C:\Programme\salesforce.com\Force.com IDE\forceide.exe

-name Forceide

--launcher.library C:\Programme\salesforce.com\Force.com

IDE\../Common/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll

-startup C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

-install C:\Programme\salesforce.com\Force.com IDE

-configuration C:\Programme\salesforce.com\Force.com IDE\configuration

-clean

-vm C:/Programme/Java/jre6/bin\client\jvm.dll

-vmargs

-Dfile.encoding=UTF-8

-Xms256m

-Xmx1024m

-XX:PermSize=128M

-XX:MaxPermSize=512M

-Djava.class.path=C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

 

Can anyone fix this problem for me.

 

Thank you,

swetha

Hi all,

 I got a small doubt while studying.

 After deployment from sandbox to production org, is it possible that all tabs and fields are hidden even for system adminstrator.

 If so why?

 

Thank you,

Swetha

Hi all,

 Many of you are working on salesforce.

 I would like to see some realtime examples of which you have worked with some bunch of apex code and visual force code.

Thank you.

Hi all,

 I need a help.

 I am getting an exception  "java.lang.IllegalArgumentException: Illegal view ID mybutton. The ID must begin with / "

 

VF Page:

<apex:page controller="urlclass" tabStyle="Account">
<apex:form>
enter value of var1:<apex:inputText value="{!var1}"/>
enter value of var2:<apex:inputText value="{!var2}"/>
<apex:commandButton action="mybutton" value="my button"/>
</apex:form>
</apex:page>

 

 

Apex class:

 

public class urlclass {
public String var2 { get; set; }
public String var1 { get; set; }

public PageReference mybutton()
{
PageReference pr=new PageReference('/apex/pagerefurlexamp');
//PageReference pr=Apexpages.currentpage();
//pr.setRedirect(true);
return pr;
}
}

 Here i am trying to return to a page which i mentioned as partialURL.

 But i am getting that exception.

 

or else

 

How to return to a page using Page.existingPageName which is the other method.

I would like to know in both ways.

 

 

When I tried to return an integer value from apex page to a visualforce page,It is not allowing integer values in my action button method.It was taking only string and pagereference values.Why is it so???

When i am using string.valueof(integer) and converting into string only it was able to go through the apex to VF.

Can anyone explain about the locking syntax in a trigger with an example that prevents record update conflicts???

 

Thank you,

swetha.

 

Can anyone help me out to know how many variety of triggers can we write on objects.

Am new to salesforce. Any help is appreciated.

Thank you.

I want to delete one of my record type on Account. I dont want to use it anymore.

Does anyone know how to multi edit  i.e disable recordtypes for all profiles at a time and I dont want to go to each profile and deselect it.

Hi All,

 I know this is one of the dirty way of writing the code....but i am a navie...pardon me for that.

 

 I have a field on an object which needs to be converted to uppercase.

     1. It should get converted when insert happens.

     2. It should get converted when update happens.

I know simple way of writing the code in 3 lines. But how to write the correct code in this way.

When we use dml operation like i have used update acc.

I have read all accounts in a list and then iterate in a for loop (or) i can use trigger.new in for loop.....which is the best way...

And when writing code do i need to write seperate block of code if it is an insert (or) if it is an update like i did.

 

I need some best practices in order to make it an efficient code.

ANY HELP WILL BE APPRECIATED.

 

Thank you,

swetha.

 


 

trigger uppercasetestfield on Account (before insert,before update) {
    try{
    List<Account> acc=[Select id,name from Account acc where id in:Trigger.new];
    for(Account a:acc)
    {
    if(Trigger.isInsert)
    {
        if(a.test_field__c!=null)
        {
            a.test_field__c=a.test_field__c.toUpperCase();
        }
    
    }
    
    else if(Trigger.isUpdate)
    {
    if(a.test_field__c!=null)
        {
            a.test_field__c=a.test_field__c.toUpperCase();
        }
    }
    }
    update acc;
    }
    catch(Exception e)
    {
    System.debug(e);
    }
}

 

I have field name 'Normality' .It is text datatype

 

the field should always of the form    capslock  capslock  digit digit digit  and length should be five

 

Example

 

XY123

 

shouldnt accept the following

 

xy123

X12Y3

XYZ12

X4567

 

 

I tried this way

 

Normality__c<>LEFT(UPPER(Normality__c),2) &&   LEN(Normality__c) <>5 &&  ISNUMBER( RIGHT(Normality__c, 3) )

 

Somehow its not wrking.ny ideas or modifications please

 

 

Hi all,

 I have a problem while opening Force.com IDE, i am getting a bunch of errors similiar tho this:

 

 Before i was able to run it and made the deployment also....but suddenly just a few days before it was not working and getting me that error.


 

JVM terminated. Exit code=-1

-Dfile.encoding=UTF-8

-Xms256m

-Xmx1024m

-XX:PermSize=128M

-XX:MaxPermSize=512M

-Djava.class.path=C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

-os win32

-ws win32

-arch x86

-showsplash

-launcher C:\Programme\salesforce.com\Force.com IDE\forceide.exe

-name Forceide

--launcher.library C:\Programme\salesforce.com\Force.com

IDE\../Common/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll

-startup C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

-install C:\Programme\salesforce.com\Force.com IDE

-configuration C:\Programme\salesforce.com\Force.com IDE\configuration

-clean

-vm C:/Programme/Java/jre6/bin\client\jvm.dll

-vmargs

-Dfile.encoding=UTF-8

-Xms256m

-Xmx1024m

-XX:PermSize=128M

-XX:MaxPermSize=512M

-Djava.class.path=C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

 

Can anyone fix this problem.

 

Thank you,

swetha

Hi all,

 I have a problem while opening Force.com IDE, i am getting a bunch of errors similiar tho this:

 

 

 

JVM terminated. Exit code=-1

-Dfile.encoding=UTF-8

-Xms256m

-Xmx1024m

-XX:PermSize=128M

-XX:MaxPermSize=512M

-Djava.class.path=C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

-os win32

-ws win32

-arch x86

-showsplash

-launcher C:\Programme\salesforce.com\Force.com IDE\forceide.exe

-name Forceide

--launcher.library C:\Programme\salesforce.com\Force.com

IDE\../Common/plugins/org.eclipse.equinox.launcher.win32.win32.x86_1.0.200.v20090519\eclipse_1206.dll

-startup C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

-install C:\Programme\salesforce.com\Force.com IDE

-configuration C:\Programme\salesforce.com\Force.com IDE\configuration

-clean

-vm C:/Programme/Java/jre6/bin\client\jvm.dll

-vmargs

-Dfile.encoding=UTF-8

-Xms256m

-Xmx1024m

-XX:PermSize=128M

-XX:MaxPermSize=512M

-Djava.class.path=C:\Programme\salesforce.com\Force.com IDE\../Common/plugins/org.eclipse.equinox.launcher_1.0.201.R35x_v20090715.jar

 

Can anyone fix this problem for me.

 

Thank you,

swetha

Hi,

 

I read  SOSL  documentation & examples, although I can't seem to read the results I get from "Find" query.

 

When I run the following code, I can see in the debug that it found 21 results.

 

List<List<SObject>> searchList = [Find 'Ja*' RETURNING candidate__c];

 

 

When I try to read them I get an empty "Candidate__c" list:

 

if(searchList != null){
     Candidate__c []cands = (List<Candidate__c>)searchList[0];

     for(Candidate__c c : cands){
System.debug('Found Id '+c.Id);

     }

}

 

If I try to use SOQL - select, I can see the results. 

 

Should I set special flags in-order to use SOSL?

 

Appreciate any help!

Uri

 

 

 

 

 

 

  • January 06, 2012
  • Like
  • 0

Hi all,

 I got a small doubt while studying.

 After deployment from sandbox to production org, is it possible that all tabs and fields are hidden even for system adminstrator.

 If so why?

 

Thank you,

Swetha

Hi all,

 I need a help.

 I am getting an exception  "java.lang.IllegalArgumentException: Illegal view ID mybutton. The ID must begin with / "

 

VF Page:

<apex:page controller="urlclass" tabStyle="Account">
<apex:form>
enter value of var1:<apex:inputText value="{!var1}"/>
enter value of var2:<apex:inputText value="{!var2}"/>
<apex:commandButton action="mybutton" value="my button"/>
</apex:form>
</apex:page>

 

 

Apex class:

 

public class urlclass {
public String var2 { get; set; }
public String var1 { get; set; }

public PageReference mybutton()
{
PageReference pr=new PageReference('/apex/pagerefurlexamp');
//PageReference pr=Apexpages.currentpage();
//pr.setRedirect(true);
return pr;
}
}

 Here i am trying to return to a page which i mentioned as partialURL.

 But i am getting that exception.

 

or else

 

How to return to a page using Page.existingPageName which is the other method.

I would like to know in both ways.

 

 

When I tried to return an integer value from apex page to a visualforce page,It is not allowing integer values in my action button method.It was taking only string and pagereference values.Why is it so???

When i am using string.valueof(integer) and converting into string only it was able to go through the apex to VF.

Can anyone help me out to know how many variety of triggers can we write on objects.

Am new to salesforce. Any help is appreciated.

Thank you.

Hi All,

 

I have created a Record Type for Opportunities. I have decided against using a Record Type so I now want to delete it.

I clicked Del and it lists the profiles that are using the RT. I have edited each profile, resetting the Record Type back to Master.

 

This works except for Standard Platform User. This profile does not have an option to set the RT for the Opportunities object. Opportunities is not listed at all for this profile.

 

I am now stuck with an unwanted RT. I can't delete it as SF says the profile is using it as the default.

 

Any ideas?

 

Thanks.

 

 

- Andy