• umesh atry
  • NEWBIE
  • 271 Points
  • Member since 2014
  • Technical Lead
  • TechMahindra


  • Chatter
    Feed
  • 2
    Best Answers
  • 1
    Likes Received
  • 2
    Likes Given
  • 2
    Questions
  • 43
    Replies
Hi All,

What is "MIXED_DML_OPERATION"? and when it encountered? how to resolve this error? 

Thank you in advance.
i want to coverage following lines to coverage into Test class.

   Id= Apexpages.currentPage().getParameters().get('delId2');
  productId= Apexpages.currentPage().getParameters().get('productId2');

Thanks in Advance.
 
In Lightning Component Framework Specialist SuperBadge - Challenge 8, I got following error:
The BoatReview component doesn't include a public attribute named boat of type BoatType__c.
    trigger trgr_UpdateMediaTypeOnOpportunity on Account ( after update) {
        if(UtilityClass.Users_BusinessUnit == ''){
            UtilityClass.Users_BusinessUnit = UtilityClass.getLoggedInUsersBusinessUnit();
        }
        if(UtilityClass.Users_BusinessUnit == 'Display')
        {
            set<ID>acciD = new set<ID>();
            map<Id, String> accValues = new map<ID,String>();
            list<Opportunity> lOpps = new list<Opportunity>();
            List<RecordType> AccRT = [Select id,Name from RecordType where SObjectType='Account'];
            for(Account a: Trigger.new)
            {
                system.debug(a.RecordTypeID);
                if(a.RecordTypeId==AccRT[0].id || a.RecordTypeId==AccRT[1].id)
                accID.add(a.ID); 
            }
            
            if(accID!=null && accID.size()>0)
            {
                for(Account acc : [select Id,Media_Agency_associated__c, RecordType.DeveloperName from Account where id in: accID])
                {
                    if(acc.RecordType.DeveloperName =='Direct')
                        accValues.put(acc.ID,acc.Media_Agency_associated__c);
                    else
                        accValues.put(acc.ID,null);
                }
                system.debug(accValues);
                for(Opportunity opp : [select id, Media_Agency_associated__c,AccountID from Opportunity where AccountID in :accValues.keySet() and (StageName!='Closed Won' OR StageName!='Closed Lost')])
                {
                    system.debug(opp.AccountID);
                    opp.Media_Agency_associated__c = accValues.get(opp.AccountID);
                    lOpps.add(opp);
                }
                
                if(lOpps.size()>0)
                    update lOpps;
            }
        }
        
    }
Hello Experts,

I'm new to salesforce development and recently started writing apex classes. I got a requirement that uploads/download files using BOX external storage, for this I wrote visualforce page for upload/download and controllet to Http callouts to Box. In order to push this to prod we need to have a Unit test on this apex class. Here how can we write a test on this controller which contains https callouts? Please suggest.

Thanks,
Sumant K
Hi All,

What is "MIXED_DML_OPERATION"? and when it encountered? how to resolve this error? 

Thank you in advance.
i want to coverage following lines to coverage into Test class.

   Id= Apexpages.currentPage().getParameters().get('delId2');
  productId= Apexpages.currentPage().getParameters().get('productId2');

Thanks in Advance.
 
Hi Experts,

below is my trigger, i need test class for my trigger.


trigger CreateChargeCodeAutomatically on MPM4_BASE__Milestone1_Project__c (after insert) {
    
    Set<Id> projectidWherechageCodeExist= new Set<Id>();
    Set<Id> prjIdSet= new Set<Id>();
    for(MPM4_BASE__Milestone1_Project__c prj :trigger.new){
       prjIdSet.add(prj.Id);
    }

    List<Charge_Code__c> chargeCodeList=[SELECT Id,Project__r.Id FROM Charge_Code__c WHERE ID IN :prjIdSet];
    if(chargeCodeList.size() > 0){
       for(Charge_Code__c chr :chargeCodeList){
         projectidWherechageCodeExist.add(chr.Project__c);
       }
    }

    prjIdSet.removeAll(projectidWherechageCodeExist);
    
    List<Charge_Code__c> listToCreate=new List<Charge_Code__c>();
    
    for(MPM4_BASE__Milestone1_Project__c prj :[SELECT Id FROM MPM4_BASE__Milestone1_Project__c WHERE ID IN : prjIdSet]){
       
       for(Project_Charge_Code__c chrge : [SELECT Id,Name FROM Project_Charge_Code__c ]){
            
            Charge_Code__c chrgg=new Charge_Code__c();
            chrgg.Charge_Code__c = chrge.Id;
            chrgg.Project__c = prj.Id;
            listToCreate.add(chrgg);
                   
       }
    }
    
    try{
        insert listToCreate;
    }
    catch(DmlException de){
       System.debug('@@@@SFDC::'+de);
    }

}


