• apex_keen
  • NEWBIE
  • 180 Points
  • Member since 2011

  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 40
    Questions
  • 68
    Replies
Hi  Everyone, I have a trigger that updates the child records if there is a change on the parent record. my problem is if I change certain fields on the child records, it changes the value of the rollup summaty fields on the parent and fires the trigger. So I added the conditon like this to prevent that: 

if ((c.TCR_Total_Charts__c != oldProj.TCR_Total_Charts__c) || (c.TCR_Total_Delivered__c != oldProj.TCR_Total_Delivered__c) ||
        (c.TCR_Total_Scheduled__c != oldProj.TCR_Total_Scheduled__c)) {
            isExecute = TRUE;
        }
    }
    
    if(isExecute = false){


but now even if I change other  fields on the parent , it does not fire the trigger. Please help me if you know a solution for this. below is the whole trigger. thanks








trigger ProjectSettings_ChartsTrigger on Project_Setting__c (After Insert,After Update){
    List<id> ProjectIds = new list<id>();
    List<Project_Setting__c > prj = [select Id, Total_Charts__c from Project_Setting__c where Id In : ProjectIds];
    boolean isfalse = false;
    String userName = UserInfo.getUserName();
    string Profile = UserInfo.getprofileId();
    
    Boolean isExecute = false;
    
    for (Project_Setting__c c : Trigger.new) {
        Project_Setting__c oldProj = Trigger.oldMap.get(c.ID);
        if ((c.TCR_Total_Charts__c != oldProj.TCR_Total_Charts__c) || (c.TCR_Total_Delivered__c != oldProj.TCR_Total_Delivered__c) ||
        (c.TCR_Total_Scheduled__c != oldProj.TCR_Total_Scheduled__c)) {
            isExecute = TRUE;
        }
    }
    
    if(isExecute = false){
        if(userName != 'arash' && profile != 'xxxxx' && profile != 'xxxxx' && profile != 'xxxx'){ 
            for(Project_Setting__c PS : Trigger.new){
                if (PS.Total_Charts__c < 2000) {
                    ProjectIds.add(PS.id);
                    isfalse = true;  
                }
                else{
                    ProjectSettings_ChartsBatchClass pro = new ProjectSettings_ChartsBatchClass(); 
                    database.executebatch(pro,2000);
                }
            } 
            if ( isfalse ){
                projectSettingsChartClass.ProjectMethods(ProjectIds);
            }
        }
    }
}

I have created a VF page  where i have put lead fields in custom picklist(picklist name is FIELD NAME).Now i want "when i choose any field name i want to get the values of lead. For eg when i choose "status" fieldname  a picklist should show as it is there on Lead object , when i choose "industry" fieldname a picklist show showing all the industries.Please help...i am new  to apex.please explain with code.help will br appreciated....

  • February 05, 2012
  • Like
  • 0

I need help with how to create a formula to roll-up the total amounts from a group of opportunities and sum the amount into the Contract object. Currently, I have the contract referenced in the opportunity and a related list in the Contract layout. I thought this would be easy by just creating a custom field under Contract and used the Roll-up summary field type. But this does not allow me to do that because its not considered the master in the master-detail relationship.

I think my only option is Apex Code. Can anyone help me with that?

 

Any help asap would be greatly appreciated.

In Force.com Workbook, tutorial #5, I created the basic user Bob Smith. From Bob Smith
account, I could not access the Merchandise custom objects that are created by the
Administrator. How can we edit the settings to proceed with this?

  • December 20, 2011
  • Like
  • 0

Hi - 

 

I am writing a basic apex trigger to update a quote revision number.  I need to select the max version number within a quote, within an opportunity.

 

I get an unexpected token on the red line below.  The revision? field is a custom checkbox field in the quote table.

 

Thanks for your help!!!

 

 

 

trigger quoteversioning on Quote (before insert) {
for (quote insertedquote : system.Trigger.new)   

  {   

 

   if (insertedquote.revision?)

      {      quote QT = [select max(version__c) from quote

                        where quotenumber = :insertedquote.quotenumber                       

                        and opportunity = :insertedquote.opportunity];

 

               insertedquote.version__C = QT.version__c + 1;     

     }   

  }

}


  • October 06, 2011
  • Like
  • 0

OK so I was trying to split a string with a space in the middle of the string. I use: String [] NewString = tempname.split('\\ '); am I doing something wrong or does this just not work for spaces.

Hi,

does any body know, when we sync event from salesforce to oulook, and if event has attachment, Does it also get synced?

I mean, event created in outlook also get that attachment or not ?

 

 I tried but it was not working but thinking, if I'm doing anything wrong as new to this functionality. Also if possible let me now, if there is any alternative available

 

thanks !

Hello

I need to send email to child object(B) record(s) owner(s) once a field(A) in parent is updated. How can this be done? I know using cross object formula, I can access parent object field in child. But here I want is, something opposite. Do I neccesarily have to write trigger for this ? 

I passed dev 401 around 30 jan 2012. Hello, I forgot to give summer 12 release exam amd its date seems to have been passed. What are my options now ? Do I've to give Dev 401 again ?

Hello!

In my requirement -there is a picklist  field with multiple values. One of the values is 'Others'. My requirement is when 'Others' Is selected, it should show a text box(another field). 

What is the easiest way to do this ? I guess, I've to write a new visual force page. and somehow have to get IDs of the fields. But what is not clear to me, how can I get picklist field values in visual force page. 

How can I use them for show/hide fields?

Hello ! My requirement is something like this: Say I'm displaying 20 account records( based on some criteria) with check boxes in vf page(using wrapper class for this). Now whatever records users are selecting from those 20; I was to display them on nice pop up window. Now in my custom controller, I can have the logic to put the selected records in the 'List'. Next Step is to display the list data in popUP(javascript window?). how can I do that in best possible manner?

I've very basic problem. I'm trying to use jquery library inside my vf page. Downloaded latest library(zipped) and uploaded it as static resource in Salesforce .

Using this syntax to refer the JS files of  jquery : 

<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-1.8.3.min.js')}" />

<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-ui-1.9.2.custom.min.js')}"

<apex:stylesheet value="{!URLFOR($Resource.jQuery, '/css/ui-lightness/jquery-ui-1.9.2.custom.css')}" />

 

But as soon as  i try to save the page, I found using 'chrome development console' that these files are not found( 404 error).

Already verfied- In zipped folder, all these files are correctly present  in their respective folders( JS or CSS )and static resource is correctly named as jquery in Salesforce. 

Any idea, where could be the issue. 

I've a requirement in which I've to show campaign members on click of button(or link) on campaign page. Showing just name will be suffice but better to show it with details(title, account etc ...)  

What is the easiest way to do so? Do I've to write VF for this ? (know campaign members are visible as related list.)

In my controller, I've property which is referenced by visual force page. Later on I've to change the name of property . I change the name everywhere( controller as well as in vf page) but still on saving the page , I'm getting following error : 

 

"The property String <name of property>is referenced by Visualforce Pagein salesforce.com. Remove the usage and try again" 

 

What should I do ?

i've not concentrated on test methods much till now. Written the following for my controller. Though getting 100% coverage but not sure, if this is the best way to write. Would appreciate if some one provide tips on that. 

 

Controller class( Basically govern logic to show, list of sample cases along with check box to change their status) 

public with sharing class caseData {

public list<wrapperCaseData> selectedCases = new list<wrapperCaseData>();
    public caseData(ApexPages.StandardSetController controller) 
    {
        case[] clist = [select caseNumber, status, subject from case limit 10];
     For(case c1: clist) 
      selectedCases.add(new wrapperCaseData(c1)) ;
    }
   
 public  list<wrapperCaseData> getcaseList()
 { return selectedCases ; }
 
 public list<case> fewcases = new list<case>(); 
  public pagereference Proccessed() 
  { 
           for(wrapperCaseData w1 : selectedCases)
            { If (w1.valueSelected==true) 
                 { fewcases.add(w1.ct);
                 }
            }
            update fewcases;
        return null;    
 }
  public class wrapperCaseData
   {
      public case ct {get;set;}
      public boolean valueSelected{get;set;} 
      
     public wrapperCaseData(Case cs) 
     {  this.ct = cs;
      this.valueSelected= false; 
     }
   }
}

 Test class : 

 

public class testWrapperClass_caseData
 { public static testMethod void methodTest_case_data()
     {      list<case> c1List = new list<case>();
            case c1 = new case(origin ='web', status = 'open'); 
            case c2 = new case(origin ='email', status = 'open'); 
             c1List.add(c1);
             c1List.add(c2);
             insert c1List;
          ApexPages.StandardSetController Sc1 = new ApexPages.StandardSetController(c1List);
          caseData cd = new caseData(sc1);
          caseData.wrapperCaseData wd= new caseData.wrapperCaseData(c1); 
           
          list<caseData.wrapperCaseData> wcd = cd.getcaseList();
          pageReference p = cd.proccessed();
      } 
 }

  Specifically, how to write system.assert statement in  test class in such situation ?

 

Can anybody tell

 

If I've force.com(platform) license, would I get system administrator profile or not ? in other words, I came to know that it is not possbile to make someone system administrator with force.com license. is that true? If yes, then who can perform sys admin type functions for organization having only force.com licenses?

Hi All, 

 

I'm system admin of my organization but getting following error when adding dependencies in change sets : 

 

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. 

 

I've done deployment in recent past but then, just follow simple steps &  I didn't get any issue. Please note, I'm trying to deploy few reports as dependencies along with with few visual force pages ( need for dashboard)

 

I've a requirement to redirect to visual force page when home page loads.

For this, I've made a new home page component of HTML area type and put my one line of Javascript code in it .( window.location.replace(link of redirection).......)

Although redirection is working fine but all pages of salesforce stop loading properly. Issue in all is-page is not showing scroll bar at right due to which you links & text written at bottom part of page are not visible. If I drag mouse at bottom, those comes up.

Wondering, if any body else has faced this issue. Guessing it is something related to ruining of HTML structure of page but not sure of

I've a requirement that as soon as home page load, it should automatically display  public calendar, without needing to click anywhere. 

 

For this, I'm trying to use Iframes. But problem is , I'm not able to find any link which just display 'just' calendar. Currently, what I do is.. I change the calendar type at home page to public calendar and grab the link from browser address bar. But  this link displays many things with public calendar( banner, all tabs, side bar etc). 

 

As a result, when Iframe loads, it also displays all those stuffs which I dont want;  Any idea, what I can do 

My link is this: 

 

https://ap1.salesforce.com/00U/c?cType=1&cal=MyPublicCalendar&cal_lkid=02390000000CPdb&cal_lkold=MyPublicCalendar&cal_lspf=1&md0=2012&md1=3

Hello!

 

My client is using some legacy  tool(available online, licensed)for  various purposess that includes maintating accounts & contacts information. Now they want, that information should also go to salesforce.com.

For this, it was suggested to data loader CLI to automate import of data as we dont to use web services etc for this

On talking to owner of that tool, he suggested that he will build an ODBC connection on some machine, using which we can get data.

Now I've few questions:

1) How can I utilize that ODBC connection information in Data loader to automate process? I know, I have to put info in database.conf file of dataloader . Could I get all info needed by database-conf file from that ODBC connection?

