It's All Writing.

Writing makes you happy.

Entries from 2019-09-01 to 1 month

How to run CI ( Continuous Integration ) on Gitlab ( executing Test code and deploying code to salesforce organization )

Environment Gitlab.com Apex Prerequisites First I prepare deployed Apex and Apex which tests that. The Apex code are shown as below. gist.github.com Code CI in gitlab comes to move by putting .gitlab-ci.yml in the route of a repository of …

How to get data which made in @testSetup method at Apex

Environment Apex Prerequisites We cannot access variables which made in @testSetup method at @isTest method. The example is shown as below. gist.github.com Solution The solution is to select the test data by using SOQL again. gist.github.c…

How to get attribute which passed to a dynamically creating component

Environment Lightning component Prerequisites For example as this case, I'll use code shown at last entry. At the code as below, we cannot get contacts which modified at child component. gist.github.com Solution It's simple. The code is sh…

How to avoid lightning aura:iteration's bug ( Rerendering child components in aura:iteration when parent attribute changed )

Environment Lightning component Prerequisites aura:iteration has a bug as child components in aura:iteration is not re-rendered when parent attribute changed. The example is shown as below. gist.github.com When a parent object (Contact) ex…

How to make a lightning component which is a sObjects selector and is a field selector which interlocks with specified sObject.

Environment Apex Lightning component Image sObject のリストから sObject を選ぶと、その sObject が持つフィールドのリストが出る汎用 lightning component の作り方を書きました。https://t.co/Mg2aGk6UHx pic.twitter.com/oYJZMd1SMu— シン (@shintaka…

How to select sObject with date type condition in correct timezone at Apex ( and SOQL )

Environment Apex Code For example I assume that you get a variable of two dates-type as follows already. gist.github.com Please refer to last entry for details of the FiscalYearCalculation.getLastFiscalYearPeriod method. Now, we'll select …

How to get Fiscal Year's start and end date at Apex

Environment Apex Code gist.github.com You can also use other literals (e.g. NEXT_FISCAL_YEAR, THIS_FISCAL_QUARTER and many ) to get each duration's start and end date with same method. Reference developer.salesforce.com

How to extends an @AuraEnabled method from super class at Apex

Environment Apex Prerequisites We can not access An Extended @AuraEnabled method from Aura ( node ) as below. gist.github.com AuraHelper.js can't access c:getAccounts. So, this code is not work. Code The solution is to change SubClass as b…

How to get Salesforce sObject's fields List that is sorted by field's name at Apex

Environment Apex Code String sobjectApiName = 'Account'; Map<String, Schema.SObjectField> fieldMap = Schema.getGlobalDescribe().get(sobjectApiName).getDescribe().fields.getMap(); List<String> fieldNames = new List<String>(fieldMap.keySet()); fieldNames.sort(); for (String fieldName: </string></string></string,>…