• Pascal tag
  • NEWBIE
  • 40 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 7
    Replies
Hi,

I'm exploring fflib_SObjectDomain (Domain Pattern) :
https://github.com/apex-enterprise-patterns/fflib-apex-common

I'd like to understand the origin of this particular code (from fflib_SObjectDomain class, line )  :
if (System.Test.isRunningTest() & Test.Database.hasRecords())...

Where does Test.Database.hasRecords() come from ?

I can't find any reference. For instance, Test.isRunningTest() comes from Test Class (https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_methods_system_test.htm).

I have looked for any other classes in fflib-apex-common but didn't find any reference.
System.Test.isRunningTest() can be called from anonymous window in devloper console. Not Test.Database.hasRecords()
I've looked inside fflib_SObjectDomain class but I don't find any method or property...

Any idea ?
Hi,
In Step 7 of Data Integration Specialist, even though code is working as expected ( project status changing from Billable to Bill), I keep on getting the following error :
The SOAP call to the BillingService did not return the correct response. Please check your configurations and code

I know that a similar discussion has been opened but as there's a best answer related to this and that it was initially about the Web Service being down, I want this trail to be dedicated to this issue only. Trying several ways to complete the challenge didn't give any result.

Please don't answer if you only want to say you face the same issue (click on like). Just reply if you resolved the issue or opened a case and mention it. Maybe if a lot of people open a case, Salesforce will fix the issue or be more specific on the issue.

Has someone passed step 7 of Superbadge "Data Integration Specialist" since 20 august 2018 ?
For information, I opened a case 00010194 but still no answer.
In "Keep Data Secure in a Recruiting App" trailhead project, on step "Restrict Data Access with Field-Level Security, Permission Sets, and Sharing Settings", I have got the following error :

Review the instructions for setting the Job Posting status to 'Read/Write'

Did someone faced that and how to fix it ?

There's something weird. on the last screenshot regarding (Sharing settings), I see that Job Posting is "Public read only"
But this object is a junction object and following the steps won't give access to this setting but "Controlled by Parent".

I'm don't understand what "status" is referenced by the error message. There's a status field on Job Posting Site object as well as on Position object but not on Job Posting which contains only 2 master details fields.
Hi, I posted a question on Success Community and was advised to come here for help.

I need some chatter only user to update just one field of an account. How could I achieve this ?

I know chatter only user can only read account / contact but I don't want to upgrade these users only to update that field.
I'm looking even for a tricky way

Can't I create some web service / external page that would do that ? Like Web-to-Case which allows to create a case from an external web page ?
In "Keep Data Secure in a Recruiting App" trailhead project, on step "Restrict Data Access with Field-Level Security, Permission Sets, and Sharing Settings", I have got the following error :

Review the instructions for setting the Job Posting status to 'Read/Write'

Did someone faced that and how to fix it ?

There's something weird. on the last screenshot regarding (Sharing settings), I see that Job Posting is "Public read only"
But this object is a junction object and following the steps won't give access to this setting but "Controlled by Parent".

I'm don't understand what "status" is referenced by the error message. There's a status field on Job Posting Site object as well as on Position object but not on Job Posting which contains only 2 master details fields.
Hi,
In Step 7 of Data Integration Specialist, even though code is working as expected ( project status changing from Billable to Bill), I keep on getting the following error :
The SOAP call to the BillingService did not return the correct response. Please check your configurations and code

I know that a similar discussion has been opened but as there's a best answer related to this and that it was initially about the Web Service being down, I want this trail to be dedicated to this issue only. Trying several ways to complete the challenge didn't give any result.

Please don't answer if you only want to say you face the same issue (click on like). Just reply if you resolved the issue or opened a case and mention it. Maybe if a lot of people open a case, Salesforce will fix the issue or be more specific on the issue.

Has someone passed step 7 of Superbadge "Data Integration Specialist" since 20 august 2018 ?
For information, I opened a case 00010194 but still no answer.
In "Keep Data Secure in a Recruiting App" trailhead project, on step "Restrict Data Access with Field-Level Security, Permission Sets, and Sharing Settings", I have got the following error :

Review the instructions for setting the Job Posting status to 'Read/Write'

Did someone faced that and how to fix it ?

There's something weird. on the last screenshot regarding (Sharing settings), I see that Job Posting is "Public read only"
But this object is a junction object and following the steps won't give access to this setting but "Controlled by Parent".

I'm don't understand what "status" is referenced by the error message. There's a status field on Job Posting Site object as well as on Position object but not on Job Posting which contains only 2 master details fields.
Step 7 - Synchronize Salesforce project data with Square Peg's external billing system

I'm getting an error message when triggering the SOAP call from the UI via record update:

System.CalloutException: IO Exception: External server did not return any content