2) ODBC connection will be built in m/c  located remotedly. would that cause any sort of trouble ?

 

Thanks !

Hello, I'm trying to use 'Email to Salesforce' functionality but coming across one issue. Regardless, who has sent the mail, it is always assigning activity to 'system administrator', which we don't want.

 

What I want is,if the sender(from address) is valid user in Salesforce, then the activity should be 'assigned to' that user.

when valid user is not found as sender, only then, it is assigned to 'system administrator'

 

Please let me know, if this is possible or not.

 

Thanks !!

Hi!

We've 10 salesforce license- which was purchased some months back.

I recently joined the team,

 

1) How can I find which kind of license(professional, enterprise, unlimited etc).  I think, I could find looking the features available but justed wanted to check, if some easy way available. For now, it seems to me, it is enterprise edition

 

2) We've consumed all 10 licenses and  now we want to give just 'read' access of 'accounts & 'contacts' to atleast 10 more people. Do we need to purchase license for this or any easy way available.

 

I checked chatter free license type, for which I can add 5000 users.. but finding they can't access any such standard object.

 

Please suggest!!

 

Hi,

would like to know, if there any way exist, without writing vf page, to hide fields in view mode?

Actually, I want userto enter values in fields say having names A, B & C. But after submit, I want
A, B & C should not appear. Instead I want to show concatenated result of A+B+C, in another field say D.

