• Baz Denson
  • NEWBIE
  • 115 Points
  • Member since 2017
  • Salesforce Solution Engineer
  • Plus Partner Services


  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 32
    Questions
  • 35
    Replies
I am trying to create a formula to convert total number of days into years and months. But can't seem to get that to work. Has anyone got any suggestions on how to do this?
This is driving me crazy, looks right to me but I'm missing something!

I need to validate a flow input. There are 2 fields, a date and a number. One of the fields must be populated. The date field validation is
 
AND (
    AND (
         NOT(ISBLANK({!End_Date})),
         NOT(ISNULL({!End_Date}))
    ),
    OR (
        ISNULL({!Number_of_Occurrances}),
        ISBLANK({!Number_of_Occurrances}),
        {!Number_of_Occurrances} = 0 
    )
)

and I have the opposite validation on the number field

How do you deploy Field Service Dispatcher Console Quick Actions? Ideally through metadata.

 

Or does it have to be a manual step?

We currently have an Email 2 Case implementation but as muliple contacts can have the same email address, Slesforce is not matching the incoming email 2 case with a contact and account.

https://help.salesforce.com/articleView?id=000328268&type=1&mode=1

Is there a way we can create a custom set of matching rules, either declarativly or by custom code?

I have looked at Email services and wondered if this could work?

https://developer.salesforce.com/docs/atlas.en-us.apexcode.meta/apexcode/apex_classes_email_inbound_what_is.htm

Can anyone describe how this would work?

TIA

Requirement Description

Requirement 1
Add business logic to Prevent a user from adding any other Task Record Types to a case with the status of Closed.

Add an error message to trigger on save of the task, if the user has added a Task where the WhatId relates to a case with a status of 'Closed'. The message to read 'Tasks cannot be added to Closed cases.'

Requirement 2
Add business logic to stop a user from adding an Event to a case with the status of Closed.

Add an error message to trigger on save of the event, if the user has added an Event where the WhatId relates to the case with a status of 'Closed'. The message to read 'Events cannot be added to Closed cases.'

I can't add it as a validation rule because WhatId is polymorphic.

Can anyone suggest the best approach.

I have a flow which ends in an Update Records element. I also have an exceptions log object.

I would like to create a new exception log record if the flow fails to update the record. 

I created a create record element and set all the variables. I then linked the update record to the create record, but it didn't create a fault connector.

How do I force it to create a fault connector?
I aa trying to use process builder to create an event at 9:15 on the same date as another event. my formula is

DATETIMEVALUE(TEXT(YEAR([Event].StartDateTime ))+"-"+TEXT(MONTH([Event].StartDateTime ))+"-"+TEXT(DAY([Event].StartDateTime ))+" 09:15:00")

but I get a syntax error.

Can anyone assist with debugging please?

 
Requirement from my client.

"Take the creation of an event in the Sales (Opportunity) Object and called ‘Appointment’ and create a task for the sale (opp) owner at 9.15am on the morning of the appointment (whatever time the appointment is) to call the customer.  In the (rare) event the same user has more than 1 in a day then they should be scheduled in the time order of the appointments."

I can build a process builder to create the event but how to I ensure I don't have any clashes?

I am trying to evaluate appexchange packages in a sandbox but I keep getting the following error when I try to install.

We can’t log you in because of the following error. For more information, contact your Salesforce administrator.
No_Oauth_Token: invalid_grant authentication failure


I am using my Domain and logging in using the custom domain
My sandbox has some IP ranges whitelisted.

Any suggestions?

I have built a component to override the new action on my Previous_address__c object which is a master detail relationship to the Account object.

When I hit save or cancel, the comonent stays open. I would like it to return to the account record I clicked 'new previous address' on.

Can anyone give me some pointers?

TIA
I am getting the following error:

Uncaught Error in $A.getCallback() [Cannot read property 'Account__c' of null]

when I try to set a variable in my JS Helper class of my Lightning component.

It occurs at the following lines:
 
console.log('Parent Id is '+parentRecordId);
                component.set('v.addressDetails.Account__c', parentRecordId);

