• Martha_Seneta
  • NEWBIE
  • 125 Points
  • Member since 2008

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 1
    Likes Given
  • 4
    Questions
  • 23
    Replies

I'm sure I'm missing something simple but I've set the Filters in Setup>Monitoring>Debug Logs and some some things they seem to work.

 

"Some things" being like when I go to the filters page, that activity shows up in my Debug Logs. The Log begins with a line that reflects my Filter choices:

 

21.0 APEX_CODE,WARN;APEX_PROFILING,INFO

But when I run the test class that I really need to debug, the filters don't have any effect and my debug log reaches it's max. The first line reads:

 

20.0 APEX_CODE,FINE;APEX_PROFILING,FINE;DB,INFO;VALIDATION,INFO;WORKFLOW,FINEST

which seem to indicate that my Filters aren't being applied at all.

 

Anyone know what I'm missing here?

 

is there a way to programmatically set the default LoggingLevel?

 

 

Thanks!

 

 

 

 

 

 

 

Hello,

 

I have found a link in this forum that took me a website that had a class developed that creates a Clones a PO and Line Items too.  I used it to create my Clone class that will Clone the Opportunity and related Partner records but I cannot get the Partner record portion to work correctly.  I get the following error message.  Hopefully someone can help me past this issue?

•Opportunity: field integrity exception: OpportunityId, AccountToId (account to cannot be opportunity account) •java.sql.SQLException: ORA-20067: ORA-06512: at "HAPPY.GUTIL", line 42 ORA-06512: at "HAPPY.SPARTNER", line 458 ORA-06512: at line 1 : {call sPartner.insert_detail(?,?,?,?,?,?)}

 

The code that I have is below and the Opportunity will clone successfully if I comment out the portion that attempts to clone the partner related records that is in bold red below.

 

public class OppCloneWithPartnerRecsController { //added an instance varaible for the standard controller private ApexPages.StandardController controller {get; set;} // add the instance for the variables being passed by id on the url private Opportunity opp {get;set;} // set the id of the record that is created -- ONLY USED BY THE TEST CLASS /////public ID newRecordId {get;set;} // initialize the controller public OppCloneWithPartnerRecsController(ApexPages.StandardController controller) { //initialize the stanrdard controller this.controller = controller; // load the current record opp = (Opportunity)controller.getRecord(); } // method called from the VF's action attribute to clone the po public PageReference cloneWithPartners() { // setup the save point for rollback Savepoint sp = Database.setSavepoint(); Opportunity newOpp; try { //copy the purchase order - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE //WHEN MOVED TO PRODUCTION ADD THESE FIELDS // Strenghts__c, Underwriting__c, opp = [select Id, AccountId, Name, CloseDate, StageName, Effective_Date__c from Opportunity where Id = :opp.id]; opp.CloseDate = opp.CloseDate + 365; opp.Effective_Date__c = opp.Effective_Date__c + 365; newOpp = opp.clone(false); insert newOpp; // set the id of the new po created for testing //// newRecordId = newPO.id; // copy over the partners - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE List<Partner> partners = new List<Partner>(); for (Partner pr : [Select AccountToId, AccountFromId, p.IsPrimary, p.OpportunityId, p.Role From Partner p where OpportunityId = :opp.id]) { Partner newPR = pr.clone(false); newPR.OpportunityId = newOpp.id; partners.add(newPR); System.debug(newOpp.id); } insert partners; } catch (Exception e){ // roll everything back in case of errors Database.rollback(sp); ApexPages.addMessages(e); return null; } //return new PageReference('/'+newOpp.id+'/e?retURL=%2F'+newOpp.id); return new PageReference('/'+newOpp.id); } }

 

Within a flow, I'm trying to pass a collection variable as input to an Apex element.  However, when I configure the Apex element, the collection variable does not show up as a selectable value in the Source dropdown.  In fact, there is not even a section within the dropdown for Collection Variables.  Anyone know why?

Collection Variables not selectable as input

Here are some relevant details:
  • The @InvocableMethod method that's being invoked accepts a list of Strings as its parameter (even though the name of the param is 'idList').
  • In the flow, record lookups populate various variables with record Id values.  A collection variable has been declared with Data Type = Text and Input/Output Type = Input Only.  An assignment variable is used to add the values of a couple of the Id variables into the collection variable.
  • I have double-checked by searching for the collection variable by name within the Inputs dropdown, and have confirmed it is not found.
I've been referencing this article but so far can't find any explanation:  https://developer.salesforce.com/docs/atlas.en-us.salesforce_vpm_guide.meta/salesforce_vpm_guide/vpm_designer_elements_apex.htm

I'd like to pull datetime fields in my local time zone using LexiLoader, but the "Time Zone" option seems to have no effect on output.  For example, with "Time Zone" = 'America/New_York', a given datetime value was exported as '2013-01-25T00:27:21.000Z'.  After updating the "Time Zone" setting to 'GMT', the same datetime value was still exported as '2013-01-25T00:27:21.000Z'.

 

Anyone have tips for getting this option to have an impact on datetime output using LexiLoader?

Please send resume to Martha Seneta at mseneta@insulet.com

 

Position overview:

The Senior Salesforce.com Developer is a critical member of the IT Commercial Systems Team and reports to the Senior Manager, Business Systems. Working in a dynamic, collaborative team environment, the successful candidate will be responsible for Insulet's SalesForce.com instance and helping to ensure the delivery of high-quality Force.com solutions to implement mission-critical business needs.

 

JOB / DUTIES / RESPONSIBILITIES

