Data Integration Specialist superbadge – challenge 3 failing

I had everything working fine, but got an error that the payload wasn’t correct. I noticed that I had forgotten to send the token in het header. I also saw that I missed the requirement on future callout from queueable, so I changed my code. After that it failed with HttpResponse[Status=Not Found, StatusCode=404] and I never got it working.

Underneath all information in Detail. Hope somebody has an idea to solve my issue.

The post “Data Integration Specialist superbadge – authenticated REST callout” made the future requirement clear for me. But while changing my (working) code slightly to meet this requirement my callout failed with code 404. Even when I replace my code with above code I still get the same error and strangely enough I can’t get it working anymore.

In the logging I see:

21:16:14:014 CALLOUT_REQUEST [21]|System.HttpRequest[Endpoint=callout:ProjectService/sb-integration-pms.herokuapp.com/projects, Method=POST]
21:16:14:384 CALLOUT_RESPONSE [21]|System.HttpResponse[Status=Not Found, StatusCode=404]

When I push the Check Challenge button it gives error:
Challenge Not yet complete… here’s what’s wrong:
Could not find an inner class named ‘QueueablePMSCall‘ that implements System.Queueable and Database.AllowsCallouts.

Somebody has an idea on how to solve this?

When I send the call to requestbin it seems ok:

Token: 546e4aad-652d-4ba3-b391-fa73b879a63d
X-Request-Id: deafa546-ee1c-4b40-ac2c-855f898f48e9
Content-Type: application/json;charset=UTF-8
Sfdc-Stack-Depth: 1
Cf-Ray: 3cb2e5803b612756-FRA
Via: 1.1 vegur
Accept: text/html, image/gif, image/jpeg, *; q=.2, */*; q=.2
Pragma: no-cache
Connection: close
Total-Route-Time: 0
Cf-Ipcountry: GB
Content-Length: 157
Connect-Time: 0
Cf-Connecting-Ip: 85.222.130.8
Host: requestb.in
User-Agent: SFDC-Callout/41.0
Cache-Control: no-cache
Cf-Visitor: {"scheme":"https"}
Accept-Encoding: gzip

Raw body:

{ "opportunityId": "0060O00000plEkgQAE", "opportunityName": "Test opp", "accountName": "Test Account", "closeDate": "2017-12-09", "amount": 45678 }

My Class looks like this:

public class ProjectCalloutService {

    @InvocableMethod(label='Post Opportunity To PMS' description='invokes a callout to asynchronousially update a PMS record.')
    public static void postOpportunityToPMS(List oppIds) {
        QueueablePMSCall qpc = new ProjectCalloutService.QueueablePMSCall(oppIds);
        ID jobID = System.enqueueJob(qpc);
    }

    @Future(callout=true)
    public static void CallOutToPMS(Id oppId, String jsonBody, String token) {
        Opportunity opp = new Opportunity(Id=oppId);
        HttpRequest request = new HttpRequest();
        request.setEndpoint('callout:ProjectService/sb-integration-pms.herokuapp.com/projects');
        request.setMethod('POST');
        request.setHeader('token', token);
        request.setHeader('Content-Type', 'application/json;charset=UTF-8');
        request.setBody(jsonBody);

        Http http = new Http();
        HttpResponse response = http.send(request);

        // Parse the JSON response
        if (response.getStatus() == 'OK') {
            opp.StageName = 'Submitted Project';
        } else {
            opp.StageName = 'Resubmit Project';
            System.debug('The status code returned was not expected: ' +
                         response.getStatusCode() + ' ' + response.getStatus());
        }
        update opp;            
    }

    public class QueueablePMSCall implements Queueable, Database.AllowsCallouts {
        Id oppId;
        String token;

        public QueueablePMSCall(List oppIds) {
            this.oppId = oppIds[0];
            this.token = ServiceTokens__c.getValues('ProjectServiceToken').Token__c;
        }

        public void execute(QueueableContext context) {
            Opportunity opp = [SELECT Id, Name, Account.Name, CloseDate, Amount 
                               FROM Opportunity 
                               WHERE isWon=true AND Id = :oppId];

            String closeDate = String.valueOf(opp.CloseDate.year()) + '-' +
                String.valueOf(opp.CloseDate.month()).leftPad(2,'0') + '-' +
                String.valueOf(opp.CloseDate.day()).leftPad(2,'0');

            System.JSONGenerator gen = JSON.createGenerator(true);

            gen.writeStartObject();
            gen.writeObjectField('opportunityId', opp.Id);
            gen.writeObjectField('opportunityName', opp.Name);
              gen.writeObjectField('accountName', opp.Account.Name);
              gen.writeObjectField('closeDate', closeDate);
            gen.writeObjectField('amount', opp.Amount.intValue());
            gen.writeEndObject();

            String jsonBody = gen.getAsString().replaceAll('" : ', '": ');

            CallOutToPMS(opp.Id, jsonBody, token);
        }
    }
} 

Question: Is it better to work as an analyst or operations specialist for a bank?

I currently work for a bank’s investment operations department. I don’t make much money and it takes a really long time to move up. Many of my coworkers are trying to be investment analyst but The rarely have openings and if they do it’s very competitive. There is an opening at the Treasury department. One is an analyst position and one is a senior operations specialist with management roles. According to HR both positions pay more than my current role but they can’t say how much.

Is it smart to use a financial planning specialist from Morgan Stanely, he wants to charge 1.25%? [duplicate]

This question already has an answer here:

  • Fee-only financial advice vs. asset management (which includes advice)?

    8 answers

My company set me up with a financial planning strategist. I left the company and he offered his services to me for charge. He wants to invest my money for me and laid me out a detailed plan to help me accomplish my savings goals such as buying a house. He said theres a 1.25% charge. Is this worth it? Or should I find another way to invest.

Is it smart to use a financial planning specialist from Morgan Stanely, he wants to charge 1.25%?

My company set me up with a financial planning strategist. I left the company and he offered his services to me for charge. He wants to invest my money for me and laid me out a detailed plan to help me accomplish my savings goals such as buying a house. He said theres a 1.25% charge. Is this worth it? Or should I find another way to invest.

What is the best way to promote yourself as a specialist in a specific field?

My questions are for freelancers that have active twitter, blog or any other social platform that gives them good clients.

Does it worth to have an active twitter account, or constantly writing to your personal blog about technologies?

Are there any success stories that were possible only because of your twitter/blog account?

Could you share your insights on what works best for you?

Thanks

What is the best way to promote yourself as a specialist in a specific field?

My questions are for freelancers that have active twitter, blog or any other social platform that gives them good clients.

Does it worth to have an active twitter account, or constantly writing to your personal blog about technologies?

Are there any success stories that were possible only because of your twitter/blog account?

Could you share your insights on what works best for you?

Thanks

Lightning Experience Rollout Specialist Challenge 4 – Facing Issue

I am unable to complete Lightning Experience Rollout Specialist Challenge #4.
Facing following error:

The custom set of fields that are highlighted on account records must be assigned to the required profile.
I have updated the corresponding layouts and assign to specific profiles.

Please let me know if I have missed any step.

If anyone have faced similar issue, please help me to solve this issue.