would that be possible to hide A,B &C after submit, without writing VF pages?

Can anybody tell me difference between buying Service Cloud license vs buying Remedyforce license app from appexchange?Which has more features?Why service cloud is still offered when salesforce has tield with BMC for this app?

 

I've a trigger which runs 'before update' on opportunity. Now  trying to writing test class for that trigger. In testmethod, there are statements: 

 

 Opportunity getOpp = [select name, amount, contract__c from opportunity where id = '00690000005t1d1'];

getOpp.amount =  5000.00;

update getOpp;

 

but while running, getting following error on query line : 

System.QueryException: List has no rows for assignment to SObject.

 

I tried fixing left side to 'Opportunity[] getOpp' , but then , as I was expecting... error transmit to iind line ( in that case IInd line is getOpp[0].amount, gives error like .. 'out of bound' etc  ). This suggest query is not returning any thing ..

 

But point here is,  opportunity with mentioned ID does exist in system; while running the same query in system log console, it works fine!.. question is, why it is failing inside test method ? Do testmethods always need testdata, created inside test class ? 

 

IInd thing : to fix above ...  I also tried to create opportunity within test class


date mydate = date.parse('02/27/2012');
   Opportunity oppContract= new opportunity( name = 'just for testclass', closedate = mydate , stageName ='Qualification',
    contract__c = '80090000000Dp6R' );
    insert oppContract ;