  • Work closely with business partners to realize the full capabilities of Salesforce.com CRM.
  • Conduct analysis and documentation of existing business processes; recommend process improvements
  • Develop training materials and conduct training sessions with business users to improve adoption and efficient use of Salesforce.com across the enterprise
  • Responsible for developing and maintaining the functional areas of data management, forecasting, accounts, leads, opportunities, dashboards and reports and any other functional areas as required.
  • Creating and managing complex workflow rules, data validations, and object customizations
  • Managing user set up, profiles, roles, and teams
  • Importing and exporting large volumes of data
  • Assists in the evaluation of App Exchange tools for feasibility and impact to the business
  • Provide problem root cause analysis to resolve complex system problems as part of Tier 3 support
  • Create and maintain system interface diagrams, functional designs, and technical specifications
  • Write requirement, technical approach and design documentation supporting business needs as part of specific project teams

JOB QUALIFICATIONS

Knowledge / Education

  • Proven knowledge of the software and systems development life cycle; experience with enterprise-level integrations involving business-critical systems.
  • Proficient in programming languages relevant to your job including general knowledge of language syntax and coding techniques (Apex, JavaScript, .NET).
  • Sound understanding of architectural components used within the applications supported including the ability to architect and design smaller scale solutions.
  • Excellent understanding of relational database concepts.
  • BS in Computer Science, Engineering, or equivalent experience.

Job Experience

  • At least 8 years experience administering/developing on SalesForce / Force.com platform (Enterprise edition or higher), preferably in a large multi-dimensional organization
  • Experience with CRM reporting and analytics
  • Prior experience with transaction-based systems and processes
  • Proven ability to manage large-scale Salesforce.com projects
  • Experience integrating with and adapting to SOA platforms
  • Eclipse and Java background a plus

Skills / Competencies

  • Self sufficient, flexible, and motivated team player capable of managing several activities simultaneously
  • Ability to work in a deadline focused, dynamic environment, consistently producing deliverables within agreed upon timelines
  • Ability to analyze problems and develop solutions
  • Excellent communication and influencing skills is critical.
  • Ability to analyze business processes, design process improvements, and train business users to the new processes
  • Excellent knowledge of customer focused IT delivery methods is required.
  • Demonstrated expertise with cross-functional delivery of IT services using geographically distributed teams is required.
  • Excellent writing skills, with ability to express strategy, technical knowledge, processes in easily understood presentation.
  • Positive, results driven, rational, logical, team player.
  • Ability to rapidly learn and take advantage of new concepts, business models, and technologies
  • Ability to work independently & on multiple projects against deadlines
  • Experience in the healthcare or medical device industry a plus
  • Must have a well-developed habit of commenting your code and writing documentation



Does anyone know of a way to download View ( i.e., <listView> ) metadata into eclipse for standard objects?

I'm using Eclipse SDK Version 3.3.2 to try to retrieve as much metadata as I can about our production instance.  When I refresh our custom objects into eclipse, all Views for a given object are included.  Here's an example of one:

   <listViews>
        <fullName>AllOffBoardingRequests</fullName>
        <columns>NAME</columns>
        <columns>Existing_Employee_Name__c</columns>
        <columns>Expected_Work_End_Date__c</columns>
        <columns>Reports_To_Contact__c</columns>
        <columns>Department__c</columns>
        <columns>OWNER.ALIAS</columns>
        <columns>Status__c</columns>
        <columns>Effective_Date__c</columns>
        <columns>Start_Date__c</columns>
        <columns>Request_Date__c</columns>
        <filterScope>Everything</filterScope>
        <filters>
            <field>RECORDTYPE</field>
            <operation>equals</operation>
            <value>Employee_On_Boarding_Form__c.OffBoarding</value>
        </filters>
        <label>All Off-Boarding Requests</label>
    </listViews>

The same type of View metadata does _not_ appear automatically when I download our standard objects into eclipse, and I can't figure out why.

Thanks.
I have a client that is having problems accessing custom SF Rest API.  

Login is successful using oauth2 token (services/oauth2/token) with grant_type = password.  Attempt to access custom REST API using services/apexrest/myRESTInterface with received access_token & instance_url from login response, results in 403 (error code = MUTUAL_AUTHENTICATION_FAILED) from http POST of REST url.

Also, configured a connectedApp (restricted IPs) & profile for the login user.

Help !  I have checked thousands of settings & have performed a ton of googling. And, yep, not a premier customer either.

Here is some code ==>
 1.  Login call:
  URL==>  HTTPS://login.salesforce.com/services/oauth2/token

  Payload ==>  username=XXXXX%40myCompany.org&password=YYYYYYY&grant_type=password&client_id=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ&client_secret=NNNNNNNNNNN

 2. Custom Rest Call (using access_code & instance_url from login response):
  URL==> HTTPS://NA18.SALESFORCE.COM/services/apexrest/myRESTInterface
  Header ==> Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X-PrettyPrint: 1
  Payload ==>  {"myPayload":["attribute1"]}
HI,
   
