Search In This Blog

2020-05-15

Rule: trigger on the first day at 9 months later / 2 months earlier

9 month later  九ヶ月後
AND(
MONTH(DataOfferScheduledDate__c) <= 3 && TODAY() = DATE(YEAR(DataOfferScheduledDate__c), MONTH(DataOfferScheduledDate__c ) + 9, 1),
MONTH(DataOfferScheduledDate__c) > 3 && TODAY() = DATE(YEAR(DataOfferScheduledDate__c) + 1, MONTH(DataOfferScheduledDate__c) - 3, 1)
)
* Green number should sum up to 12


2 months earlier 二ヶ月前
AND(
MONTH(DataOfferScheduledDate__c) <= 2 && TODAY() = DATE(YEAR(DataOfferScheduledDate__c) - 1, MONTH(DataOfferScheduledDate__c ) + 10, 1),
MONTH(DataOfferScheduledDate__c) > 2 && TODAY() = DATE(YEAR(DataOfferScheduledDate__c), MONTH(DataOfferScheduledDate__c) - 2, 1)
)
* Change red number to any day you want

2020-04-01

Soap Api: Services url is different between Partner WSDL and Enterprise WSDL

Partner WSDL: services/Soap/u/
Enterprise WSDL: services/Soap/c/

Example:
<?xml version="1.0" encoding="utf-8" ?>
<env:Envelope xmlns:xsd="http://www.w3.org/2001/XMLSchema"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xmlns:env="http://schemas.xmlsoap.org/soap/envelope/">
  <env:Body>
    <n1:login xmlns:n1="urn:partner.soap.sforce.com">
      <n1:username>your_username</n1:username>
      <n1:password>your_password</n1:password>
    </n1:login>
  </env:Body>
</env:Envelope>

https://login.salesforce.com/services/Soap/u/48.0
 

2020-03-02

ERROR: VS Code deploy source to salesfores return 1

The situation
  • First time install VSC and salesforce extension pack
  • Success in web login auth to sfdc
  • Success in download source from sfdc
  • Failed in deploy

Fix by:
Upgrade the version of salesforce extension pack.
Terminal command: sfdx update

2020-01-15

getElement is not working in Lightning tag

SFDC defines it as Invalid DOM Access.
https://developer.salesforce.com/docs/atlas.en-us.lightning.meta/lightning/security_dom.htm
<lightning:card aura:id="map" title="Current Boat Location">
    <div style="{!'width: ' + v.width + '; height: ' + v.height}">
        Please make a selection
    </div>
</lightning:card>

Because c:domLocker, below will be error.
var mapElement = component.find("map").getElement();

Change Dom as:
<lightning:card title="Current Boat Location">
    <div aura:id="map" style="{!'width: ' + v.width + '; height: ' + v.height}">
        Please make a selection
    </div>
</lightning:card>

2018-01-19

Salesforce Credentials Exam Sample

A developer is creating unit tests for code that makes SOAP web service callouts. The developer needs to insert some test data as a part of the unit tests setup. How should the developer enable this functionality?

Choose 3 answers.

A:Surround the callout with Test.startTest(), Test.stopTest()
B:Surround the data insertion with Test.startTest(), Test.stopTest()
C:Implement the WebServiceMock interface
D:Update code to call Test.setMock()
E:Implement the HttpCalloutMock interface
The Answer is A,C,D.