顯示具有 Salesforce 標籤的文章。 顯示所有文章
顯示具有 Salesforce 標籤的文章。 顯示所有文章

2019-04-22

Practice


2019-01-14

How to make system field larger

關鍵字/Key words:
text field rezise, text field bigger, aesthetic for SFDC


客製欄位可以在edit mode修改,但如果是系統欄位需要顯示大量字元呢?
例如:描述。

Custom field can modified the # of line in edit mode. But how system field? Such as 'description'

要如何讓該欄位尺寸大到極限?


2019-01-04

Trailhead commonly asked questions: Expecting '}' but was: 'for'

網頁上的程式碼怎麼原樣貼上去,還沒有過?
Why the code can't be save while it's been directly copied and pasted from the Trailhead page?

通常這個問題產生的原因,是因為你把程式碼直接貼在class內,但這種「把內臟攤出來」的做法是不被允許的。
This usually happened due to 'directly paste code inside class', you need to put the logic inside a method.

仔細看一下 trailhead 提供的程式碼,應該是包在 method 內的。
Look the Trailhead page, carefully, the logic should be inside of a method.

你是不是直接沒有複製到 method 的頭尾XD?
There are probably some code that your missing. :P

p.s. 請善用右上角的copy // Use the copy in the up-right corner


2018-06-13

How to zip file in Mac without hidden files

對應 TrailHead : https://trailhead.salesforce.com/trails/force_com_dev_intermediate/modules/big_objects/units/big_objects_define_custom_big_objects

Mac 在打包檔案(zip)時會自動產生隱藏檔案,使用 terminal 語法進行打包的話就可以避免這個狀況發生,進而避免透過workbench上傳檔案時的「No package.xml found」錯誤。


語法:zip -r zippedfile.zip filefoder -x "*.DS_Store"

不過還是會遇到No package.xml found的錯誤....

2018-06-12

疊床架屋

在開發component時,很容易因為拆太多層所以難以debug。

所以在 TrailHead 的 challenge: https://trailhead.salesforce.com/trails/force_com_dev_intermediate/modules/lex_dev_lc_basics/units/lex_dev_lc_basics_forms

可能會遇到重複coding造成的錯誤,前前後後打滾了三四天,終於摸索出正確寫法,然後就發現有人已經寫過了。

我的理解如下:

2018-05-07

Result: [OPERATION FAILED]: classes/LeadProcessor.cls: Invalid loop variable type expected SObject was Lead

來,先上error_msg:
Result: [OPERATION FAILED]: classes/LeadProcessor.cls: Invalid loop variable type expected SObject was Lead

然後是code:
    global void execute(Database.BatchableContext BC, List l_scope) {
List l_scope_new = new List();
for(Lead l : l_scope)
{
l.leadsource = 'Dreamforce';
l_scope_new.add(l);
count++;
}
update l_scope_new;
}

原因:compiler期待型態: Lead的變數,但是接到的是型態為sObject的變數的時候,就會跳這個error。

2018-04-25

Salesforce Lightning 的 Object Manager 中 無法顯示 compound Field


此問題目前無解,在 Lightning 介面的 Object Manager ,就是不會顯示 compound Field。
即,Setup -> Object Manager -> Fields & Relationship 的頁面,依然無法看到 compound Field 中東西。

所以,目前(2018/04/25)唯一解是切回 Classic 介面進行操作。


會有這個疑問的原因:在做Trailhead練習時,發現自己一直在對(Lightning)看不到的欄位塞東西,感覺疑惑。
然後就發現,我果然不是第一個遇到這個問題的,已經有人問過這個問題了


名詞解釋:
Compound Field 

由系統打包處理的多個元素。
目前最常見的應該是Name:  Salutation + First Name + Last Name。





2018-04-20

Salesforce Apex Developer Console 自動縮排

搜尋後發現英文關鍵字是:Formatter(這個比較接近排版), auto-indent(自動縮排)

Salesforce Developer Console有自動縮排功能,快鍵是: [Shift] + [Tab]  (Mac也適用)

這個功能還滿 by IDE的,所以沒有看到什麼universal hot key,所以用便條紙記下來叭,等3M便條紙爛了,或是電腦記憶體不足需要清理電子便利貼的時候,應該也記得起來了。





因為超懷念 gg=G 這種功能,所以寫了幾天Apex就馬上開始找熱鍵。



剛剛測試,在目前最新的API:42版本中,只有自動縮排,不會取消空行、刪掉多餘的空白。

I know, I know, 用自己電腦裡的IDE有很多套鍵可以使用(還有多變數自動對齊、變數前後自動只留一個空白、標色補完等等這樣那種酷炫的套件),但如果只是看一下簡單的code,那自動縮排應該就夠了。

Source: https://stackoverflow.com/questions/42572049/any-shortcut-key-to-indent-code-in-developer-console-in-salesforce