          I have 2 objects Quote,Quoe-line-item i want to call the line item fields from Quote by using soql query may i know how can i call the child fields from parent object
Hi folks

I created a Lead trigger after insert, that should search for Contacts with the same Email address as the lead and update a field depending on a lead field.

More detailed:
We use a Web-To-Lead Form to create Leads for people who would like to unsubscribe for one of our two newsletters we send. Because creating Records over this form is by far the easiest way (no VF pages), we had a go for that. We adapted the web-to-lead form to a simple link which creates a lead and redirects to a chosen website. The link contains the Org Id, the Lead Record Type Id and a value to fill the picklist "OptOutType" in which we store for what newsletter the user wants to unsubscribe.


My test class executes fine without any (unwanted) errors. However, when using the web to lead link, there's only a lead created but no update on contact. That is when I thought that maybe the code somehow runs using access restrictions and tried to run the code as admin user, but then the lead wasn't even created anymore.

Because the Web To Lead process isn't run by any existing user, I can not use the Debug Log option from the SF setup as there is nobody to track. That leaves me clueless on how to catch the error message...



I use a trigger template with trigger handler classes fro all of my code. On that just a few notes:
- Trigger runs on every DML operation
- Trigger calls the TriggerManager class and adds an instance of a handler class and passes on the type of DML operation
- Trigger calls the methods "setValues(trigger.new, trigger.old.map)" and "handle(dmlOperation)".
- The handler class implements the triggerTempalte interface which makes it execute the two methods mentioned before

And here is my handler class:

public class LeadHandlerNewsletter implements TriggerTemplate.Handler
{
private list<Lead> newLeads;
private list<RecordType> recTypes;
private map<String, Id> recTypeMap = new map<String, Id>();
private User owner = new User();

public void setValues(list<SObject> newValues, map<Id, SObject> oldValues)
{
newLeads = newValues;
recTypes = [ SELECT Id, Name FROM RecordType WHERE SObjectType = 'Lead' ];
for ( RecordType rec : recTypes )
{
recTypeMap.put(rec.Name, rec.Id);
}
owner = [ SELECT Id FROM User WHERE CustomApexErrorReceiver__c = true AND isActive = true LIMIT 1 ];
if ( owner == NULL || Test.isRunningTest() )
{
Profile admin = [ SELECT Id FROM Profile WHERE Name = 'System Administrator' LIMIT 1 ];
owner = [ SELECT Id FROM User WHERE ProfileId = :admin.Id AND isActive = true LIMIT 1 ];
}
}

public void handle(TriggerTemplate.TriggerAction theAction)
{
if ( theAction == TriggerTemplate.TriggerAction.afterInsert )
{
processRelevant(findRelevant(newLeads, recTypeMap));
}
}

private static list<Lead> findRelevant(list<Lead> allLeads, map<String, Id> recTypeMap)
{

list<Lead> relLeads = new list<Lead>();
 
try
{
for ( Lead currLead : allLeads )
{
if ( currLead.RecordTypeId == recTypeMap.get('Newsletter Opt Out') )
{
relLeads.add(currLead);
}
}
return relLeads;
}
catch (System.Nullpointerexception e)
{
System.debug('Record Type Mapping got messed up, returning current list to continue');
return relLeads;
}
}

private void processRelevant(list<Lead> relLeads)
{
// Both String Keys for maps are Email addresses
map<String, Lead> leadMap = new map<String, Lead>();
map<String, list<Contact>> emailContactMap = new map<String, list<Contact>>();
list<Contact> contacts;
list<String> keys = new list<String>();
for ( Lead currLead : relLeads )
{
Lead aLead = new Lead();
aLead = currLead;
leadMap.put(currLead.Email, aLead);
}
contacts = [ SELECT Id, Email, Manufacturer_Update__c, Retailer_Update__c FROM Contact WHERE Email IN :leadMap.keySet() ];
 
for ( Contact c : contacts )
{
if ( emailContactMap.containsKey(c.Email) )
{
emailContactMap.get(c.Email).add(c);
}
else
{
emailContactMap.put(c.Email, new list<Contact>{c});
}
// Collect leads whose Email were not retrieved
keys.add(c.Email);
}
 
list<Contact> contactsToUpdate = new list<Contact>();
 
for ( String s : emailContactMap.keySet() )
{
if ( leadMap.get(s).OptOutType__c.equalsIgnoreCase('ManufacturerUpdate') )
{
for ( Contact c : emailContactMap.get(s) )
{
c.Manufacturer_Update__c = 'no - has unsubscribed';
contactsToUpdate.add(c);
}
}
else if ( leadMap.get(s).OptOutType__c.equalsIgnoreCase('RetailerUpdate') )
{
for ( Contact c : emailContactMap.get(s) )
{
c.Retailer_Update__c = 'no - has unsubscribed';
contactsToUpdate.add(c);
}
}
}
 
// Create Task for unprocessed Leads
list<Lead> unprocessed = new list<Lead>();
list<Task> errorTasks = new list<Task>();
 
for ( String s : keys )
{
leadMap.remove(s);
}
unprocessed = leadMap.values(); 
 
for ( Lead currLead : unprocessed )
{
errorTasks.add(new Task(WhoId = currLead.Id, Subject = 'Unsubscription failed!', OwnerId = owner.Id));
}
 
// This block seems not to be executed at all / correctly from the Web-To-Lead Form
try
{
update contactsToUpdate;
 
if ( errorTasks != NULL && errorTasks.size() != 0 )
{
insert errorTasks;
}
 
// Code Coverage for Exception
if ( Test.isRunningTest() )
{
System.debug('Throwing error intentionally');
insert new Account();
}
  
}
catch(System.DmlException e)
{
System.debug('The process just crashed with error message: ' + e.getMessage());
}
}
}

Hello!
Lately I've turned Email-to-Case option and found out that there is limitation to attachments sent via Email.

According to http://login.salesforce.com/help/doc/en/limits.htm there is limit to 10mb for attachment in "On-Demand Service".

But every time I send attachment bigger than 7,5 mb I got Mail delivery failure with "The error that the other server returned was: 552 552 Message is too large; 10485760 bytes max"

From what I've read emails grow up while they are sent by 33% so I figured out that this might be the problem.
Could anyone confirm that? If yes what are the "real" limits for attachments?

 

Btw maybe anyone knows, if there is way to copy/move attachment from email to salesforce attachments in case (excluding that application on appexchange)??

 

Best regards

Maciej

 

Edit: I have just noticed, that there is attachment icon next to email in case view but when i opened email i see: "Attachments[0]".

I see this question come up often and after having to fight with it again today, I thought I would post a quick quick with tips and tricks:

 

 

What you think should work

 

<apex:commandButton action="{!someAtion}" value="Click Me">
     <apex:param assignTo="{!conVariable}" name="con" id="con" value="123"/>
</apex:commandButton>