( note :here contract__c is look up field to contract object)  

 

I then get "same" opportunity using soql query  and  try to update it

 But now  trigger which run on update start giving error .It   has statements like these :


  Map<id,contract> MapofCons = new Map<id,contract>([select id, name,sum_total__c from contract where id in :<setofIds>]);

for (opportunity o : trigger.new )

 If( MapofCons.get(o.contract__c).sum_total__c ==null) 



here I  get error  on " IF statement' , like this  :  System.NullPointerException: Attempt to de-reference a null object (on above line). which  shows , it is not able to reference  contract  object....


I'm little confused, how to proceed now ...please help ! 

 

Note : using developer edition for all this ....


 


I was trying to get idea about streaming APIs. Trying the example given on following salesforce wiki page. 

 

http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_Streaming_API

 

but its not working . On  using JS console on chrome- getting following error : 

 

"Appending message type to URI /cometd/23.0/ is not supported, disabling 'appendMessageTypeToURL' configuration"

 

Please let me know , if anyone has any idea about it. I've tried to take care all things mentioned in following post. 

 

http://boards.developerforce.com/t5/Streaming-API-Developer-Preview/Error-trying-to-do-the-Visualforce-sample-of-Streaming-Api/td-p/349157

 

thanks !!

 

Hi  Everyone, I have a trigger that updates the child records if there is a change on the parent record. my problem is if I change certain fields on the child records, it changes the value of the rollup summaty fields on the parent and fires the trigger. So I added the conditon like this to prevent that: 

