• LAKSHMAIAH CHAGANTI
  • NEWBIE
  • 10 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 5
    Replies
Hi 
I am new to trigger coding, here is my scenario 
1.We have Account object which is having master-detail relation with custom object Aggregator__c object(fields in Aggregator__c are Aggregator_id__c, Aggregator_Name__c, Description__c, Amount__c). This Aggretor object records are showing in related list in the account.
2. My requirement is whenever there is a new record for Aggregator it must create a new record if it is completely new record or it must update the existing record if the data is coming for already existing records based Aggregator_id__c which is a unique field(number).

Thanks in Advance.
Hi folks,
I need a help from you, in my project there is a need to send csv files from salesforce to third  party client(java technology). For this we are using REST PUT service, and to connect and to send csv files from salesforce I coded as specifed below, I am getting the following error which is taken from my debug log file
DEBUG|System.HttpResponse[Status=Unsupported Media Type, StatusCode=415]

and the code is
     RESTInfo__c ri = RESTInfo__c.getInstance('cart');
            HttpRequest req = new HttpRequest();
            string url = ri.endpoint__c; // I mentioned endpoint url in custom settings
            req.setMethod('PUT');
            req.setEndpoint(url);
           // req.setHeader('Content-Type', ri.content_type__c ); //req.setHeader('content-type', 'application/csv');
            req.setHeader('email', ri.email__c);  //I mentioned endpoint email & password in custom settings
            req.setHeader('password', ri.password__c);  
            req.setHeader('carttype', ri.carttype__c);  
            req.setHeader('accountId', accMap.get(i).Account_ID__c); 
            req.setHeader('Content-Type', 'application/json');
            //req.setHeader('input', 'cart,cartcsv');
            req.setBody(cartCsv); 
            Http http = new Http();
            try {
                
                HTTPResponse res = http.send(req);
                System.debug('The response::::'+res);
                System.debug(res.toString());
                System.debug('STATUS:'+res.getStatus());
                System.debug('STATUS_CODE:'+res.getStatusCode());
                if(res.getStatus() != '200'){
                    isError = true;
                }
                
            }catch(System.CalloutException e) {
                system.debug('The exception :::'+e);
                isError = true;
                system.debug('Making error flag as true ::isError-'+isError);

Thanks in Advance
Guys, Will you please elaborate the following formula. We are using this formula for clearing cases of customers on priority base. As I have very basic knowledge on formula, it's a little bit hard to me to understand this formula.

RPAD(
RPAD(
RPAD(
text(CASE(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2))),
13,13,
12,13,
11,13,
10,13,
9,13,
8,13,
7,13,
6,13,
5,22,
4,22,
3,22,
2,22,
1,22,
0,22,
24,22,
23,22,
VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))))
,3,":"),
5,
IF(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))>=22,
'00',
IF(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))<13,
'00',
TRIM(RIGHT(TRIM(LEFT(TEXT(FLAGS__ViewedFlag__c),16)),2))))),8,
':00')))
1. Our organization has installed "Sample publi knowledge base for salesforce knowledge" package with 'knowledge article' user license 2 years back. After 1       year they didn't renewal knowledge article license i.e license expired but the package is still in our organization.
2.Currently we are not using that package & license, they did a mistake by keeping that package.
3. At presenet we are working on some issues, as part of the work we need to deploy the code while deploying we are getting errors due to that package(which     is not removed) where all test classes in our organization will run.
4 I am trying to uninstall/remove the package I am unable to delete that pakage as it has some dependencies.

Guys here I am giving clear description about the errors I am getting. Expecting reviews from as soon as possible.
Exact replication steps: Experiencing issues while deploying

Include Error Message if applicable:
Run Failures:
# Deploy Results:
File Name: classes/SelectEmailLeadsCtrl.cls
Full Name: SelectEmailLeadsCtrl
Action: UPDATED
Result: SUCCESS
Problem: n/a

File Name: classes/SelectEmailLeadsTest.cls
Full Name: SelectEmailLeadsTest
Action: UPDATED
Result: SUCCESS
Problem: n/a

File Name: package.xml
Full Name: package.xml
Action: UPDATED
Result: SUCCESS
Problem: n/a