Thanks,
Manu
I have created a trigger and write test case of that ,the code coverage is 94% .when i am deploying sand box to production its showing error.

before migration i click on refresh deploy to server,so that its happens.how to solve this please hsre any idea

I executed some codes in the anonymous window (CTRL+E)... But there was no result in Log.. !!!


User-added image



Someone help me out. !!

I need to prepare result pagination. I must keep records limit to 100 for each page and once i'm done and click next It must  fetch next 100 records and display next 100 records. I'm on the same. If any one can help that would be great Thank you in advance.

Hi There,

 

I am generating a pdf .

the content on  the pdf is dynamic from different objects and different products.

i want to fit the content of one page , but in my pdf content is going to other page .

if the product information is not fit into one page i want to move to other page , which should happen when page rendered .

 

Thanks 

Hi all,

 

I installed the Force.com for Amazon Web Services app into my Developer org and set up my S3 credentials, carefully following the instructions on this page:

http://wiki.developerforce.com/page/Installing_Force_for_Amazon_Web_Services

 

However, I consistently get this message, e.g. when I click on the "S3 Samples" tab:

 

Web service callout failed: WebService returned a SOAP Fault: Access Denied faultcode=soapenv:Client.AccessDenied faultactor=

 

Is there something I have missed in the setup that would cause this error?

 

 

thanks!

 

Matt

Hi, I am trying to export a data table done in visualforce, into an excel file.

I can already export the data into an excel file. 
My problem is that, I can't make it to be automatically in landscape orientation.

I have tried this (though the set-to-landscape part doesn't work): 

<apex:page standardController=...>

<head>
  <style type="text/css">
    @page {
        mso-page-orientation: landscape;
        size: landscape;
    }
  </style>
</head>

<table width="1840">
.....
</table>

</apex:page>

 


Please help ... Thanks in advance ... m(_ _)m 

 

Hi,

 

We get error INVALID_CROSS_REF_KEY when do upsert. 

When the record is processed after 1st round, the same record processed again, it will success to create a new record or update if available.   Any idea?

 

 

Johan

I'm having trouble logging into Salesforce via the wsc-22.jar as documented here:

 

https://wiki.apexdevnet.com/page/Introduction_to_the_Force.com_Web_Services_Connector

 

My code:

 

String stoken = "<valid token>";

ConnectorConfig config = new ConnectorConfig

config.setUsername("<valid username>")

config.setPassword("<valid password>" + stoken)

println("Username: " + config.getUsername + ", Password: " + config.getPassword())

config.setTraceMessage(true)

Connection connection = Connector.newConnection(config)

 

My results:

Username: <valid username>, Password: <valid password><valid token>

WSC: Creating a new connection to https://www.salesforce.com/services/Soap/u/18.0 Proxy = DIRECT username null

------------ Request start   ----------

<?xml version="1.0" encoding="UTF-8"?><env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><env:Body><m:login xmlns:m="urn:partner.soap.sforce.com" xmlns:sobj="urn:sobject.partner.soap.sforce.com"><m:username>valid username</m:username><m:password>valid password + token</m:password></m:login></env:Body></env:Envelope>

------------ Request end   ----------

null=[HTTP/1.1 500 Internal Server Error]

Date=[Tue, 22 Nov 2011 16:53:48 GMT]

Content-Length=[336]

Content-Encoding=[gzip]

Content-Type=[text/xml; charset=UTF-8]

Server=[]

------------ Response start ----------

<?xml version="1.0" encoding="UTF-8"?><soapenv:Envelope xmlns:soapenv="http://schemas.xmlsoap.org/soap/envelope/" xmlns:sf="urn:fault.partner.soap.sforce.com" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"><soapenv:Body><soapenv:Fault><faultcode>INVALID_LOGIN</faultcode><faultstring>INVALID_LOGIN: Invalid username, password, security token; or user locked out.</faultstring><detail><sf:LoginFault xsi:type="sf:LoginFault"><sf:exceptionCode>INVALID_LOGIN</sf:exceptionCode><sf:exceptionMessage>Invalid username, password, security token; or user locked out.</sf:exceptionMessage></sf:LoginFault></detail></soapenv:Fault></soapenv:Body></soapenv:Envelope>

------------ Response end   ----------

Exception in thread "main" [LoginFault [ApiFault  exceptionCode='INVALID_LOGIN'

 exceptionMessage='Invalid username, password, security token; or user locked out.'

]

]

 

at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)