If I look at the console, I can see that parentRecordId is set, and a 
field exists on the object called Account__c. 

Can anyone explain what this error indicates and how to resolve it?

Thanks

Barry 
I have a BRP_dealer__c object, and a dealer_productline__c related object.

I would like to pull all dealers and the product lines they hold into a list and serialize it into JSON.

I am currently trying this
list<BRP_Dealer__c> dealerList =  [SELECT id, 
                                                city__c,
                                                CompanyName__c,
                                                Country__c,
                                                Email__c,
                                                Fax__c,
                                                LineTwo__c,
                                                PartyID__c,
                                                PersonName__c,
                                                postcode__c,
                                                state__c,
                                                Street__c,
                                                Telephone__c,
                                                TypeCode__c,
                                                Website__c,
                                                (select Id, name, brp_dealer__c from Dealer_ProductLine__r)
                                                FROM BRP_Dealer__c];

But it doesnt work. How do I formulate this query?

Thanks

​​​​​​​
Is it possible to generate a self signed certiciate in SF without user interaction?

Is there a way to do this in code?
 
We have hundreds of orgs and we want to create a centralised control service to manage some settings objects.

What would be the best way to do it?

Connected apps in the child orgs and remote site settings in the master org?

 
Problem:
We have a requirement from a manufacturer to expose an API endpoint. The OEM submits a getPartsInvoice request and we respond with a showPartsInvoice response.

Authentication:
Web Service security will be accomplished through a combination of TLS (Transport Layer Security) and BA (Basic Authentication) at the OEM level. We will issue credentials (UserID and Password) to the OEM. The OEM must include the credentials in the REST request using the BA protocol. These credentials will not expire unless revoked by us.

As I understand it, Salesforce does not support BA for incoming connections. Is there any way to get around this?

One solution I thought of was to have a Heroku gateway in the middle. The OEM would send the request to Heroku using BA, heroku would then send on the request to Salesforce using OAuth2.0. Salesforce would then respond to Heroku which would pass on the response to the OEM.

Can anyone suggest a better way, or point out any problems with the Heroku approach?
I have some code as follows:
System.debug('Response Body size is '+response.getBodyAsBlob().size()); 
XmlStreamReader xsr = new XmlStreamReader(response.getBody()); 
String result = parseXML(xsr, dealerId);

The reaponse body size is returned as 3229916, so when I attempt to create an XMLStreamReader variable, the heap size limit is blown.

Can anyone suggest how I can refactor the code so I don't exceed the 6mb limit?
 
I have some XML to parse which contains things like this
 
<ns0:DisplacementMeasure unitCode="cubic centimeter">976</ns0:DisplacementMeasure>

Now, I can easily access the '976' value for the displacement measure using getText(), but I also need to store the 'cubit centimeter' as the displaement measure unit.

Can anyone advise how to extract this please?

I have a web form which we are using for web to lead. When the form is filled in it automatically starts a process to send electronic contracts etc from the account.

Included on the form is a section for the customer to add the names and emails of additional contacts in the business who they would like to sign up too.

There could be a maximum of 10 extra people.

When I convert the lead, I need to convert these additional people as well. These extra people would also need to be part of the contract process. 

Is the best approach to write some custom APEX to convert these extra leads, or is there a functional way to handle this.

Also ahould I move the contract process onto the contact object or create each one fo these additional contacts as child accounts of the parent lead?

TIA
I am trying to get GoCardless Webhooks to work. They were working in sandbox but can't seem to get them to work in production. From looking at it I need to get an authentication token but I'm sure I didn't have to do this before.

This is the API Reference entry from GoCardless, can anyone give me any pointer please?