# Test Results:
KnowledgeController.null line 292, column 16: No such column 'permissionsviewknowledge' on entity 'Profile'. 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.
KnowledgeControllerTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
MyProfilePageController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Controller.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Mobile_ConfigController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_controller.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Mobile_CustomSettingModel.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_proxy.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_Test.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SecurityHandler.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SettingsController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SiteMap.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Test.null line -1, column -1: Previous load of class failed: knowledgecontroller
ScheduleDeleteGaps.null line -1, column -1: Previous load of class failed: knowledgecontroller
ScheduleSendWeeklyAccountEmails.null line -1, column -1: Previous load of class failed: knowledgecontroller
SelectEmailLeadsCtrl.null line -1, column -1: Previous load of class failed: knowledgecontroller
SelectEmailLeadsTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
SendWeeklyAccountEmails.null line -1, column -1: Previous load of class failed: knowledgecontroller
SendWeeklyAccountEmailsTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
SiteRegisterController.null line -1, column -1: Previous load of class failed: knowledgecontroller
testCheckEmailWhitelist.null line -1, column -1: Previous load of class failed: knowledgecontroller
TriggerUtil.null line -1, column -1: Previous load of class failed: knowledgecontroller
Web2Case_Setup_Controller.null line -1, column -1: Previous load of class failed: knowledgecontroller
Hi guys I got the following error while deploying will you pleae help me here

Description: The 'knowledgecontroller' class is under “Sample Public Knowledge Base for Salesforce Knowledge” package, which is not using by us currently. But I am getting deployment error only due to this package which we can't remove/uninstall due to some dependencies.

Run Failures:
# Deploy Results:
File Name: classes/SelectEmailLeadsCtrl.cls
Full Name: SelectEmailLeadsCtrl
Action: UPDATED
Result: SUCCESS
Problem: n/a

File Name: classes/SelectEmailLeadsTest.cls
Full Name: SelectEmailLeadsTest
Action: UPDATED
Result: SUCCESS
Problem: n/a

File Name: package.xml
Full Name: package.xml
Action: UPDATED
Result: SUCCESS
Problem: n/a

# Test Results:
KnowledgeController.null line 292, column 16: No such column 'permissionsviewknowledge' on entity 'Profile'. 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.
KnowledgeControllerTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
MyProfilePageController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Controller.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Mobile_ConfigController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_controller.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Mobile_CustomSettingModel.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_proxy.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_Test.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SecurityHandler.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SettingsController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SiteMap.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Test.null line -1, column -1: Previous load of class failed: knowledgecontroller
ScheduleDeleteGaps.null line -1, column -1: Previous load of class failed: knowledgecontroller
ScheduleSendWeeklyAccountEmails.null line -1, column -1: Previous load of class failed: knowledgecontroller
SelectEmailLeadsCtrl.null line -1, column -1: Previous load of class failed: knowledgecontroller
SelectEmailLeadsTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
SendWeeklyAccountEmails.null line -1, column -1: Previous load of class failed: knowledgecontroller
SendWeeklyAccountEmailsTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
SiteRegisterController.null line -1, column -1: Previous load of class failed: knowledgecontroller
testCheckEmailWhitelist.null line -1, column -1: Previous load of class failed: knowledgecontroller
TriggerUtil.null line -1, column -1: Previous load of class failed: knowledgecontroller
Web2Case_Setup_Controller.null line -1, column -1: Previous load of class failed: knowledgecontroller
Hi folks,
I need a help from you, in my project there is a need to send csv files from salesforce to third  party client(java technology). For this we are using REST PUT service, and to connect and to send csv files from salesforce I coded as specifed below, I am getting the following error which is taken from my debug log file
DEBUG|System.HttpResponse[Status=Unsupported Media Type, StatusCode=415]