 Well, let me tell you, this DOES NOT work.

 

  - Why - A little bug with the command button and param. Commandlink works, but the command button requires something more to get it to set the value of the controller variable.

 

How to fix it

 

 1. Create a hidden output panel on the page, and simply rerender it. This will cause the command button to set the controller vairable as expected.

 

<apex:outputPanel id="hidden" rendered="false"/>

<apex:commandButton action="{!someAtion}" value="Click Me" reRender="hidden">
     <apex:param assignTo="{!conVariable}" name="con" id="con" value="123"/>
</apex:commandButton>

 

Calling Javascript with the button and setting the variable, what you think would work

 

<apex:commandButton onclick="someFunction();" value="Click Me" rerender="hidden">
     <apex:param assignTo="{!conVariable}" name="con" id="con" value="123" />
</apex:commandButton>

 

     Well this does not work either - You need BOTH the action and rerender to be present. Well shucks, I do not want to call the controller, I want to call a jave method....

 

How to make it work

 

1. Add a method to your extenstion / controller

 

public void doNothing(){

   //Do absolutely nothing

}

 2. Modify the button as follows:

 

<apex:commandButton action="{!doNothing}" onclick="someFunction();" value="Click Me" rerender="hidden">
     <apex:param assignTo="{!conVariable}" name="con" id="con" value="123"/>
</apex:commandButton>

 

Bam. The controller variable is set as expected.

 

Why would you use this? Well here was my flow:

 

1. On click of a button I needed to set the value of a controller variable which will be used in a query

2. Before the actual method in the controller ran, I needed to run some java to manipulate the DOM

3. After the method ran, I needed to check the results

 

1: Button -> doNothing -> call Java Function

2. Java Function DOM Stuff -> ActionFunction

3. ActionFunction -> Run Controller method -> onComplete -> Java Function passin in result variable from controller

4. Java Function More DOM Manipulation or Action Function stuff based on result.

 

Hope this helps someone


I have some logic that relies on the Last Modified Date of an SObject and so in my tests need to create objects where these dates reliably differ. Given that AFAIK there is no sleep method available I am using the code below to idle away time but would be interested to know if anyone has found a better approach e.g. an API call that reliable takes many milliseconds to execute and so provides a better "delay per script statement" ratio?

 

Thanks,

Keith

 

private static void delayUntilTimeChanged() {

    Integer msPerS = 1000;
    Datetime start = Datetime.now();
    Datetime current = Datetime.now();

    // No sleep available so this ugliness
    Integer counter = 0;
    while ((current.getTime() / msPerS) == (start.getTime() / msPerS)) {
        
        // This code takes about 250ms or more on na3
        Long t1 = System.currentTimeMillis();
        String bigRandomString = '';
        for (Integer i = 0; i < 2000; i++) {
            bigRandomString += Crypto.getRandomLong();
        }
        for (Integer i = 0; i < 50; i++) {
            Blob cryptoKey = Crypto.generateAesKey(256);
            Blob data = Blob.valueOf(bigRandomString);
            Blob encryptedData = Crypto.encryptWithManagedIV('AES256', cryptoKey, data);
            Blob decryptedData = Crypto.decryptWithManagedIV('AES256', cryptoKey, encryptedData);
        }
        Long t2 = System.currentTimeMillis();

        System.debug('>>> delayUntilTimeChanged delayed for ' + (t2 - t1) + ' ms'
                + ', Count ' + counter
                + ', ScriptStatements ' + Limits.getScriptStatements() + ' of ' + Limits.getLimitScriptStatements()
                + ', CpuTime ' + Limits.getCpuTime() + ' of ' + Limits.getLimitCpuTime()
                );
        
        counter++;
        current = Datetime.now();
    }
}

 

Hi All

 

Below is the code,

 

<apex:repeat value="{!listASPSubCategories}" var="oneSubCategory" id="aspSubCategoriesShipment">
<tr>
<td style="white-space: nowrap; width:9%;">

<apex:outputField value="{!oneSubCategory.Material_Sub_Category__r.Name}" id="nameShipment" />

</td>
<apex:repeat value="{!oneSubCategory.ASP_Item_Volume__r}" var="oneASPItemVolforSubCatg" id="aspSubCategoriesShipment">
<td class="customTableNumberCell" style="width:7%;">

<apex:inputField  styleClass="tableNumberTextField" value="{!oneASPItemVolforSubCatg.Volume_Forecast__c}" id="aspItemVolforSubCatgShipment"  style="text-align: right !important;padding-left: 2px !important;padding-right: 2px !important; width:90%;" rendered="{!visibleCurrentSupplyPlan}"/><

/td>
<!--<td class="customTableNumberCell" style="width:7%;">

<apex:inputText styleClass="tableNumberTextField" value="{!oneASPItemVolforSubCatg.Volume_Forecast__c}" id="aspItemVolforSubCatgShipment"  style="text-align: right !important;padding-left: 2px !important;padding-right: 2px !important; width:90%;" disabled="{!visibleCurrentSupplyPlan}"  />

</td> -->                            
</apex:repeat>
<td class="customTableNumberCell" style="width:7%;">

<apex:outputField styleClass="tableNumberTextField" value="{!oneSubCategory.Total_Volume_Forecast__c}" id="aspSubCatgTotalShipment" />

</td>
</tr>
</apex:repeat>

 


I am facing issue in <apex:Inputfield>, if I am giving the render= true, it is not at all displaying the data. Actually I don't want to edit the data, I just want to view the data in <apex:Inputfield> and I also tried using <apex:Input text> disable attribute, it is showing the numbers with decimal point i.e..(123.0) I don't want to see the .0 value into the field.

This above is for Edit page, if "status=complete" have to make this table to be readonly.


Please help!