When I import the WSDL into SOAP UI and send the same package body, I receive this message:
HTTP/1.1 500 
Server: Cowboy
Content-Type: application/json;charset=UTF-8
Transfer-Encoding: chunked
Date: Mon, 10 Jul 2017 17:58:08 GMT
Via: 1.1 vegur
Proxy-Connection: Keep-Alive
Connection: Keep-Alive

{"timestamp":1499709488068,"status":500,"error":"Internal Server Error","exception":"java.lang.OutOfMemoryError","message":"unable to create new native thread","path":"/ws"}

Does this mean that the herokuapp needs to be restarted or something? I've found a couple of posts with sample code for this challenge and with a few small differences, mine matches from what I can tell. Here's the code I'm using:

ProjectTrigger
trigger ProjectTrigger on Project__c (after update) {
    //Call the Billing Service callout logic here

    if (trigger.isAfter && trigger.isUpdate) {
        BillingCalloutService.callBillingService(Trigger.new, Trigger.newMap, Trigger.old, Trigger.oldMap);
    }

}

BillingCalloutService
public class BillingCalloutService {
    //Implement business and callout logic methods here
    public static void callBillingService(List<Project__c> newList, Map<Id, Project__c> newMap,
            List<Project__c> oldList, Map<Id, Project__c> oldMap) {

        if(!newList.isEmpty()) {
            Project__c project = newList[0];
            if (project.Status__c == 'Billable' && oldMap.get(project.Id).Status__c != 'Billable') {
                // Get Service Credentials from custom settings
                ServiceCredentials__c credentials = ServiceCredentials__c.getInstance('BillingServiceCredential');
                billProject(project.ProjectRef__c, project.Billable_Amount__c, credentials.Username__c, credentials.Password__c);
            }
        }
    }

    @Future(callout=true)
    private static void billProject(String projectRef, Decimal billAmount, String username, String password) {

        BillingServiceProxy.project project = new BillingServiceProxy.project();
        project.projectRef = projectRef;
        project.billAmount = billAmount;
        project.username = username;
        project.password = password;

        BillingServiceProxy.InvoicesPortSoap11 invoiceCall = new BillingServiceProxy.InvoicesPortSoap11();
        // Make the callout and update the Status if callout is successful
        String response = invoiceCall.billProject(project);

        List<Project__c> projects = new List<Project__c>();
        if(response != null && response.equalsIgnoreCase('OK')) {

            projects = [
                    Select Id, Status__c
                    From Project__c
                    Where ProjectRef__c = :projectRef
            ];
            if(!projects.isEmpty()) {
                projects[0].Status__c = 'Billed';
                update projects;
            }
        }

    }
}

BillingServiceProxy
//Generated by wsdl2apex

public class BillingServiceProxy {
    public class billProjectRequest_element {
        public BillingServiceProxy.project project;
        private String[] project_type_info = new String[]{'project','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'project'};
    }
    public class project {
        public String username;
        public String password;
        public String projectRef;
        public Double billAmount;
        private String[] username_type_info = new String[]{'username','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] password_type_info = new String[]{'password','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] projectRef_type_info = new String[]{'projectRef','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] billAmount_type_info = new String[]{'billAmount','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'username','password','projectRef','billAmount'};
    }
    public class billProjectResponse_element {
        public String status;
        private String[] status_type_info = new String[]{'status','http://salesforce.com/th/invoice-web-service',null,'1','1','false'};
        private String[] apex_schema_type_info = new String[]{'http://salesforce.com/th/invoice-web-service','true','false'};
        private String[] field_order_type_info = new String[]{'status'};
    }
    public class InvoicesPortSoap11 {
        public String endpoint_x = 'http://sb-integration-bs.herokuapp.com:80/ws';
        public Map<String,String> inputHttpHeaders_x;
        public Map<String,String> outputHttpHeaders_x;
        public String clientCertName_x;
        public String clientCert_x;
        public String clientCertPasswd_x;
        public Integer timeout_x;
        private String[] ns_map_type_info = new String[]{'http://salesforce.com/th/invoice-web-service', 'BillingServiceProxy'};
        public String billProject(BillingServiceProxy.project project) {
            BillingServiceProxy.billProjectRequest_element request_x = new BillingServiceProxy.billProjectRequest_element();
            request_x.project = project;
            BillingServiceProxy.billProjectResponse_element response_x;
            Map<String, BillingServiceProxy.billProjectResponse_element> response_map_x = new Map<String, BillingServiceProxy.billProjectResponse_element>();
            response_map_x.put('response_x', response_x);
            WebServiceCallout.invoke(
              this,
              request_x,
              response_map_x,
              new String[]{endpoint_x,
              '',
              'http://salesforce.com/th/invoice-web-service',
              'billProjectRequest',
              'http://salesforce.com/th/invoice-web-service',
              'billProjectResponse',
              'BillingServiceProxy.billProjectResponse_element'}
            );
            response_x = response_map_x.get('response_x');
            return response_x.status;
        }
    }
}

Any ideas what I'm doing wrong here? Any assistance would be most appreciated!

Thanks!