and the code is
     RESTInfo__c ri = RESTInfo__c.getInstance('cart');
            HttpRequest req = new HttpRequest();
            string url = ri.endpoint__c; // I mentioned endpoint url in custom settings
            req.setMethod('PUT');
            req.setEndpoint(url);
           // req.setHeader('Content-Type', ri.content_type__c ); //req.setHeader('content-type', 'application/csv');
            req.setHeader('email', ri.email__c);  //I mentioned endpoint email & password in custom settings
            req.setHeader('password', ri.password__c);  
            req.setHeader('carttype', ri.carttype__c);  
            req.setHeader('accountId', accMap.get(i).Account_ID__c); 
            req.setHeader('Content-Type', 'application/json');
            //req.setHeader('input', 'cart,cartcsv');
            req.setBody(cartCsv); 
            Http http = new Http();
            try {
                
                HTTPResponse res = http.send(req);
                System.debug('The response::::'+res);
                System.debug(res.toString());
                System.debug('STATUS:'+res.getStatus());
                System.debug('STATUS_CODE:'+res.getStatusCode());
                if(res.getStatus() != '200'){
                    isError = true;
                }
                
            }catch(System.CalloutException e) {
                system.debug('The exception :::'+e);
                isError = true;
                system.debug('Making error flag as true ::isError-'+isError);

Thanks in Advance
Guys, Will you please elaborate the following formula. We are using this formula for clearing cases of customers on priority base. As I have very basic knowledge on formula, it's a little bit hard to me to understand this formula.

RPAD(
RPAD(
RPAD(
text(CASE(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2))),
13,13,
12,13,
11,13,
10,13,
9,13,
8,13,
7,13,
6,13,
5,22,
4,22,
3,22,
2,22,
1,22,
0,22,
24,22,
23,22,
VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))))
,3,":"),
5,
IF(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))>=22,
'00',
IF(VALUE(TRIM(LEFT(TRIM(RIGHT(TEXT(FLAGS__ViewedFlag__c),9)),2)))<13,
'00',
TRIM(RIGHT(TRIM(LEFT(TEXT(FLAGS__ViewedFlag__c),16)),2))))),8,
':00')))
Hi guys I got the following error while deploying will you pleae help me here

Description: The 'knowledgecontroller' class is under “Sample Public Knowledge Base for Salesforce Knowledge” package, which is not using by us currently. But I am getting deployment error only due to this package which we can't remove/uninstall due to some dependencies.

Run Failures:
# Deploy Results:
File Name: classes/SelectEmailLeadsCtrl.cls
Full Name: SelectEmailLeadsCtrl
Action: UPDATED
Result: SUCCESS
Problem: n/a

File Name: classes/SelectEmailLeadsTest.cls
Full Name: SelectEmailLeadsTest
Action: UPDATED
Result: SUCCESS
Problem: n/a

File Name: package.xml
Full Name: package.xml
Action: UPDATED
Result: SUCCESS
Problem: n/a

# Test Results:
KnowledgeController.null line 292, column 16: No such column 'permissionsviewknowledge' on entity 'Profile'. 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.
KnowledgeControllerTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
MyProfilePageController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Controller.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Mobile_ConfigController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_controller.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Mobile_CustomSettingModel.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_proxy.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_mobile_Test.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SecurityHandler.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SettingsController.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_SiteMap.null line -1, column -1: Previous load of class failed: knowledgecontroller
pkb_Test.null line -1, column -1: Previous load of class failed: knowledgecontroller
ScheduleDeleteGaps.null line -1, column -1: Previous load of class failed: knowledgecontroller
ScheduleSendWeeklyAccountEmails.null line -1, column -1: Previous load of class failed: knowledgecontroller
SelectEmailLeadsCtrl.null line -1, column -1: Previous load of class failed: knowledgecontroller
SelectEmailLeadsTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
SendWeeklyAccountEmails.null line -1, column -1: Previous load of class failed: knowledgecontroller
SendWeeklyAccountEmailsTest.null line -1, column -1: Previous load of class failed: knowledgecontroller
SiteRegisterController.null line -1, column -1: Previous load of class failed: knowledgecontroller
testCheckEmailWhitelist.null line -1, column -1: Previous load of class failed: knowledgecontroller
TriggerUtil.null line -1, column -1: Previous load of class failed: knowledgecontroller
Web2Case_Setup_Controller.null line -1, column -1: Previous load of class failed: knowledgecontroller