• rksfdc
  • NEWBIE
  • 25 Points
  • Member since 2009

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

Hi,

I have an s-control with 3 required fields, in IE when I try to create a new records, keep the new record window open, and navigate to a different page or create a new tab and minimize and maximize the page, all the required fields are getting vanished. I have copied the code below, if I comment out the requiredinput line then it works fine. Any ideas guys? any help here is really appreciated.

 

Thanks,

RK

 

<td class="labelCol">
<label for="quoteName"><span class="requiredMark">*</span>Quote Name</label>
</td>
<td class="dataCol">
<div class="requiredInput">
<div class="requiredBlock"> </div>
<input type="text" tabindex="1" size="20" name="quoteName" id="quoteName"/>
</div>
</td>

 


 

  • April 07, 2009
  • Like
  • 0

Hi All,

Does 0 (zero) Hours After a certain Date field work in Time-Dependent Workflow work? Has anyone tried this before?

 

Thanks,

RK

  • February 03, 2009
  • Like
  • 0

Hi,

Is there a say to convert long number like this (9.0E7), to their original value i.e. 90000000 in APEX?

 

Thanks,

Rami

  • February 02, 2009
  • Like
  • 0
I think this issue is being caused by the code throwing too many debug script than log could handle, has anyone faced this issue before? Is there an easier way or code re-factoring is the only solution?

Code:
System.Exception: Too many script statements: 50001 Class.xx.xx: line 181, column 13 Trigger.: line 52, column 43
Force.com Sandbox

Apex script unhandled trigger exception by user/organization: xx/xx

xx: execution of BeforeUpdate

caused by: System.Exception: Too many script statements: 50001

Class.xx.xx: line 181, column 13
Trigger.xx: line 52, column 43

 

  • January 12, 2009
  • Like
  • 0
Hi,
I have created a testmethod that simply creates a new opportunity, my issue is if I run the testmethod through Eclipse I am getting System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException. But if I run the same testmethod through SFDC UI I don't get this error message, has anyone faced this issue before? Any help is really appreciated, I have inserted the source code for your reference.

Code:
@isTest
private class InitOppLineItemTest {

     static testMethod void myUnitTest() {
  Account existingAccount = [select Id, name from Account limit 1];
  RecordType existingRecordType = [Select r.SobjectType, r.NamespacePrefix, r.Name, r.IsActive, r.Id, r.DeveloperName, r.Description From RecordType r where SobjectType = 'Opportunity' limit 1];
  User user = [Select u.Id From User u where u.IsActive = true limit 1];
  
        Opportunity opp = new Opportunity();
     opp.recordTypeId = existingRecordType.id;
     opp.name=existingAccount.name + ': ' + 'TestOpp';
     opp.end_date__c = Date.today().addDays(31); 
     opp.CONSOLE_2_Schedule_Start_Date__c = Date.today();
     opp.closeDate = Date.today().addDays(31);
     opp.Amount_Digital__c = 300000;
     opp.Business_Unit__c = 'ALL01';
     opp.stageName = 'Engaged';
     opp.AccountId = existingAccount.id; 
     opp.OwnerId = user.id; 
     opp.CurrencyISOCode = 'USD';
                
        insert opp;
        // System.assert(false);
    }
}

 
Thanks again,
RK
  • January 09, 2009
  • Like
  • 0

in one record 50 field is there ,in that first time i given values for 20 fields but second time i want to be remaining 30 fields with out distub first 20 field values . what i have to do ?

    

       thank u.

Good morning everyone!  Since one cannot create a lookup field to the standard OpportunityLineItem object, you cannot create a parent child relationship between OLIs as you cannot create a lookup to itself.  I am mimicking this relationship by using wrapper classes and setting a text(18) custom field called Parent_OLI_Id__c on the OLI.  Naturally, I have to save the parents first to get back their IDs, then save the children using the returned IDs.  The following method accomplishes this beautifully...

 

 

public static void upsertOLIsFromOLIMs(OpportunityLineItemModel[] olims)

{

OpportunityLineItem[] oliParentsToUpsert = new OpportunityLineItem[0];

//Loop thru incoming OLIMs and extract parents only to upsert array

for(OpportunityLineItemModel olim : olims)

{

if(olim.isParent)

oliParentsToUpsert.add(olim.record);

}

try

{

//Upsert parents

upsert oliParentsToUpsert;

//Loop thru incoming OLIMs again and set parent Id of child records

//which has now been returned from previous upsert call

//Extract children to upsert array

OpportunityLineItem[] oliChildrenToUpsert = new OpportunityLineItem[0];

for(OpportunityLineItemModel olim : olims)

{

if(olim.isParent)

{

for(OpportunityLineItemModel childOLIM : olim.childRecords)

{

childOLIM.record.Parent_OLI_Id__c = olim.record.Id;

oliChildrenToUpsert.add(childOLIM.record);

}

}

}

//Upsert children

upsert oliChildrenToUpsert;

}

catch(DmlException dmle)

{

...

}

}


 

 