at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)

at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)

at java.lang.reflect.Constructor.newInstance(Constructor.java:513)

at java.lang.Class.newInstance0(Class.java:355)

at java.lang.Class.newInstance(Class.java:308)

at com.sforce.ws.bind.TypeMapper.readSingle(TypeMapper.java:627)

at com.sforce.ws.bind.TypeMapper.readObject(TypeMapper.java:504)

at com.sforce.ws.transport.SoapConnection.parseDetail(SoapConnection.java:229)

at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:203)

at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:149)

at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:98)

at com.sforce.soap.partner.PartnerConnection.login(PartnerConnection.java:818)

at com.sforce.soap.partner.PartnerConnection.<init>(PartnerConnection.java:315)

at com.sforce.soap.partner.Connector.newConnection(Connector.java:27)

at salesforce.SalesforceUser.authenticate(SalesforceUser.scala:19)

at salesforce.SalesforceUser$delayedInit$body.apply(SalesforceUser.scala:46)

at scala.Function0$class.apply$mcV$sp(Function0.scala:34)

at scala.runtime.AbstractFunction0.apply$mcV$sp(AbstractFunction0.scala:12)

at scala.App$$anonfun$main$1.apply(App.scala:60)

at scala.App$$anonfun$main$1.apply(App.scala:60)

at scala.collection.LinearSeqOptimized$class.foreach(LinearSeqOptimized.scala:59)

at scala.collection.immutable.List.foreach(List.scala:45)

at scala.collection.generic.TraversableForwarder$class.foreach(TraversableForwarder.scala:30)

at scala.App$class.main(App.scala:60)

at salesforce.SalesforceUser$.main(SalesforceUser.scala:41)

at salesforce.SalesforceUser.main(SalesforceUser.scala)

 

All my user info looks good and my account is not locked.  The username I'm using is the email I setup for web login.

Any help is appreciated!

 

Vince

  • November 23, 2011
  • Like
  • 0

I have a Visualforce page rendering as PDF. I have two problems:

 

1) One of the pages has text that fits completely on the page, but for whatever reason the page wraps to a new blank page. How can I make the pdf stop after that last element.

 

<table width="100%" cellspacing="0" cellpadding="0" class="signaturebox1">
<tr>
<td colspan="2" width="46%" class="signatureheading1">
Authorized Agent for LetterLogic, Inc.:<br /><br />
</td>
<td>&nbsp;</td>
<td colspan="2" width="46%" class="signatureheading1">
Authorized Agent for {!opportunity.account.name}:<br /><br />
</td>
</tr>
<tr>
<td class="signatureline1">Signature<br /><br /></td>
<td class="signatureline1">Date<br /><br /></td>
<td>&nbsp;</td>
<td class="signatureline1">Signature<br /><br /></td>
<td class="signatureline1">Date<br /><br /></td>
</tr>
<tr>
<td class="signatureline1bot">Name</td>
<td class="signatureline1bot">Title</td>
<td>&nbsp;</td>
<td class="signatureline1bot">Name</td>
<td class="signatureline1bot">Title</td>
</tr>
</table>
</apex:page>

 

2) I would like to reduce the margins of at least that page to be more like 0.25 inches or 0.50 inches. Seems like the default is 0.75 inches. The PDF is cutting off the text.

 

Thank you!

Hi,

 

I have a bean in my process-conf.xml file which extracts data from my custom object. Now I want the filename into which the records have to be extracted to be such that I want the timestamp to be appended with it. Is it possible? Or do I have to call some java program to generate the filename. I am new to SFDC. Kindly help me on this.

 

Thanks a lot.

  • January 06, 2010
  • Like
  • 0

I have a problem with partner api. I'm post part of the code.

 

 