if ((c.TCR_Total_Charts__c != oldProj.TCR_Total_Charts__c) || (c.TCR_Total_Delivered__c != oldProj.TCR_Total_Delivered__c) ||
        (c.TCR_Total_Scheduled__c != oldProj.TCR_Total_Scheduled__c)) {
            isExecute = TRUE;
        }
    }
    
    if(isExecute = false){


but now even if I change other  fields on the parent , it does not fire the trigger. Please help me if you know a solution for this. below is the whole trigger. thanks








trigger ProjectSettings_ChartsTrigger on Project_Setting__c (After Insert,After Update){
    List<id> ProjectIds = new list<id>();
    List<Project_Setting__c > prj = [select Id, Total_Charts__c from Project_Setting__c where Id In : ProjectIds];
    boolean isfalse = false;
    String userName = UserInfo.getUserName();
    string Profile = UserInfo.getprofileId();
    
    Boolean isExecute = false;
    
    for (Project_Setting__c c : Trigger.new) {
        Project_Setting__c oldProj = Trigger.oldMap.get(c.ID);
        if ((c.TCR_Total_Charts__c != oldProj.TCR_Total_Charts__c) || (c.TCR_Total_Delivered__c != oldProj.TCR_Total_Delivered__c) ||
        (c.TCR_Total_Scheduled__c != oldProj.TCR_Total_Scheduled__c)) {
            isExecute = TRUE;
        }
    }
    
    if(isExecute = false){
        if(userName != 'arash' && profile != 'xxxxx' && profile != 'xxxxx' && profile != 'xxxx'){ 
            for(Project_Setting__c PS : Trigger.new){
                if (PS.Total_Charts__c < 2000) {
                    ProjectIds.add(PS.id);
                    isfalse = true;  
                }
                else{
                    ProjectSettings_ChartsBatchClass pro = new ProjectSettings_ChartsBatchClass(); 
                    database.executebatch(pro,2000);
                }
            } 
            if ( isfalse ){
                projectSettingsChartClass.ProjectMethods(ProjectIds);
            }
        }
    }
}
Hi, I am trying to put inputField in cells of pageBLockTable, I am using apex:repeat for dynamic columns and there I am putting the inputField which referes to a element of 2D array in the following way
<apex:pageBlockTable value="rows" var="rowIndex">
<apex:repeat value="{!columnIndexes}" var="columnIndex"> 
            <apex:column style="width:70px">
                  <apex:inputField value="{! game[rowIndex][columnIndex].value__c}"  style="width:70px"/>
           </apex:column>
<apex:repeat>
</apex:pageBlockTable>

But on server side I am getting only value for the last item of game 2D array. Is there anything which I am missing. Or value does not bind wihth multidimensional array.

Any any pointers would be very very helpful.
So I was wondering how I can attach a file to an opportunity. Basically what we do is sell a product online that requires an agreement. When they buy the product, we generate a pdf of the agreement and mail it to them. What I would like to do is upload the pdf agreement and attach it to the corresponding opportunity . I am pretty sure this can be accomplished, but I don't see much documentation on it. I am using conga composer salesforce appexchange its send mail to users with attchments and showing in Activity History in opportunity related list with file name but its not showing in attchments . Any one have any ideas?
  • February 17, 2014
  • Like
  • 0

Hi,

 

I have an issue on running reports in customer portal i have created a report folder for all access

portal users and my customer portal users having customer manager custom profile in that

profile i have checked run reports and export reports. But i have an error like when running

report

 

Insufficient Privileges
You don't have access to run this report. Contact your administrator if you need access.

 

i have all permissions in sharing settings and field level security.

 

 

any one can help?

 

 

Thank you

I've very basic problem. I'm trying to use jquery library inside my vf page. Downloaded latest library(zipped) and uploaded it as static resource in Salesforce .

Using this syntax to refer the JS files of  jquery : 

<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-1.8.3.min.js')}" />

<apex:includeScript value="{!URLFOR($Resource.jQuery, '/js/jquery-ui-1.9.2.custom.min.js')}"

<apex:stylesheet value="{!URLFOR($Resource.jQuery, '/css/ui-lightness/jquery-ui-1.9.2.custom.css')}" />

 

But as soon as  i try to save the page, I found using 'chrome development console' that these files are not found( 404 error).

Already verfied- In zipped folder, all these files are correctly present  in their respective folders( JS or CSS )and static resource is correctly named as jquery in Salesforce. 

Any idea, where could be the issue. 

Hi,

 

 I have some problem in my trigger. when i insert the single record its working perfect. But when i import bulk records it cause the Too many SOQL queries Error.

 

 Please help me:

 

trigger BazookaCode on Account(after insert)
{
string name,fname,lname,substr,anumber,code,code1,code2,code3,code4,code5;
String city='';
String state='';
Integer acount;
Integer acount1;
Set<id> aid = new Set<id>();

for(Account obj : Trigger.new)
{
aid.add(obj.id);
}

List<Account> la = [SELECT id,Name,ShippingCity,ShippingState,AccountNumber FROM Account WHERE id in :aid];
for(Account a : la)
{
if(a.AccountNumber == null)
{
name = a.Name;
fname = a.Name.mid(0,3);
substr = name.substringAfter(' ')+name;
lname = substr.mid(0,3);
city = a.ShippingCity.mid(0,3);
state = a.ShippingState.mid(0,2);

if(name!=substr)
{
code = fname+lname+state;
code1 = code.toUpperCase();
code2 = code1.replaceAll('\\W','');
acount = [SELECT COUNT() FROM Account WHERE AccountNumber LIKE :code2+'%'];
if(acount == 0)
{
a.AccountNumber = code2;
}
else if(acount > 0 && acount < 9)
{
a.AccountNumber = code2 + 0 + acount;
}
else
{
a.AccountNumber = code2 + acount;
}
}
else
{
code3 = fname+city+state;
code4 = code3.toUpperCase();
code5 = code4.replaceAll('\\W','');
acount1 = [SELECT COUNT() FROM Account WHERE AccountNumber LIKE :code5+'%'];
if(acount1 == 0)
{
a.AccountNumber = code5;
}
else if(acount1 > 0 && acount1 < 9)
{
a.AccountNumber = code5 + 0 + acount1;
}
else
{
a.AccountNumber = code5 + acount1;
}
}
update a;
}
}
}

  • November 21, 2012
  • Like
  • 0

Hi,

 

I need to insert 100 records at atime, and this trigger doesnt work, please help me writing bulk trigger.

 

trigger emailcopy on Lead (before update, before insert) {

Lead ld = Trigger.new[0];
if(ld.Contact__c!=null&& ld.RecordTypeId == '012V00000008atT') {
Contact con = [Select id,Email,AccountId,Phone,Phone_Extension__c,MobilePhone from Contact where id =: ld.Contact__c];
Account acc = [Select id,AutomationandControlProductsRegion__c from Account where id =: con.AccountId];

ld.AutomationandControlProductsRegion__c = acc.AutomationandControlProductsRegion__c;
ld.Email = con.Email;
ld.Phone = con.Phone;
ld.PhoneExtension__c = con.Phone_Extension__c;
ld.MobilePhone =con.MobilePhone;

}

  • November 20, 2012
  • Like
  • 0

Hi Guys,

 

I am doing a time related project.

 

I was wondering if salesforce will use the daylight saving time directly or user need to mofidy it manully?

 

If salesforce does it automaticlly, How do I know it is a daylight saving time now?

 

Will the time zone changed if the daylight saving time apply? for exmple: 

 

(GMT+10:00) Australian Eastern Standard Time (Australia/Sydney)

 

become 

 

(GMT+11:00) Australian Eastern Standard Time (Australia/Sydney)?

 

 

 

Like i get the id corresponding to a checkbox in javascipt .how do i reflect it into apex varible?

Hi

 

I have come up against a requirement where my customer wants a user to be able to view all the Names of Accounts (so a global read-only) but only be able to see another Account field for those Account in their region (or  Role group). I have been banging my head against trying to set this up but can't see it is possible. Wondering if anyone had any suggestions?

 

An example would be

Account Name (global read-only)

Account Address (global read-only)

Account Value (regional read-only)

Account Number (regional read-only)

 

Thanks in advance

 

Paul

Hi

 

I need for a customer profile to edit tab setting: account and contact

 

so a customer can view his account and contact

 

I read about  Delegated Portal User Administrator but i don't find this option

 

Thanks 

Hi All, 

 

I'm system admin of my organization but getting following error when adding dependencies in change sets : 

 

Insufficient Privileges
You do not have the level of access necessary to perform the operation you requested. Please contact the owner of the record or your administrator if access is necessary. 

 

I've done deployment in recent past but then, just follow simple steps &  I didn't get any issue. Please note, I'm trying to deploy few reports as dependencies along with with few visual force pages ( need for dashboard)

 

I've a requirement that as soon as home page load, it should automatically display  public calendar, without needing to click anywhere. 

 

For this, I'm trying to use Iframes. But problem is , I'm not able to find any link which just display 'just' calendar. Currently, what I do is.. I change the calendar type at home page to public calendar and grab the link from browser address bar. But  this link displays many things with public calendar( banner, all tabs, side bar etc). 

 

As a result, when Iframe loads, it also displays all those stuffs which I dont want;  Any idea, what I can do 

My link is this: 

 

https://ap1.salesforce.com/00U/c?cType=1&cal=MyPublicCalendar&cal_lkid=02390000000CPdb&cal_lkold=MyPublicCalendar&cal_lspf=1&md0=2012&md1=3

Hello!

 

My client is using some legacy  tool(available online, licensed)for  various purposess that includes maintating accounts & contacts information. Now they want, that information should also go to salesforce.com.

For this, it was suggested to data loader CLI to automate import of data as we dont to use web services etc for this

On talking to owner of that tool, he suggested that he will build an ODBC connection on some machine, using which we can get data.

Now I've few questions:

1) How can I utilize that ODBC connection information in Data loader to automate process? I know, I have to put info in database.conf file of dataloader . Could I get all info needed by database-conf file from that ODBC connection?

2) ODBC connection will be built in m/c  located remotedly. would that cause any sort of trouble ?

 