Webhooks notify you of new events in your GoCardless account (e.g., when the bank informs us that one of your payments has failed).
You can enable webhooks by creating a Webhook Endpoint in your GoCardless dashboard.
When an event occurs to a mandate or payment in your GoCardless account, a webhook will be sent to every enabled webhook endpoint as a POST request, which contains a list of events.
There are a few other things to note when using webhooks:
Webhooks may arrive out of order.
Webhooks may contain multiple events. These events need not have anything in common (i.e., they may be for different actions and resources).
When deciding what actions to take in response to Webhook events, we recommend you switch on the details[cause] field. Other fields such as details[reason_code], are payment scheme-specific and can be inconsistent between banks, whereas the details[cause] field is our simplified and predictable key indicating what triggered the event.
Webhooks with an invalid signature must return a 498 Token Invalid error.
Webhooks about unknown events should be ignored, and return 204 No Content. GoCardless may add new events to the API without considering this a backwards incompatible change.
You must use SSL/TLS for webhook URLs. Unsecured webhook URLs are only allowed in the sandbox environment.
Webhooks include an Origin header indicating what GoCardless environment they were sent from. This will be https://api.gocardless.com for
live, and https://api-sandbox.gocardless.com for sandbox.
All the webhooks you’ve ever been sent are viewable in your GoCardless dashboard in the “Developers” area.

STATUS CODES

Your webhook handler should return a response with a 2xx status code, e.g. 200 OK, or 204 No Content. If the webhook signature is invalid, you should return a 498 Invalid Token

ERRORS & RETRIES

In the
event we fail to deliver the webhook, or you respond with a non 2xx status code, we will attempt to resend the webhook up to 10 times at increasing time intervals.
You can view webhooks we’ve sent you in your GoCardless dashboard, and can retry them if required.

IP WHITELISTING

We send webhooks from the following IP addresses which you may wish to whitelist in your firewall:
37.58.102.70
37.58.102.71
We will provide advance notification by email at least two weeks before we make any changes to these addresses.
You can set the email we will contact you at from your Dashboard - simply click “Settings” in the top-right hand corner, then “Contact preferences”, and then edit your developer contact.

SIGNING WEBHOOKS

We sign the body of the POST request with an HMAC SHA256 hex digest, using the secret of the webhook endpoint for which this webhook is being sent. This is done using an additional header:
Webhook-Signature
The HMAC SHA256 hex digest of the request body.
You must check that the webhook has a valid signature before processing it. Here’s how you could do that in Ruby:
# request_signature - the signature sent in Webhook-Signature
# request_body - the JSON body of the webhook request
# secret - the secret for the webhook endpoint require "openssl" digest = OpenSSL::Digest.new("sha256") calculated_signature = OpenSSL::HMAC.hexdigest(digest, secret, request_body) if calculated_signature == request_signature
# Signature ok! else
# Invalid signature. Ignore the webhook and return 498 Token Invalid end
I had a rest webservice working in a sandbox but when I have moved it to production, I get 401 errors.
I have a custom domain (plusgroup) so the production endpoint I am using is https://plusgroup.my.salesforce.com/services/apexrest/gocardless/

I am on the EU9 instance so should I use https://eu9.salesforce.com/services/apexrest/gocardless/

are there any setting in production that would be blocking my webservice call from reaching my webservice?
I am trying to record comments in a lightning component, I have the line
 
var task_comments = component.find("comments").get("v.value");


When I click the 'update' button, the whole thing runs fine. If I click the button a second time, its fails and says 
Uncaught Action failed: c:Stopwatch$controller$onClick [component.find(...).get is not a function]

I can't understand why it works on the first click but not on the second click.

 
How do I run a report, then populate a custom object with the report results?

The fields in the report match the custom object fields...I just don't know how to push the data from the report to the object. 

Requirement Description

Requirement 1
Add business logic to Prevent a user from adding any other Task Record Types to a case with the status of Closed.

Add an error message to trigger on save of the task, if the user has added a Task where the WhatId relates to a case with a status of 'Closed'. The message to read 'Tasks cannot be added to Closed cases.'

Requirement 2
Add business logic to stop a user from adding an Event to a case with the status of Closed.

Add an error message to trigger on save of the event, if the user has added an Event where the WhatId relates to the case with a status of 'Closed'. The message to read 'Events cannot be added to Closed cases.'

I can't add it as a validation rule because WhatId is polymorphic.

Can anyone suggest the best approach.

I aa trying to use process builder to create an event at 9:15 on the same date as another event. my formula is

