• LinThaw
  • SMARTIE
  • 1724 Points
  • Member since 2016
  • Salesforce Developer, Lightning Champion
  • Canon IT Solutions Inc.


  • Chatter
    Feed
  • 2
    Best Answers
  • 11
    Likes Received
  • 3
    Likes Given
  • 91
    Questions
  • 221
    Replies
i need guidance regarding DataLoader any one please suggest to complete Challenge 8
 
Hi all,
is it possible to run the password encryption tool and save the result to a file?
Currently I use:
cd C:\SFDC\CHECK\Dataloader\bin 

encrypt.bat -e <password> "C:\SFDC\CHECK\Dataloader\key.txt" >..\encryptedPassword.txt
The resulting file contains
2016-03-24 12:51:22,701 INFO [main] security.EncryptionUtil main (EncryptionUtil.java:365) - <encrypted password>

Is it possible to only save the <encrypted password>?

Thanks in advance!
Hi there,
How can I get users who can access the current record from apex,
look like this standard Sharing Hierarchy Page as below.
User-added imageIs there easy way to get them rather than using shared object, group, groupmember and userrole.
Thanks for any suggestion.
Regards,
LinThaw

Hi there,

I am creating Azure AD Open ID Connector in Auth. Provider.
When I added [user.read] to Default Scopes, I got the following error when sso login.

AuthorizationError?ErrorCode=No_Openid_Response&ErrorDescription=No+response&ProviderId=value-of-id
 

Any solution?
If I don't use user.read scope, I can login via sso.
The reason I want to add this scope is to store access token as JWT in AuthProvider.

Regards,
LinThaw

hi there,

How to get AzureAD access token by using SAML Assertion in callout apex?

I didn't find apex code in any site.

Thanks in advance.

grant_type=urn:ietf:params:oauth:grant-type:saml2-bearer
assertion=<SAML Assertion>
 

ref:

SAML Single Sign-On with Salesforce as the Service Provider (https://help.salesforce.com/s/articleView?id=sf.sso_saml_setting_up.htm&type=5)

  • September 27, 2021
  • Like
  • 0
Hi there,

Is there any documentation from salesforce to find List of Objects that can be managed or supported by Approval Process? such as Account, Case, Contact, Custom Object etc,.

We have to confirm Event and Task can't be managed by Approval Process (https://trailblazer.salesforce.com/ideaView?id=08730000000BrQCAA0).

Regards,
LinThaw

Hi there,

I am trying to override Account New button using lightning:actionOverride.
How do we implement cancel button to return previous page.
Scenario images are as follow.

User-added imageUser-added imageUser-added imageUser-added image
Thank in advance,
Regards,
LinThaw

Hi there,
According to our trailhead module, we can get picklist value by Object Name and Field Name.
Trailhead Module (https://trailhead.salesforce.com/en/content/learn/projects/workshop-override-standard-action/override_2)
@AuraEnabled        
public static List<String> getPickListValuesIntoList(String objectType, String selectedField){
    List<String> pickListValuesList = new List<String>();
    Schema.SObjectType convertToObj = Schema.getGlobalDescribe().get(objectType);
    Schema.DescribeSObjectResult res = convertToObj.getDescribe();
    Schema.DescribeFieldResult fieldResult = res.fields.getMap().get(selectedField).getDescribe();
    List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
    for( Schema.PicklistEntry pickListVal : ple){
        pickListValuesList.add(pickListVal.getLabel());
    }     
    return pickListValuesList;
}

I want to add RecordTypeId to that method.
Any good idea for that?
Thank in advance.
Regards,
LinThaw

I try to pass parameter when opening custom Tab.
but when passing parameter (c__recordId) in state, name of custom Tab is going show Blank. Why is happen? Is there good way to pass parameter when opening custom Tab.

            var navigation = component.find("navigation");
            var pageReference = {
                type: 'standard__navItemPage',
                attributes: {
                    apiName: 'customTab'
                },
                state: {
                    c__recordId: recordId
                }
            }
            component.set("v.pageReference", pageReference);
            navigation.navigate(pageReference);

Thanks in advance,
Regards,
LinThaw
Hi there,

When deploying a flow contain custom notification with ANT Migration tool, I got following error.

Error: CustomNotif (Action) - The action type "Send Custom Notification" can't be used in flows with the process type "Screen Flow".

Any suggest? Thank in advance.
Regards,
LinThaw
Hi there,

Alert showing in Security Alert are difference depend on orgs (production, sandbox, developer edition). Why?

Thanks & Regards,
LinThaw
Hi there,

In Report, how to show Approval History records of target record depend on record's picklist value.

Thanks and Regards,
LinThaw
Hi there,

How to show Text value of Get Record result in Input Text?
Default Value is not show current value after retry new Get Record.
Thanks in advanced.

Regards,
LinThaw
Hi there,

Can anyone give your suggestion for this.
best way to open Lightning Application From Lightning Component.

following is one of my suggestion.
({
    doInit : function (component, event) {
        var recId = component.get("v.recordId");
        var url = '/c/sampleApp.app?recordId=' + recId;
        window.open(url,'_top');
    }
})
reference link (https://success.salesforce.com/issues_view?id=a1p3A000000BMkkQAG&title=calling-window-open-in-lightning-component-fails-redirection-in-spring-19-following-pop-up-warning)

Thanks
LinThaw
Hi there,

I am trying following test class with api version 46.
my expected result is as follow.
totalUser = 0 and totalAccount = 0
But totalUser is not 0.
Any suggestion for using with @isTest(SeeAllData = false) User Object?
@isTest(SeeAllData = false)
public class TestClassSample {
    
    private static testMethod void test01() {      
        
        Test.startTest();
        
        System.debug('Total User Record = ' + [Select Count(Id) totalUser From User]);
        
        Test.stopTest();  
    }    
    
    private static testMethod void test02() {      
        
        Test.startTest();
        
        System.debug('Total Account Record = ' + [Select Count(Id) totalAccount From Account]);
        
        Test.stopTest();  
    }
}


Thanks
Regards,
LinThaw
Hi,
I am running following soql in developer console.

Select Count(Id) From User Where UserType = 'CSPLitePortal' and isActive = false

I got following error. 
No such column 'UserType' on entity 'User'

and also got same error when trying with other standard fields or custom fields.

this soql is working well in sandbox but error in production org.
running user's profile is standard administrator.

any suggestion or idea?

Thanks & Regards
LinThaw
Hi there,

What permissions are exactly need to delete Scheduled job.
Only [View Setup and Configuration] is not enough?

when I try with [Modify All Data] permission,
It is working. But [Modify All Data] has other dependent permissions.

Thanks in advance.
Regards,
LinThaw
 
Hi there,

In Lightning Flow, I want to open case record detail page after finish my screen Flow.

To solve this, I added Lightning Component to Last Screen of my Flow.
Is it good idea to implement it or not?
Is there other ways to do this, please let me share.
<aura:component implements="lightning:availableForFlowScreens,lightning:availableForFlowActions">
    <aura:attribute name="recordId" type="String" />
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>    
</aura:component>
 
({    
    doInit: function(component, event, helper) {
        // Get the record ID attribute
        var record = component.get("v.recordId");
        
        // Get the Lightning event that opens a record in a new tab
        var redirect = $A.get("e.force:navigateToSObject");
        
        // Pass the record ID to the event
        redirect.setParams({
            "recordId": record
        });
        
        // Open the record
        redirect.fire();
    }
})

Regards,
LinThaw
Hi there,

I am getting this kind of warning when saving Lightning Flow (Spring'19 ver).
Is there any way to clear it?

This screen includes screen components that require Lightning runtime.

User-added image

Regards,
LinThaw
hi there,
@trailhead

After creating new Trailhead playground, 
when I click Launch button, it goes to login page.

TP username format is same, so I can get it.
e.g.
trailhead_username@cunning-badger-999999.com

how to get password?
I try with password forget link.
It needs to fill security question of new TP account....
crazy...

I try with my Trailhead account's security question. but not working.

btw, old TPs are working well.

anyone facing like this?

Regards,
LinThaw

 
Hi there,

In Visualforce Page, XSS Attack can be found.

In Lightning Component,
script tab is not allowed in cmp.
So, the threat of XSS can be found?

Thanks in advance.
Regards,
LinThaw
Hi there,

I got following error on Set Your Org's External Org-Wide Defaults step.

Step not yet complete... here's what's wrong:
Your external org-wide defaults aren't configured correctly. Repeat the steps to make sure they are.

I tried with two new playgrounds.
Is there any other settings except below?

1. From Setup, enter Sharing Settings in the Quick Find box, then select Sharing Settings.
2. Click Enable External Sharing Model.
3. Click Edit in the Organization-Wide Defaults area.
4. For the Opportunity and Account and Contract objects, set the Default Internal Access to Public Read Only and the Default External Access to Private. Click OK if you get any popups or warnings.
5. Click Save.

<Trailhead : Share CRM Data with Your Partners>
https://trailhead.salesforce.com/projects/communities_share_crm_data/steps/set_external_owd

Thanks for any idea.
Regards,
LinThaw
  • September 28, 2018
  • Like
  • 2
Hi there,

I am getting this kind of warning when saving Lightning Flow (Spring'19 ver).
Is there any way to clear it?

This screen includes screen components that require Lightning runtime.

User-added image

Regards,
LinThaw
Hi there,

I got following error on Set Your Org's External Org-Wide Defaults step.

Step not yet complete... here's what's wrong:
Your external org-wide defaults aren't configured correctly. Repeat the steps to make sure they are.

I tried with two new playgrounds.
Is there any other settings except below?

1. From Setup, enter Sharing Settings in the Quick Find box, then select Sharing Settings.
2. Click Enable External Sharing Model.
3. Click Edit in the Organization-Wide Defaults area.
4. For the Opportunity and Account and Contract objects, set the Default Internal Access to Public Read Only and the Default External Access to Private. Click OK if you get any popups or warnings.
5. Click Save.

<Trailhead : Share CRM Data with Your Partners>
https://trailhead.salesforce.com/projects/communities_share_crm_data/steps/set_external_owd

Thanks for any idea.
Regards,
LinThaw
  • September 28, 2018
  • Like
  • 2
Hi there,

Number of Canvas calls per day per user (24–hour period) is describe here...
https://developer.salesforce.com/docs/atlas.en-us.platform_connect.meta/platform_connect/canvas_framework_limits.htm

Where can I see how many calls had been called?

Thank in advance.

Regards,
LinThaw
Hi there, 

I got following error on step 3.

A Volunteer Shift Worker record created for another user is not in their approval queue, or it does not have the correct status automatically assigned.

Anyone passed this step?

Thanks
LinThaw
Hi there,
I want to use showToast and
show message with multiple lines.
I tried as follow but \n is not working well.
({
    fireToastEvent : function(component, event, helper) {
        var toastEvent = $A.get("e.force:showToast");    
        toastEvent.setParams({
            "title": "Title",
            "message": "This is line 1. \n This is line 2. \n This is line 3.",
            "type": "success"
        });
        toastEvent.fire();
    }
})
is there any idea?

Regards,
LinThaw
 
Hi there,
How can I get users who can access the current record from apex,
look like this standard Sharing Hierarchy Page as below.
User-added imageIs there easy way to get them rather than using shared object, group, groupmember and userrole.
Thanks for any suggestion.
Regards,
LinThaw
We have successfully implemented SSO with Azure AD (SAML based).

We are also building an API that will have a connection to Azure AD to authenticate requests.  The API we are building can accept OpenID or SAML based auth.

The issue we're facing is trying to figure out how to send the authorization along with the API request.

One approach I'm investigating is using a Named Credential with a custom authentication provider (Open ID provider to Azure AD).  But I'm not sure if this is necessary since we already have SSO implemented.

The Apex code would look like this with this approach:
Http http = new Http();
HttpRequest request = new HttpRequest();
request.setEndpoint('callout:MY_API_URL/');
request.setMethod('POST');
request.setHeader('Content-Type''application/json;charset=UTF-8');
request.setBody(JSON.serialize(orderPayload));
HttpResponse response = http.send(request);
return response;

If this seems like a reasonable approach, please confirm.  If there's a better way to do this, please let me know. 

It seems that since we already have SSO with Azure set up, we could leverage that without configuring anything more.  But I cannot find any documentation on how to set this up (and what I would need to do in Apex code when calling the API).
Hi there,

Is there any documentation from salesforce to find List of Objects that can be managed or supported by Approval Process? such as Account, Case, Contact, Custom Object etc,.

We have to confirm Event and Task can't be managed by Approval Process (https://trailblazer.salesforce.com/ideaView?id=08730000000BrQCAA0).

Regards,
LinThaw
Hi there,
According to our trailhead module, we can get picklist value by Object Name and Field Name.
Trailhead Module (https://trailhead.salesforce.com/en/content/learn/projects/workshop-override-standard-action/override_2)
@AuraEnabled        
public static List<String> getPickListValuesIntoList(String objectType, String selectedField){
    List<String> pickListValuesList = new List<String>();
    Schema.SObjectType convertToObj = Schema.getGlobalDescribe().get(objectType);
    Schema.DescribeSObjectResult res = convertToObj.getDescribe();
    Schema.DescribeFieldResult fieldResult = res.fields.getMap().get(selectedField).getDescribe();
    List<Schema.PicklistEntry> ple = fieldResult.getPicklistValues();
    for( Schema.PicklistEntry pickListVal : ple){
        pickListValuesList.add(pickListVal.getLabel());
    }     
    return pickListValuesList;
}

I want to add RecordTypeId to that method.
Any good idea for that?
Thank in advance.
Regards,
LinThaw

I try to pass parameter when opening custom Tab.
but when passing parameter (c__recordId) in state, name of custom Tab is going show Blank. Why is happen? Is there good way to pass parameter when opening custom Tab.

            var navigation = component.find("navigation");
            var pageReference = {
                type: 'standard__navItemPage',
                attributes: {
                    apiName: 'customTab'
                },
                state: {
                    c__recordId: recordId
                }
            }
            component.set("v.pageReference", pageReference);
            navigation.navigate(pageReference);

Thanks in advance,
Regards,
LinThaw
Hi there,

When deploying a flow contain custom notification with ANT Migration tool, I got following error.

Error: CustomNotif (Action) - The action type "Send Custom Notification" can't be used in flows with the process type "Screen Flow".

Any suggest? Thank in advance.
Regards,
LinThaw
Hi there,

How to show Text value of Get Record result in Input Text?
Default Value is not show current value after retry new Get Record.
Thanks in advanced.

Regards,
LinThaw
Hi there,

I am trying following test class with api version 46.
my expected result is as follow.
totalUser = 0 and totalAccount = 0
But totalUser is not 0.
Any suggestion for using with @isTest(SeeAllData = false) User Object?
@isTest(SeeAllData = false)
public class TestClassSample {
    
    private static testMethod void test01() {      
        
        Test.startTest();
        
        System.debug('Total User Record = ' + [Select Count(Id) totalUser From User]);
        
        Test.stopTest();  
    }    
    
    private static testMethod void test02() {      
        
        Test.startTest();
        
        System.debug('Total Account Record = ' + [Select Count(Id) totalAccount From Account]);
        
        Test.stopTest();  
    }
}


Thanks
Regards,
LinThaw
Hi,
I am running following soql in developer console.

Select Count(Id) From User Where UserType = 'CSPLitePortal' and isActive = false

I got following error. 
No such column 'UserType' on entity 'User'

and also got same error when trying with other standard fields or custom fields.

this soql is working well in sandbox but error in production org.
running user's profile is standard administrator.

any suggestion or idea?

Thanks & Regards
LinThaw
I'm building an integration with a SOAP API v1.2, so I'm not able to use WSDL2Apex and I must create my own Request, and send it using Http.send(), storing the endpoint, user and password in a Named Credential.

​This SOAP API uses the standard PasswordDigest security in the XML header, and as this kind of authentication is not managed automaticaly by Salesforce (I do not understand why, it is an standard used frecuently), I must build the XML security header manually by encrypting the nonce + timestamp + password.

As salesforce merge the fields after the Http.send(), I need to obtain the password previously to encrypt it and build the XML header, so I'm not able to use '{!$Credential.Password}' and SOQL do not allows access to ii either.

So, how can I access the Named Credential password to build the XML security header node?
USER_DEBUG [54]|DEBUG|[{"message":"Session expired or invalid","errorCode":"INVALID_SESSION_ID"}] using Named Credential: 


    Request code -
    
                HttpRequest feedRequest = new HttpRequest();
                feedRequest.setEndpoint('callout:full_dev_connection/services/apexrest/v1/getContacts');
                feedRequest.setMethod('GET');
                Http http = new Http();
                HTTPResponse res1= http.send(feedRequest);
                System.debug(res1.getBody());
                
                
>>>Destination org code for calling
    -
  @RestResource(urlMapping='/v1/getContacts/*')
   global with sharing class getContact {
     @Httpget
      global static list<contact> fetchAccount(){
        RestRequest req = RestContext.request;
        RestResponse res = Restcontext.response;
        Id accId = req.requestURI.substring(req.requestURI.lastIndexOf('/')+1);
    
        list<contact> lstcontact =[Select id , name,Phone,Fax,Email from contact where Accountid='001O000000Yk7tl'];
        
        return lstcontact ;
      }
   }    
Hi,

I want to get community URL from apex class.
Is there anyway to get it?

I have been try the following, but I can't get absolute URL.

test -1- the following source only work when debug in developer console.
Network myNetwork = [SELECT Id FROM Network WHERE Name ='myCommunityName' ];
ConnectApi.Community  myCommunity = ConnectApi.Communities.getCommunity(myNetwork.id);
System.debug('MyDebug : ' + myCommunity.siteUrl);

test -2- the following result have extra word /login.
Network myNetwork = [SELECT Id FROM Network WHERE Name ='myCommunityName' ];
System.debug('MyDebug: ' + Network.getLoginUrl(myNetwork.id);

I need to add a small change to the code in production, I know it is not possible via UI, but I read in the documentation that it can be done via either deploy or forceIDE. My thing against deploying is we have lot of tests, and these minor changes come in frequently. So deploying for every minor change takes a lot of time.

 

When doing via forceIDE, can I just modify the code in the IDE's editor and right click the class-> "save to server" ? or do I have "deploy to server" even with forceIDE?

 

Any help with be appreciated.

 

Thanks,

SunnySlp

Hi Devs! I'm starting a SuperBadge in Einstein Analytics (Einstein Analytics and Discovery Insights Specialist), currently doing the first challenge.
We need to do a chart that shows this fómula:
:User-added image

I already got Current Quarter Cancellations, but I can't do this purple square. How can I get previous quarter cancellations and subscribers?
I'm reading about windowing function, but I can't build my code.
 
q = load "Beattie_Subs";
q = filter q by 'Churn' == "Yes";
q = group q by ('Churn','Churn_Date_Year', 'Churn_Date_Quarter');
q = foreach q generate 'Churn' as 'Churn', 'Churn_Date_Year' + "~~~" + 'Churn_Date_Quarter' as 'Activity_Date(Year-Quarter)', count() as 'CurrentQuarterCancellations';
q = order q by ('Churn' asc, 'Activity_Date(Year-Quarter)' asc);

q1 = foreach q generate 'Churn_Date_Year' + "~~~" + 'Churn_Date_Quarter' as 'Activity_Date(Year-Quarter)', count() as CurrentQuarterCancellations;
sum(count(CurrentQuarterCancellations)) over ([-1 .. -1] partition by (Churn_Date_Year, Churn_Date_Quarter) order by 'Churn_Date_Year' + "~~~" + 'Churn_Date_Quarter');

q = limit q 2000;

Thanks <3
Hi
I have latest version of salesforce cli and running sfdx plugins --core returns 
@salesforce/plugin-generator 0.0.10 (core)
@salesforce/sfdx-trust 1.0.8 (core)
builtins 1.0.0 (core)
salesforcedx 43.12.0 (core)

But  when I run  sfdx plugins:install salesforcedx@latest I get errors below:
Installing plugin salesforcedx...
Installing plugin salesforcedx... Checking for digital signature.
Successfully validated digital signature for salesforcedx.
Finished digital signature check. Installing... !
 !    yarn --non-interactive --mutex=file:C:\...\AppData\Local\sfdx\yarn
 !    --cache-folder=C:\Users\...\Local\sfdx\yarn exited with code 1
 !    warning salesforcedx > salesforce-alm > replace > minimatch@0.2.14: Please update to minimatch
 !    3.0.2 or higher to avoid a RegExp DoS issue
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > archiver > glob >
 !    minimatch@2.0.10: Please update to minimatch 3.0.2 or higher to avoid a RegExp DoS issue
 !    warning salesforcedx > salesforce-alm > replace > nomnom@1.6.2: Package no longer supported.
 !    Contact support@npmjs.com for more info.
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > request >
 !    node-uuid@1.4.8: Use uuid module instead
 !    warning salesforcedx > salesforce-alm > jsonwebtoken > joi > hoek@2.16.3: The major version is no
 !    longer supported. Please update to 4.x or newer
 !    warning salesforcedx > force-language-services > salesforce-alm > webdriverio > request > hawk >
 !    hoek@0.9.1: The major version is no longer supported. Please update to 4.x or newer
 !    error An unexpected error occurred: "https://registry.yarnpkg.com/mkdirp/-/mkdirp-0.5.1.tgz:
 !    Request failed \"503 Service Unavailable\""
Hi,
According to the requirement of Project  I have created Lense named worldwide_sales_with_flags. But still I am getting the error:User-added imageUser-added image