  • September 28, 2011
  • Like
  • 0



I have created a custom button to create a new record in custom object from the case detail screen.  The relative URL also passes several case field values mapped to the custom object fields and then i close the url with the returl of the case.id to return the user to the originating case screen.  When i press save on the new custom object record, it return to the detail view of the just created custom object record and not the case, but If I cancel it responds correctly and returns to the case detail view ...any ideas?  I have done this many times in the past and has worked flawlessly.

here is the button definition:

name : Create TREQ
Display Type: displ in existing window w/out sidebar or header
Content Source: URL


a0P is the custom object (in this case a training request) that is based on the case but requires a separate record.

The other are the custom fields mapped - they do map correctly and show correctly ion the new record screen of the training request object.

The only issue is upon save it does not return to the to case.

I have place the button on the training request related list and onthe case detail button and still get the same results.  never had this happen before.

Button Code:

/a0P/e?CF00NA0000009MPqF={!Case.CaseNumber}
&CF00NA0000009MPqF_lkid={!Case.Id}
&CF00NA0000009MPqh={!Case.Account}
&CF00NA0000009MPqh_lkid={!Case.AccountId}
&00NA0000009U0wH={!Case.Category_Type__c}
&retURL=%2f{!Case.Id}


I have tried the various options of the display beahvior to no avail.
I have use the / or the encoded %2f as substitute for the backslash and still no success...

any help is rgeatly appreciated.

Tks,
Quique

I'm sure I'm missing something simple but I've set the Filters in Setup>Monitoring>Debug Logs and some some things they seem to work.

 

"Some things" being like when I go to the filters page, that activity shows up in my Debug Logs. The Log begins with a line that reflects my Filter choices:

 

21.0 APEX_CODE,WARN;APEX_PROFILING,INFO

But when I run the test class that I really need to debug, the filters don't have any effect and my debug log reaches it's max. The first line reads:

 

20.0 APEX_CODE,FINE;APEX_PROFILING,FINE;DB,INFO;VALIDATION,INFO;WORKFLOW,FINEST

which seem to indicate that my Filters aren't being applied at all.

 

Anyone know what I'm missing here?

 

is there a way to programmatically set the default LoggingLevel?

 

 

Thanks!

 

 

 

 

 

 

 

I'm trying to insert new records via the data loader to a custom object but nothing is uploaded.  I am connected and can extract data from the custom object but everytime I try to insert, update or upsert I get a operations finished dialog but nothing happens. The dialog says "The operation has fully completed. There were 0 successful inserts and 0 errors". Help is appreciated. 