Thanks !

I've a trigger which runs 'before update' on opportunity. Now  trying to writing test class for that trigger. In testmethod, there are statements: 

 

 Opportunity getOpp = [select name, amount, contract__c from opportunity where id = '00690000005t1d1'];

getOpp.amount =  5000.00;

update getOpp;

 

but while running, getting following error on query line : 

System.QueryException: List has no rows for assignment to SObject.

 

I tried fixing left side to 'Opportunity[] getOpp' , but then , as I was expecting... error transmit to iind line ( in that case IInd line is getOpp[0].amount, gives error like .. 'out of bound' etc  ). This suggest query is not returning any thing ..

 

But point here is,  opportunity with mentioned ID does exist in system; while running the same query in system log console, it works fine!.. question is, why it is failing inside test method ? Do testmethods always need testdata, created inside test class ? 

 

IInd thing : to fix above ...  I also tried to create opportunity within test class


date mydate = date.parse('02/27/2012');
   Opportunity oppContract= new opportunity( name = 'just for testclass', closedate = mydate , stageName ='Qualification',
    contract__c = '80090000000Dp6R' );
    insert oppContract ;


( note :here contract__c is look up field to contract object)  

 

I then get "same" opportunity using soql query  and  try to update it

 But now  trigger which run on update start giving error .It   has statements like these :


  Map<id,contract> MapofCons = new Map<id,contract>([select id, name,sum_total__c from contract where id in :<setofIds>]);

