• Shabbir Shaik
  • NEWBIE
  • 13 Points
  • Member since 2014
  • Iridium Interactive

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 19
    Replies
Hi,

Callout exception when creating metadata from one salesforce to other salesforce organization.

Here is my error while executing code,

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: No operation available for request {http://soap.sforce.com/2006/04/metadata}createMetadata faultcode=soapenv:Client faultactor=

can anybody know this?
I am creating custom object from APEX but when i use this, getting problem

Initial expression is of incorrect type, expected: MetadataService.Metadata at line 39 column 50

can any body know this, Here is my code.


List<MetadataService.CustomObject> customObjectlst = new List<MetadataService.CustomObject>();
MetadataService.CustomObject customObject = new MetadataService.CustomObject();
//customObject.nameField = 'Test__c';
customObject.label = 'Test';
customObject.pluralLabel = 'Tests';
customObject.nameField = new MetadataService.CustomField();
customObject.nameField.type_x = 'Text';
customObject.nameField.label = 'Test Record';
customObject.deploymentStatus = 'Deployed';
customObject.sharingModel = 'ReadWrite';
customObjectlst.add(customObject);

List<MetadataService.SaveResult> results = meta.createMetadata(
                new MetadataService.Metadata[] { customObjectlst });      
        handleSaveResults(results[0]);

i have 100% codecoverage for Testclass in Developer Sandbox but when i push to Production it fails, can any one know this?
System.Query Exception: No Such column 'Shipping Address' found in Account.

In production we have Bill On and Zendesk Managed Packages.
Hi,

I need to display countrywise all records from object in a VF page.
how can i achieve this in the controller without hitting the governer limit ?

I need to call around a 150 countries and am trying to do this with dynamic pageblocktable however am getting this error -  'exceed soql limit 101 error'.

Any thoughts on this?
//oppcountry is List<String>

cnt= [select Id,Name,Opp_Country__c from Mat__c where Opp_Country__c<>''];

for(integer i=0;i<cnt.size();i++){
oppcountry= cnt[i].Opp_Country__c.split(';');
}

can anybody help me in this, I am unable assign country values to oppcountry.
Thanks in advance.
Hello,
    I am validating the deoployment (using eclipse) to production. However getting error. Please help.

 Code Validation Error


Regards,
Saurabh

Hi, I have one feedback__c object and  having status picklist field 
status values are  open,draft,pending reply and pending submiter

we have extra fileds created to capture the time difference opentat__c,replytat__c etc

my requirement is i want to do calculate time difference  and display in hours when the status is changed to open to draft --- stored in the opentat__c filed

pendingreply to pending submitter---replytat__c
pending submiter to open ---opentat__c


please anybody  help me out to resolve this .



Regards,
Isha

 

Hi,

Callout exception when creating metadata from one salesforce to other salesforce organization.

Here is my error while executing code,

System.CalloutException: Web service callout failed: WebService returned a SOAP Fault: No operation available for request {http://soap.sforce.com/2006/04/metadata}createMetadata faultcode=soapenv:Client faultactor=

can anybody know this?
Hello,

I am trying to insert price book enty in test class.When i have inserted this and run that class it worked fine. But My so may test class is using price book.As i ran all the test class by clicking "Run All Test"  It is giving error

"System.DmlException: Insert failed. First exception on row 0; first error: UNABLE_TO_LOCK_ROW, unable to obtain exclusive access to this record: []"
How canm i solve this granulatity issue.

My code is this

Id pricebookId = Test.getStandardPricebookId();
     
        PricebookEntry standardPrice = new PricebookEntry(
             Pricebook2Id = pricebookId, Product2Id = objProduct.Id,
             UnitPrice = 10000, IsActive = true);
        insert standardPrice;
       
        // Create a custom price book
        Pricebook2 customPB = new Pricebook2(Name='Custom Pricebook', isActive=true);
        insert customPB;
       
        // 2. Insert a price book entry with a custom price.
        PricebookEntry customPrice = new PricebookEntry(
            Pricebook2Id = customPB.Id, Product2Id = objProduct.Id,
            UnitPrice = 12000, IsActive = true);
        insert customPrice;
  • September 03, 2014
  • Like
  • 0
Hi,
          I gave username and password .user forgot password on that time i gave forgotpassword link ,when user click fargot password ling that link pagerefers to Username page.Here  I gave username(this username is there in Customobject__ c object) textbox when i enter username click submit, automatically sent new password to my mail how?

please help me..........
Hi there,

I have a task need to select a opportunities using standatd list  view page under "Action " check box.
when i check a check box select those opportunities and do some business logic and diaply message.
my question how can i know what are the opportunities are selected using Action check box  is it possible ? since that is standard page opportunity list view page .

  • September 02, 2014
  • Like
  • 1
I am creating custom object from APEX but when i use this, getting problem

Initial expression is of incorrect type, expected: MetadataService.Metadata at line 39 column 50

can any body know this, Here is my code.


List<MetadataService.CustomObject> customObjectlst = new List<MetadataService.CustomObject>();
MetadataService.CustomObject customObject = new MetadataService.CustomObject();
//customObject.nameField = 'Test__c';
customObject.label = 'Test';
customObject.pluralLabel = 'Tests';
customObject.nameField = new MetadataService.CustomField();
customObject.nameField.type_x = 'Text';
customObject.nameField.label = 'Test Record';
customObject.deploymentStatus = 'Deployed';
customObject.sharingModel = 'ReadWrite';
customObjectlst.add(customObject);

List<MetadataService.SaveResult> results = meta.createMetadata(
                new MetadataService.Metadata[] { customObjectlst });      
        handleSaveResults(results[0]);

Hi Iam trying to do paination using offset keyword next button is working but previous button in not working..


<apex:page controller="trpaginationoffsetContrller">
    <apex:form >
        <apex:pageBlock >
            <apex:pageBlockSection >
                <apex:pageBlockTable value="{!ConList}" var="con">
                    <apex:column value="{!con.Name}"/>
                    <apex:column >
                        <table  width="100%">                
                  <apex:repeat value="{!ConList}" var="ContactSelec">
                  <tr><td>{!ContactSelec.FirstName}</td> <td>{!ContactSelec.LastName }</td></tr>
                  </apex:repeat>
                  </table>
                    </apex:column>
                   
                </apex:pageBlockTable>
            </apex:pageBlockSection>
           
            <apex:commandButton value="Previous" action="{!Previous}"/>
           
           
            <apex:commandButton value="Next" action="{!Next}"/>
           
        </apex:pageBlock>
    </apex:form> 
</apex:page>

--------------------------------------------------------------------------------------------

public class trpaginationoffsetContrller {
    public List<Contact> ConList {get;set;}
    public Integer Counter = 0;
    public trpaginationoffsetContrller(){
       
        //ConList = new List<Contact>
        ConList = [select Id, Name,FirstName, LastName  from Contact ORDER BY name Limit 10 OFFSET 0];
    }
    public void Next(){
        Counter ++;
        //ConList = new List<Contact>
        ConList = [select Id, Name,FirstName, LastName from contact ORDER BY name
                   Limit 10 OFFSET 10
                  ];
        update ConList;
    }
    public void Previous(){
        counter --;
        conList = [select Id, Name,FirstName, LastName from Contact ORDER BY name limit 50 OFFSET 10]; 
        update ConList;
    }
}
and can you help me Account Names diplay its related contacts only in VF page
Hi,

I am rooky in Salesforce. I did not  understand very well how I must write a test method for code coverage, but two my  first trigger is ok. I can not imagine how to write code coverage for this my controller class
public with sharing class FatturaStampaController {
    public FatturaStampaController(ApexPages.StandardController controller) {
        righe= [SELECT Id, Descrizione_Prodotto__c, Prezzo__c, Importo_Riga__c, Quantit__c, Prodotto__c, Iva__c, Importo_Iva__c, Imponibile_Riga__c  FROM Riga_Fattura__c WHERE Fattura__c = :controller.getId()];
    }
    
public List<Riga_Fattura__c>righe{get;set;}
}
Can you help me?

Thanks a lot
Benny
I have a web service call out the is working fine.  The web service callout is triggered in an After Trigger which collects some changed field data for Contacts and then sends it to my @future method that performs the call out. 

In my testmethod for this, I start by setting up some test data as usual.  The test data includes some Custom Settings data that is used by the @future method, a test account record, and a bunch of test contacts.  After I insert all of the test data, I set up my mock callout responses, do a Test.setMock(), and then call my web service callout class.  

I get no errors when I run the test, but I am not getting the required code coverage because within one of the @future's try statements, the "You have uncommitted work pending..." exception is thrown and processed by the try's catch statement, thus by-passing most of the lines of code in the class that is doing the callout.

I am trying to write one test class for the Trigger code and the callout code,  and I know that inserts performed in test methods are not committed, so am I going to have to break the testing up into multiple test methods because of this?  

Thanks
Hello

I have written a trigger but I am now trying to unit test it.  However I am getting the following error message with my apex class.  Can anyone see what I have done wrong?

User-added image

Thanks

Sonya
Hi,

My requirement is if i select any picklist value in custome field it has to popup related value on another customer field.

Let me explaine in detail, i have two fields like medical procedure(picklist) and price field.  If i select any picklist value in medical procedure it has to be popup price field with related value.

Please share, Does anyone has some sample code or can point me in the right direction?
Many thanks!!!
  • August 29, 2014
  • Like
  • 0
i have 100% codecoverage for Testclass in Developer Sandbox but when i push to Production it fails, can any one know this?
System.Query Exception: No Such column 'Shipping Address' found in Account.

In production we have Bill On and Zendesk Managed Packages.
I have a visualforce page in which I reterieve record after search in a pageblock table. I have a button which exports a CSV file for those records. For those CSV records I have written a visualforce page whose content type I have set to CSV. After export CSV file I want to reload the page.
//oppcountry is List<String>

cnt= [select Id,Name,Opp_Country__c from Mat__c where Opp_Country__c<>''];

for(integer i=0;i<cnt.size();i++){
oppcountry= cnt[i].Opp_Country__c.split(';');
}

can anybody help me in this, I am unable assign country values to oppcountry.
Thanks in advance.