• Rajeesh vr
  • NEWBIE
  • 5 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 2
    Replies
I have created a POST REST API with class name as given below. 
global with sharing class RestReceiveBid {
  global static ReturnClass doPost(id invoiceId, id userId, double amount, boolean acceptPartialBid, id contactId) {
}
}
And I have created test class with following name.
private class Test_RestReceiveBid {
 static testMethod void testDoPost() {
   RestReceiveBid.doPost(invoiceID, funderID, amount, acceptPartialBid, contactID); >> line 48
}
}
I didn't get any error while running this test class and I have deployed the same to production as well. But after some time we have decided to delete the old classes and i am trying to delete class from eclipse IDE. But when I am trying to deploy the class I amgetting the following error for the test clas. 

Test_RestReceiveBid. line 48, column 5: Variable does not exist: RestReceiveBid.

Can anyone please point out what I am missing here? Also help on how we can delete the old Apex classes from production will be appreciated. 
 
I have REST API post with return type. 

global class ReturnClass {

        global String success;
        global String message;
        global map<String,Decimal> records;

        global ReturnClass(String success, String message, map<String,Decimal> records) {
          this.success = success;
          this.message = message;
          this.records = records;
        }

    }

and I have defined the class as:
global static ReturnClass doPost(id invoiceId, id userId, double amount, boolean acceptPartialBid, id contactId) 
And I have used the same in the test as given below. 
RestReceiveBid.ReturnClass results = RestReceiveBid.doPost(invoiceID, funderID, amount, acceptPartialBid, contactID);

After som etime when I tried to delete the est class from eclipse IDE, I got the folowing error while validating the deployemnt. 

Test_RestReceiveBid. line 48, column 5: Invalid type: RestReceiveBid.ReturnClass

But the strange thing the test class is running success in sandbox. Not sure what went wrong here or what was missing. 

Can anyone please point out the issue here? 
 
I am using existing create object record SF API (/services/data/v20.0/sobjects/{object_name}) for inserting an object record from Angular js. I am able to insert all the filelds except a couple of look up fields. For these fileds I am getting the following error. 

[{"message":"No such column 'Map_Product__c' on sobject of type invoice_finance_deal__c","errorCode":"INVALID_FIELD"}]

The strange thing the insert is working another look up filed and I am not able to identify the difference in configuration between these fields. I have checked the field level security and field level accessibility and those are same for both of these fields. I have even tried with "Map_Product__r" and "Map_Product__r.Id" but no success. 
Can anyone point out what I am missing? 
I have created a REST API with url like "param1/param2/?query1=value1&query2=value2". The API is working and I am getting the response from Salesfore. But when I tried to create a test class for the above API, I am not getting query values passing from the test class to the API Apex class. I have tried to debug it and I was getting null values for the queey strings passed from the test class. Any idea why test class is not supporting query string in the API URL?
I have created a POST REST API with class name as given below. 
global with sharing class RestReceiveBid {
  global static ReturnClass doPost(id invoiceId, id userId, double amount, boolean acceptPartialBid, id contactId) {
}
}
And I have created test class with following name.
private class Test_RestReceiveBid {
 static testMethod void testDoPost() {
   RestReceiveBid.doPost(invoiceID, funderID, amount, acceptPartialBid, contactID); >> line 48
}
}
I didn't get any error while running this test class and I have deployed the same to production as well. But after some time we have decided to delete the old classes and i am trying to delete class from eclipse IDE. But when I am trying to deploy the class I amgetting the following error for the test clas. 

Test_RestReceiveBid. line 48, column 5: Variable does not exist: RestReceiveBid.

Can anyone please point out what I am missing here? Also help on how we can delete the old Apex classes from production will be appreciated. 
 
I am using existing create object record SF API (/services/data/v20.0/sobjects/{object_name}) for inserting an object record from Angular js. I am able to insert all the filelds except a couple of look up fields. For these fileds I am getting the following error. 

[{"message":"No such column 'Map_Product__c' on sobject of type invoice_finance_deal__c","errorCode":"INVALID_FIELD"}]

The strange thing the insert is working another look up filed and I am not able to identify the difference in configuration between these fields. I have checked the field level security and field level accessibility and those are same for both of these fields. I have even tried with "Map_Product__r" and "Map_Product__r.Id" but no success. 
Can anyone point out what I am missing?