try{
            String query="Select Id,Opportunity.Name,Opportunity.RecordTypeId,Opportunity.AN8__c,Opportunity.CloseDate,Codigo_Formula__c ,Quantity,UnitPrice,TotalPrice from OpportunityLineItem where OpportunityId in('006....')";
           
           
            qr = connSales.query(query);
            
            
            boolean bContinue = true;
            
            while (bContinue) {
               
                int loopI = 0;
                boolean loop = true;
                while(loop){
                    try{                   
                        for (int i = 0; i < qr.getRecords().length; i++) {
                            TreeMap valores = new TreeMap();
                            SObject con = qr.getRecords()[i]; in this point its work fine
                            SObject opp = (SObject)(con.get_any()[i].getObjectValue()); but this point not work

                                                Return null value.


                            ......


                         }

                     }catch(Exception e){

                    

                     }

                 }

          

 

The query returns the records but I can not recover the values of the parent object. Always returns null.

            

Hi,

I am trying to run the partner sample. I have configured all the proxy settings correctly using the JRE command line arguments. But when try to invoke the login operation I get the below exception

Creating the binding to the web service...
LOGGING IN NOW....
; nested exception is:
        javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
AxisFault
 faultCode: {http://schemas.xmlsoap.org/soap/envelope/}Server.userException
 faultSubcode:
 faultString: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
 faultActor:
 faultNode:
 faultDetail:
        {http://xml.apache.org/axis/}stackTrace:javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
        at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:501)
        at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:343)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:720)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1025)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1038)
        at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
        at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
        at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at com.sforce.soap.partner.SoapBindingStub.login(SoapBindingStub.java:1062)
        at org.salesforce.samples.PartnerSamples.login(PartnerSamples.java:164)
        at org.salesforce.samples.PartnerSamples.run(PartnerSamples.java:2073)
        at org.salesforce.samples.PartnerSamples.main(PartnerSamples.java:109)

        {http://xml.apache.org/axis/}hostname:jagannath.india.adventnet.com

javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
        at org.apache.axis.AxisFault.makeFault(AxisFault.java:101)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:154)
        at org.apache.axis.strategies.InvocationStrategy.visit(InvocationStrategy.java:32)
        at org.apache.axis.SimpleChain.doVisiting(SimpleChain.java:118)
        at org.apache.axis.SimpleChain.invoke(SimpleChain.java:83)
        at org.apache.axis.client.AxisClient.invoke(AxisClient.java:165)
        at org.apache.axis.client.Call.invokeEngine(Call.java:2784)
        at org.apache.axis.client.Call.invoke(Call.java:2767)
        at org.apache.axis.client.Call.invoke(Call.java:2443)
        at org.apache.axis.client.Call.invoke(Call.java:2366)
        at org.apache.axis.client.Call.invoke(Call.java:1812)
        at com.sforce.soap.partner.SoapBindingStub.login(SoapBindingStub.java:1062)
        at org.salesforce.samples.PartnerSamples.login(PartnerSamples.java:164)
        at org.salesforce.samples.PartnerSamples.run(PartnerSamples.java:2073)
        at org.salesforce.samples.PartnerSamples.main(PartnerSamples.java:109)
Caused by: javax.net.ssl.SSLException: Unrecognized SSL message, plaintext connection?
        at com.sun.net.ssl.internal.ssl.InputRecord.handleUnknownRecord(InputRecord.java:501)
        at com.sun.net.ssl.internal.ssl.InputRecord.read(InputRecord.java:343)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.readRecord(SSLSocketImpl.java:720)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.performInitialHandshake(SSLSocketImpl.java:1025)
        at com.sun.net.ssl.internal.ssl.SSLSocketImpl.startHandshake(SSLSocketImpl.java:1038)
        at org.apache.axis.components.net.JSSESocketFactory.create(JSSESocketFactory.java:186)
        at org.apache.axis.transport.http.HTTPSender.getSocket(HTTPSender.java:191)
        at org.apache.axis.transport.http.HTTPSender.writeToSocket(HTTPSender.java:404)
        at org.apache.axis.transport.http.HTTPSender.invoke(HTTPSender.java:138)
        ... 13 more

I believe there is a problem while connecting to the https url of the web service.
Do I need to do any other configuration like providing certificates or signing the jar files.

Any help os greatly appreciated.

Thanks.
Jagannath
Hi All,

What is "MIXED_DML_OPERATION"? and when it encountered? how to resolve this error? 

Thank you in advance.

Hi, I am trying to export a data table done in visualforce, into an excel file.

I can already export the data into an excel file. 
My problem is that, I can't make it to be automatically in landscape orientation.

I have tried this (though the set-to-landscape part doesn't work): 

<apex:page standardController=...>

<head>
  <style type="text/css">
    @page {
        mso-page-orientation: landscape;
        size: landscape;
    }
  </style>
</head>

<table width="1840">
.....
</table>

</apex:page>

 


Please help ... Thanks in advance ... m(_ _)m