  • March 21, 2011
  • Like
  • 0

We're getting an unexpected error message when we try to compile this on the line noted below: "Error: Compile Error: Expression of type TestClass.TestType has no member named A at line ....."

 

If we comment out the contents of runTest then it compiles fine. We suspect a bug in Apex in which static methods cannot reference enums. This is ironic because static testMethods can!


@isTest
private class FixAccountIdInSalsTest
{
    private enum TestType{A, B}
    
    private static testMethod void testForA()
    {
        runTest(TestType.A); // COMPILES FINE
    }

    private static testMethod void testForB()
    {
        runTest(TestType.B); // COMPILES FINE
    }
    
    private static void runTest(TestType testType)
    {
        Test.StartTest();
        if (TestType.A == testType) // COMPILER BREAKS HERE
        {
            // do something
        }
        else if (TestType.B == testType) // AND PRESUMABLY BREAKS HERE
        {
            // do something else
        }
    }
}

We have a webservice that sometimes gets inundated with requests from an APEX trigger we have.  So, we wrote a .NET batch program to do the requests via API through SFDC with a 45 second delay between requests.  We'd like to make that a Batch APEX, however, I can't find any way to make the APEX code pause between submittals.  I tried a loop checking on the time, but that causes 200K worth of script statements which exceeds governor limits too.

 

Does anyone have any ideas?

 

Thanx!

Hi.

 

VF code:

 

<apex:pageBlockSection >


<apex:pageBlockTable value="{!accounts}" var="a" columns="3"  style="font-size:25px"  >

<apex:column headervalue="Customer Name" value="{!a.acc.Field3__c}"  />
<apex:column headervalue="Account Name" value="{!a.acc.Name}" />
<apex:column headervalue="Comments" value="{!a.acc.NlTokki__c}" />
</apex:pageBlockTable>


</apex:pageBlockSection>

 

In the above there are 3 columns in the pageblockTable.

Unable to stretch or expand the above 3 columns to a full page.

I also tired with width=" " columnsWidth="" but nothing worked.

The columns are not expanding after certain size.

I need these 3 columns to displayed equally in a full page mode.

 

 

Ideas are greatly appreciated.

 

 

Hello,

 

I have found a link in this forum that took me a website that had a class developed that creates a Clones a PO and Line Items too.  I used it to create my Clone class that will Clone the Opportunity and related Partner records but I cannot get the Partner record portion to work correctly.  I get the following error message.  Hopefully someone can help me past this issue?

•Opportunity: field integrity exception: OpportunityId, AccountToId (account to cannot be opportunity account) •java.sql.SQLException: ORA-20067: ORA-06512: at "HAPPY.GUTIL", line 42 ORA-06512: at "HAPPY.SPARTNER", line 458 ORA-06512: at line 1 : {call sPartner.insert_detail(?,?,?,?,?,?)}

 

The code that I have is below and the Opportunity will clone successfully if I comment out the portion that attempts to clone the partner related records that is in bold red below.

 

public class OppCloneWithPartnerRecsController { //added an instance varaible for the standard controller private ApexPages.StandardController controller {get; set;} // add the instance for the variables being passed by id on the url private Opportunity opp {get;set;} // set the id of the record that is created -- ONLY USED BY THE TEST CLASS /////public ID newRecordId {get;set;} // initialize the controller public OppCloneWithPartnerRecsController(ApexPages.StandardController controller) { //initialize the stanrdard controller this.controller = controller; // load the current record opp = (Opportunity)controller.getRecord(); } // method called from the VF's action attribute to clone the po public PageReference cloneWithPartners() { // setup the save point for rollback Savepoint sp = Database.setSavepoint(); Opportunity newOpp; try { //copy the purchase order - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE //WHEN MOVED TO PRODUCTION ADD THESE FIELDS // Strenghts__c, Underwriting__c, opp = [select Id, AccountId, Name, CloseDate, StageName, Effective_Date__c from Opportunity where Id = :opp.id]; opp.CloseDate = opp.CloseDate + 365; opp.Effective_Date__c = opp.Effective_Date__c + 365; newOpp = opp.clone(false); insert newOpp; // set the id of the new po created for testing //// newRecordId = newPO.id; // copy over the partners - ONLY INCLUDE THE FIELDS YOU WANT TO CLONE List<Partner> partners = new List<Partner>(); for (Partner pr : [Select AccountToId, AccountFromId, p.IsPrimary, p.OpportunityId, p.Role From Partner p where OpportunityId = :opp.id]) { Partner newPR = pr.clone(false); newPR.OpportunityId = newOpp.id; partners.add(newPR); System.debug(newOpp.id); } insert partners; } catch (Exception e){ // roll everything back in case of errors Database.rollback(sp); ApexPages.addMessages(e); return null; } //return new PageReference('/'+newOpp.id+'/e?retURL=%2F'+newOpp.id); return new PageReference('/'+newOpp.id); } }

 

On a standard SFDC page, user lookup fields have a drop down to the left of the input field where you can select "Standard User", "Partner User", etc (for examples, click the "Change Owner" link for any record). The drop down corresponds to the User.UserType field.

 

I have a VisualForce page where I have a user lookup <apex:inputField />. Of course, the UserType picklist isn't displayed for me, and when I search for a user, it's restricted to only Standard users. I need to be able to search and choose a Customer Portal user.

 

UPDATE

I just noticed that one of the URL parameters in the Lookup popup when I open it from my visualforce page is "lktp=StandardUserLookup". If I change the UserType picklist on the standard page to "Customer Portal", the parameter is "lktp=CustomerSuccessLookup". "CustomerSuccess" is the internal value for Customer Portal user types.

 

How can we change that parameter??

This makes absolutely no sense to me. I am trying to insert two OpportunityLineItems that are exactly the same but I get this exception. What good reason is there to stop the insertion of two Records that are the same?

I understand if this was an upsert operation as you can't insert and update and the same time but I am inserting two brand new OpportuntiyLineItem records.

Thanks,
Jason


Message Edited by TehNrd on 09-24-2008 04:48 PM
  • September 24, 2008
  • Like
  • 0
I have inherited code that calls the API to create a task on a lead.  This code has been working in production and has not changed.  But, on occasion, it seems to give me an integrity constraint in error that looks something like...
 

field integrity exception: WhoId, WhatId (cannot specify whatID with lead whoID)

I am creating a task on a lead (referenced in the whoId), and the whatId is not populated (its null).

The confusion I'm having is when I call SFDC Tech Support, they seem to have no idea what I'm talking about when I say I'm calling the API.  Any ideas why that is?  Or...even better...has anyone seen this kind of sporadic behavior?

Thanks for any thoughts.

 

 

I have a client that is having problems accessing custom SF Rest API.  

Login is successful using oauth2 token (services/oauth2/token) with grant_type = password.  Attempt to access custom REST API using services/apexrest/myRESTInterface with received access_token & instance_url from login response, results in 403 (error code = MUTUAL_AUTHENTICATION_FAILED) from http POST of REST url.

Also, configured a connectedApp (restricted IPs) & profile for the login user.

Help !  I have checked thousands of settings & have performed a ton of googling. And, yep, not a premier customer either.

Here is some code ==>
 1.  Login call:
  URL==>  HTTPS://login.salesforce.com/services/oauth2/token

  Payload ==>  username=XXXXX%40myCompany.org&password=YYYYYYY&grant_type=password&client_id=ZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZZ&client_secret=NNNNNNNNNNN

 2. Custom Rest Call (using access_code & instance_url from login response):
  URL==> HTTPS://NA18.SALESFORCE.COM/services/apexrest/myRESTInterface
  Header ==> Authorization: Bearer XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
X-PrettyPrint: 1
  Payload ==>  {"myPayload":["attribute1"]}