for (opportunity o : trigger.new )

 If( MapofCons.get(o.contract__c).sum_total__c ==null) 



here I  get error  on " IF statement' , like this  :  System.NullPointerException: Attempt to de-reference a null object (on above line). which  shows , it is not able to reference  contract  object....


I'm little confused, how to proceed now ...please help ! 

 

Note : using developer edition for all this ....


 


I was trying to get idea about streaming APIs. Trying the example given on following salesforce wiki page. 

 

http://wiki.developerforce.com/page/Getting_Started_with_the_Force.com_Streaming_API

 

but its not working . On  using JS console on chrome- getting following error : 

 

"Appending message type to URI /cometd/23.0/ is not supported, disabling 'appendMessageTypeToURL' configuration"

 

Please let me know , if anyone has any idea about it. I've tried to take care all things mentioned in following post. 

 

http://boards.developerforce.com/t5/Streaming-API-Developer-Preview/Error-trying-to-do-the-Visualforce-sample-of-Streaming-Api/td-p/349157

 

thanks !!

 

I have created a VF page  where i have put lead fields in custom picklist(picklist name is FIELD NAME).Now i want "when i choose any field name i want to get the values of lead. For eg when i choose "status" fieldname  a picklist should show as it is there on Lead object , when i choose "industry" fieldname a picklist show showing all the industries.Please help...i am new  to apex.please explain with code.help will br appreciated....

  • February 05, 2012
  • Like
  • 0