DATETIMEVALUE(TEXT(YEAR([Event].StartDateTime ))+"-"+TEXT(MONTH([Event].StartDateTime ))+"-"+TEXT(DAY([Event].StartDateTime ))+" 09:15:00")

but I get a syntax error.

Can anyone assist with debugging please?

 
Requirement from my client.

"Take the creation of an event in the Sales (Opportunity) Object and called ‘Appointment’ and create a task for the sale (opp) owner at 9.15am on the morning of the appointment (whatever time the appointment is) to call the customer.  In the (rare) event the same user has more than 1 in a day then they should be scheduled in the time order of the appointments."

I can build a process builder to create the event but how to I ensure I don't have any clashes?
I am getting the following error:

Uncaught Error in $A.getCallback() [Cannot read property 'Account__c' of null]

when I try to set a variable in my JS Helper class of my Lightning component.

It occurs at the following lines:
 
console.log('Parent Id is '+parentRecordId);
                component.set('v.addressDetails.Account__c', parentRecordId);

If I look at the console, I can see that parentRecordId is set, and a 
field exists on the object called Account__c. 

Can anyone explain what this error indicates and how to resolve it?

Thanks

Barry 
I have a BRP_dealer__c object, and a dealer_productline__c related object.

I would like to pull all dealers and the product lines they hold into a list and serialize it into JSON.

I am currently trying this
list<BRP_Dealer__c> dealerList =  [SELECT id, 
                                                city__c,
                                                CompanyName__c,
                                                Country__c,
                                                Email__c,
                                                Fax__c,
                                                LineTwo__c,
                                                PartyID__c,
                                                PersonName__c,
                                                postcode__c,
                                                state__c,
                                                Street__c,
                                                Telephone__c,
                                                TypeCode__c,
                                                Website__c,
                                                (select Id, name, brp_dealer__c from Dealer_ProductLine__r)
                                                FROM BRP_Dealer__c];

But it doesnt work. How do I formulate this query?

Thanks

​​​​​​​
I have some code as follows:
System.debug('Response Body size is '+response.getBodyAsBlob().size()); 
XmlStreamReader xsr = new XmlStreamReader(response.getBody()); 
String result = parseXML(xsr, dealerId);

The reaponse body size is returned as 3229916, so when I attempt to create an XMLStreamReader variable, the heap size limit is blown.

Can anyone suggest how I can refactor the code so I don't exceed the 6mb limit?
 
I have some XML to parse which contains things like this
 
<ns0:DisplacementMeasure unitCode="cubic centimeter">976</ns0:DisplacementMeasure>

Now, I can easily access the '976' value for the displacement measure using getText(), but I also need to store the 'cubit centimeter' as the displaement measure unit.

Can anyone advise how to extract this please?

I am trying to record comments in a lightning component, I have the line
 
var task_comments = component.find("comments").get("v.value");


When I click the 'update' button, the whole thing runs fine. If I click the button a second time, its fails and says 
Uncaught Action failed: c:Stopwatch$controller$onClick [component.find(...).get is not a function]

I can't understand why it works on the first click but not on the second click.

 
hi,

I am unable to add currency in SAR (Saudi Riyal) in lightning
Hi guys,

My requirement is to get a list of all standad and custom object apis in a list.
I dont want to list Objects like RecordType, ApexPage etc.
I want only buesness objects (Such as Account,Contact,Opportunity etc) ,and custom objects if any.
Please Help Me Out.......
online rental sytem project dummy any one can share
I have 2 future calls. The first creates a record in our accounting software via call out.

I then use another future method to create an invoice in the accounting software and pass it the customer ID returned from the first future method.

I have created 2 seperate apex classes. Both are invocable processes. When a status changes on the opportunity I use process builder to fire the first call to create the customer record. Which creates a customer record related to the account.

When a customer record is created I use process builder to fire the second invocable process to create the invoice.

I am getting the error 'Future Method cannot be called from future or batch method.' 

I can't understand why if I can call the first future method from process builder, and it has finished (as a customer record is created) then why can't I call the second future method from process builder also?