Wednesday, April 28, 2021
Kirikiri 2 game error under Window 10 Unable to load the plug-in windowEx.dll - 修正 吉里吉里 2 報錯解決
Sunday, April 25, 2021
Salesforce Record Security : Troubleshoot the Insufficient Privileges Error 檢查 Salesforce 權限不足錯誤
Insufficient Privileges Errors often shown when user attempts to access the record that he/she does not have right permission to read or edit .
Procedure Quick Notes :
(Obj.) User Profile > Permission Sets > (Rec.) OWD > Sharing Rules > Manual Sharing
First of ALL , make sure the user REALLY does not have the right permission by SOQL below :
Then , try to check from Object level permission to Record level permission.
*If user can read the record (HasReadAccess=true), then checking of object level security can be skipped.
The security setting about record access in salesforce can be divided into two major levels :
- Object level (*there is Field level under object level)
- Record level
Setting related to Object level permission
It controls which object user is permitted to perform CRUD operation in high level.
#CRUD = CREATE,READ,UPDATE,DELETE.
1. Profile
User profile controls the object and its field permission , it also can be used to grant ALL record access/modify permission
- Way of checking
- Setup > Quick Find box > Search Users > User list page > click the User’s profile.
- On the Profile overview page, go to Object Settings or Object Permissions.
2. Permission Sets.
Permission Sets also controls the same permissions as profile. The main different is the permission can be assigned to specific single user(s) one by one .
- Way of checking
- Setup > Quick Find box > Search Users > User list page > click the User
- On the user detail page, scroll to the Permission Set Assignments related list and click each permission set.
- On the Permission set overview page > Object Settings and review the assigned object permissions.
Answer from internet about Permission Sets VS Profiles
The settings and permissions in permission sets are also found in profiles, but permission sets extend users' functional access without changing their profiles.
Setting related to Record level permission
3. OWD ( Organization Wide Default )
OWD specify the basic accessibility of user has to each other’s records. It can be divided
as two types : Private , Public , [Controlled by Parent] .
- Way of checking
- Setup > Quick Find box > Search Sharing Settings > click Sharing Settings
- The top section is about OWD
- Private record only grant access to record owner , and those roles above record owner.
- For Custom object, the "Grant Access Using Hierarchies" can be disabled (deselected). Which means blocking record access through role hierarchy .
- i.e. Blocking supervisor from accessing the data owned by their subordinate.
- Public record can be access by ALL users , and can be categorized into three sub-types :
- Read-Only , Read/Write , [Read/Write/Transfer]
- Transfer right only selectable to some standard object like Lead , Case etc.
- Controlled by Parent record applied to child object that belongs to "Master-Detail"
relationship only. - If user has access to the parent (master) record, user will be able to view the child (detail).
4. Sharing Rule ( Role , Public Group , Users )
The rules specify access sharing of Private Object record on top of OWD. While OWD share
record based on owner role under same hierarchy branch , sharing rule can be used to further share
record based on different criteria including owner and other record characteristic.
And in contrast to OWD which share record to role above record owner on the hierarchy branch,,
sharing rule allow to share record to any role(s) and their sub-ordinates , it also enable the sharing
to specific user(s) or public group .
- Way of checking
- Setup > Quick Find box > Search Sharing Settings > click Sharing Settings
- The middle to bottom section is about sharing rules
- Share based on Record Owner
- Owners can be identified through public groups, roles and roles, and sub-ordinates ,while OWD only identified owner role and OWD does NOT allow cross-branch role (could be consider as other department) sharing of private record.
For example , we can share record created by Salesman A which is under Sales department to Sales manager(s) and users under Accounting department through sharing rules while OWD may NOT allow record share to Accounting department user under hierarchy below .
- Share based on Record Criteria
- This setting enable sharing which is NOT related to record owner, but record's characteristic.
For example , we can share opportunity (record) which has Expected Revenue over $1M to marketing manager .
While OWD and sharing rules can be used to share a group of records , manual
sharing can be used to share specific single record manually , one by one .
To check who can share the record manually ,use SOQL below :
- Way of Checking
- Record detail page> Sharing button (Classic version)
- Record > Sharing button > Edit link (Lightning version)
- Share by Sharing Button
- Record owner, role above record owner , user that has "Modify All Data" permission in profile/permission sets and administrator can view all users/groups who has access to that record, and can add share user to that specific record using that button.
*Sharing Button can be added via page layout by administrator if you cannot find it . - There are different sharing reasons of record, for those using manual sharing , usually the share reason will be "Manual Sharing". Full share reason list can be found in official site.
- Share by Apex coding API
- The default sharing reason of Apex code adding access is the same as using sharing button UI . (Which is Manual Sharing)
- Administrator can create up to 10 sharing reason for each custom object.
- Developer may select the custom sharing reason in code, for distinguish purpose.
- Deleting an Apex sharing reason will delete all sharing on the object that uses the reason.
- Method to create sharing reason can be found in official site.
Thursday, April 22, 2021
Batch script commands to combine text(.csv) files 使用命令提示字元合併多個文字檔案
Code Preview
copy *.csv all.csv #For flatten file structure 單一資料夾檔案合併 for /R %f in (*.txt) do type "%f" >> all.txt #For merging sub-folder files 多層資料夾檔案合併
There are lots of use cases that we have to handle numbers of fragment files . One of the the common operation is to combine text files into a single file. You may find section below helpful if you have to merge multiple text files.
Scenario
Case A : Combine csv data feed into single Excel sheet for filtering and analysis.
Case B : Collect all intranet system log for investigation .
The task is easy but can be time consuming , and the task actually can be done using command line within 3s. There are mainly two ways to combine text files in command line.
Method 1
The simple way is using copy command for NO sub-directory file case
![]() |
| Flatten file structure |
copy *.csv all.csv
Result
The Command above mainly choose the files to merge in the folder by selecting file extension .
It tells window to merge all .csv file in folder "C:/Users/Local User/Documents" into a file named as "all.csv".
Alternatively, you may also use the wildcard symbol * in file name like below :
The command
copy b*.csv b_all.csv
Result
The command merge .csv files with prefix letter "b" in filename into file named as "b_all.csv".
Method 2
The customized way is using for /R to handle recursive selection in sub-directory

for /R %f in (*.txt) do type "%f" >> allLog.txt
Result
Hello World
Start with Hello World as a tradition.
Try to enter code block to blogger using Hilite.me !
Test code sample in salesforce Apex format.
@isTest private class HelloWorld_Test{ static testMethod void createHelloWorld() { Account a = new Account(name='Hello World'); insert a; System.debug(LoggingLevel.INFO, 'Hello World account ID :' + a.Id); } }
End of code block Test.
Next year SF migration plan : moving out customer account to AWS , and call SF data with service account
👀 The most challenging part is about those function with user verification. My service cloud with MIAW chat , nearly redo due to the user ...
-
It takes me over hour to debug. The simple fact is that under label, we cannot use For loop. One while is valid to be used under label. To ...
-
Change File "/content/naifu/hydra_node/models.py", line 215, in __init__ from ckpt=torch.load(self.config.vae_path, map_location...
-
When I am trying to use Colab for stable diffusion , I met error below today : ImportError cannot import name 'rank_zero_only' from ...