This method is called from a Save button on a VisualForce page.  Enough background, now let's get to the problem.  I have a trigger that runs after insert and after update of OLIs but is only firing on the first upsert statement of the method above, when upserting the parents.  To prevent infinite recursion I am using the usual trick of setting a static Boolean to true the first time the trigger is run.  While grasping at straws, I thought this might be causing the problem so I removed the static Boolean condition and let the trigger run ad infinitum.  Every single System.debug statement outputted still showed that only parent OLIs were ever being passed to the trigger.  Has anyone seen anything like this?  I hope it's just because it's late and I'm doing something wrong...

 

Message Edited by Dogen Zenji on 03-12-2010 02:51 AM
Message Edited by Dogen Zenji on 03-12-2010 02:54 AM
Message Edited by Dogen Zenji on 03-12-2010 03:00 AM

I am trying to use an custom component on the Home Page to display a List View of a custom object.  I receive the following error message when selecting a "My Open Projects" list view.

 

start_date__c FROM ADP_Project__c WHERE ((OwnerId = '00580000001nmAF') AND ^ ERROR at Row:1:Column:147 No such column 'OwnerId' on entity 'ADP_Project__c'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

<apex:page standardController="ADP_Project__c" recordSetvar="HomePageProjects" showHeader="false" sidebar="false"> <apex:pageBlock > <apex:form id="theForm"> <apex:panelGrid columns="8"> <apex:outputLabel value="View:"/> <apex:selectList value="{!filterId}" size="1"> <apex:actionSupport event="onchange" rerender="list"/> <apex:selectOptions value="{!listviewoptions}"/> </apex:selectList> </apex:panelGrid> <apex:pageBlock > <apex:pageBlockTable var="m" value="{!HomePageProjects}" id="list"> <apex:column value="{!m.Name}"/> <apex:column value="{!m.Account__r.Name}"/> <apex:column value="{!m.Stage__c}"/> <apex:column > <apex:facet name="header">Start Date</apex:facet> <apex:outputText value="{!MONTH(m.Start_Date__c)}-{!DAY(m.Start_Date__c)}-{!YEAR(m.Start_Date__c)}"/> </apex:column> <apex:column value="{!m.Analyst__c}"/> <apex:column value="{!m.Fulfillment_Specialist__c}" /> <apex:column value="{!m.Graphic_Designer__c}" /> </apex:pageBlockTable> </apex:pageBlock> </apex:form> </apex:pageBlock> </apex:page>

 

  • February 03, 2009
  • Like
  • 0

Hi,

Is there a say to convert long number like this (9.0E7), to their original value i.e. 90000000 in APEX?

 

Thanks,

Rami

  • February 02, 2009
  • Like
  • 0
Hi,
I have created a testmethod that simply creates a new opportunity, my issue is if I run the testmethod through Eclipse I am getting System.DmlException: Insert failed. First exception on row 0; first error: UNKNOWN_EXCEPTION, java.lang.NullPointerException. But if I run the same testmethod through SFDC UI I don't get this error message, has anyone faced this issue before? Any help is really appreciated, I have inserted the source code for your reference.

Code:
@isTest
private class InitOppLineItemTest {

     static testMethod void myUnitTest() {
  Account existingAccount = [select Id, name from Account limit 1];
  RecordType existingRecordType = [Select r.SobjectType, r.NamespacePrefix, r.Name, r.IsActive, r.Id, r.DeveloperName, r.Description From RecordType r where SobjectType = 'Opportunity' limit 1];
  User user = [Select u.Id From User u where u.IsActive = true limit 1];
  
        Opportunity opp = new Opportunity();
     opp.recordTypeId = existingRecordType.id;
     opp.name=existingAccount.name + ': ' + 'TestOpp';
     opp.end_date__c = Date.today().addDays(31); 
     opp.CONSOLE_2_Schedule_Start_Date__c = Date.today();
     opp.closeDate = Date.today().addDays(31);
     opp.Amount_Digital__c = 300000;
     opp.Business_Unit__c = 'ALL01';
     opp.stageName = 'Engaged';
     opp.AccountId = existingAccount.id; 
     opp.OwnerId = user.id; 
     opp.CurrencyISOCode = 'USD';
                
        insert opp;
        // System.assert(false);
    }
}

 
Thanks again,
RK
  • January 09, 2009
  • Like
  • 0
I'd like to prevent users from repeatedly clicking on a custom button I've created.

Right now I have a button that will create a custom task via an AJAX call on the contacts page. On the returning AJAX call, I reRender the list of Activites associated with this contact.

However, I need a way to provide visual feedback to disable the button after a user clicks it.

I've seen this work on QuickSave button and am wondering how to implement this.

Thanks
-P

Here is the code for reference. (I've removed the inital "
apex:page standardController="Contact" extensions="customController" tabStyle="Contact">
apex:detail subject="{!contact}" relatedList="false"/>
apex:form >
apex:commandButton reRender="activitiesPanel" status="activityStatus" action="{!markContactAsSentEmail}" value="Add task for contact"/>
/apex:form>
apex:outputPanel id="activitiesPanel">
apex:actionStatus id="activityStatus" startText="Refreshing Activity History...">
apex:facet name="stop">
apex:relatedList id="activitiesList" list="ActivityHistories" />
/apex:facet>
/apex:actionStatus>
/apex:outputPanel>



Message Edited by parkerAPT on 12-23-2008 02:15 PM