• pankul gupta
  • NEWBIE
  • 60 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 3
    Likes Given
  • 2
    Questions
  • 50
    Replies
Hi Community Members,

While doing the Trilhead challenge for Building a Violet App, I am getting the below error:
Step not yet complete... here's what's wrong:
Could not find a successful login with connected app named 'Violet App'

However the Client ID and customer secret ID, I am passing are correct.

Also, while running the nodeserver.js, I am getting the below error:
 
PS C:\Users\pangupta\Desktop\Violet - App> node server.jsC:\Users\pangupta\Desktop\Violet - App\node_modules\nforce\index.js:64
  if(!_.isString(this.clientId)) throw new Error('invalid or missing clientId');
                                 ^

Error: invalid or missing clientId
    at new Connection (C:\Users\pangupta\Desktop\Violet - App\node_modules\nforce\index.js:64:40)
    at Object.module.exports.createConnection (C:\Users\pangupta\Desktop\Violet - App\node_modules\nforce\index.js:1161:10)
    at Object.<anonymous> (C:\Users\pangupta\Desktop\Violet - App\node_modules\violet\lib\violetStoreSF.js:22:18)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.<anonymous> (C:\Users\pangupta\Desktop\Violet - App\gameNight.js:6:21)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Module.require (module.js:597:17)
    at require (internal/module.js:11:18)
    at Object.loadScript (C:\Users\pangupta\Desktop\Violet - App\node_modules\violet\lib\violet.js:34:7)
    at Object.loadScript (C:\Users\pangupta\Desktop\Violet - App\node_modules\violet\lib\violetSrvr.js:110:25)
    at Object.<anonymous> (C:\Users\pangupta\Desktop\Violet - App\server.js:5:12)
    at Module._compile (module.js:653:30)
    at Object.Module._extensions..js (module.js:664:10)
    at Module.load (module.js:566:32)
    at tryModuleLoad (module.js:506:12)
    at Function.Module._load (module.js:498:3)
    at Function.Module.runMain (module.js:694:10)
    at startup (bootstrap_node.js:204:16)

 
We have a custom button in Salesforce Classic and it is redirecting to a custom VF Page. The button is a formula field and the expression is as below:
IF (Pricebook_Locked__c, HYPERLINK("apex/Apttus__OpportunityAgreement?id=" &Id, IMAGE("/resource/Create_Agreement", "Create Agreement"), "_self"), NULL)

But the same button is not working in lightning and we are getting the error as "URL no Longer Exists"

Is there any specific change we have to change to make it work in Lightning?
Any inputs on the same would be appreciated?

Thanks.
Error:
apex:inputFile can not be used in conjunction with an action component, apex:commandButton or apex:commandLink that specifies a rerender or oncomplete attribute. 
Class:
<apex:form style="margin-top:5%;margin-left:5%;width:60%">
<apex:pageblock >

<apex:commandbutton styleClass="myClass" onclick="this.value = 'Authenticating....'" action="{!DriveAuth}" value="Google Drive Authentication"/>

<apex:inputfile value="{!file}" contentType="{!filetype}" filename="{!filename}" onchange="getFileData(this);"/>               
    <div>
        <apex:pageBlockSection>
            <apex:pageBlockSectionItem >
                <apex:outputPanel id="opl">
                   <apex:commandButton styleClass="myClass" onclick="this.value = 'Uploading...'" value="Upload file" action="{!UploadFile}" reRender="opl"/>        
                </apex:outputPanel>
             </apex:pageBlockSectionItem>
        </apex:pageBlockSection> 
    </div>
User-added image
Any idea what this would be about?

Subject: Email-to-Case: Error(s) encountered while processing
   
The following errors were encountered while processing an incoming email:
   
    CANNOT_EXECUTE_FLOW_TRIGGER : We can't save this record because the “FAC Trigger Create DNO Case on New Standard Case 3” process failed. Give your Salesforce admin these details. This error occurred when the flow tried to create records: STRING_TOO_LONG: DNO Name: data value too large: *company name* (max length=10). You can look up ExceptionCode values in the SOAP API Developer Guide. Error ID: 62114659-2303780 (1875224020)


I looked on the case object but could not see a field called DNO Name. 

Appreciate any help. 
I am trying to create a Chatter post for an Entitlement Process action. The action should create Chatter post 5 minutes before the milestone expiration. I have created a field update for the Entitlement Process action and then a Process Builder action to create a Chatter post whenever the field is updated. I can see the field being updated correctly. However, the Process Builder action is not being called. I have verified this using the debug log. Please advise.
We currently have a custom picker field on all of our cases that is populated with employee names. When a case worker needs additional help, we want them to choose an employee and have SF send an email to the chosen employee saying that additional help is needed. The reason for doing this is that the team that offers additional help is an Engineering team and therefore uses a different product to track bugs/help requests that can't integrate into SF. From my research, it looks like I can only doing this via Apex Triggers, but before I spent time learning Apex, I wanted to clarify that this was the path to go!

Thanks
 
Hi,
I am trying to convert a trigger I wrote into an apex class and call the class from the trigger. I am receiving two errors when I copy the code into the class. I am hoping that someone on here can help me or give me a few pointers on what I can do to fix the problem. This is the trigger that fires correctly as a trigger.
trigger RunAssignmentRule on Lead (after update) {
    List<Lead> ls = new List<Lead>();

    for (Lead l : Trigger.new) {
    
    String oldVal = trigger.oldMap.get(l.id).Status;
    
        if (l.Status == 'Open/Requalified' && oldVal <> 'Open/Requalified') {
            ls.add(new Lead(id = l.id));
        }
    }
    
    if (ls.size() > 0) {
    Database.DMLOptions dmo = new Database.DMLOptions();
    dmo.assignmentRuleHeader.useDefaultRule = true;
    Database.update(ls, dmo);
}

}

The trigger makes a lead run back through the lead assignment when its status his open requalified. When I add it to an apen class I get two errors. An unexpected token error on the list and an error on for because it says it expected a } instead of the for. 

Thanks for your help,
Edward

 
I have 2 record types in Accounts object, I need copy since Prospect RecordType to Accounts RecordType if boath record have the same "Sap number" (Custom field) i need to copy Attachments from Prospect to Account. in my code I get ids, Developer names and list of records but  I have no Idea how I can clone the attachments from prospect and put it in account record do you have any similar code that could helps me ? or any solution to my problem.

Apex Class:

public class Set_attachments {
public static void TESTMETOD(list<Account>Accountlist){
    //obtener lista de  prospectos
    List<Account>Accountlistprospect=new List<Account>();
    //obtener lista de cuentas
    List<Account>Accountlistaccount=new List<Account>();
    //obtener Id de las cuentas 
    Set<id>AccountlistId=new Set<id>();
    //obtener numero de sap
    Set<String>AccountlistSapnumber=new Set<String>();
    //obtener Attachments
    Map<Attachment,id> MapaaccAttachment = new Map<Attachment, id>();
    // hace el recuento de cuentas 
    for(Account acc:Accountlist){
        
        //Record Type prospectos
        if((acc.RecordTypeId==Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Prospect').getRecordTypeId()) && acc.ONTAP_SAP_Number__c!=null){
            Accountlistprospect.add(acc);
            AccountlistId.add(acc.id);
            AccountlistSapnumber.add(acc.ONTAP_SAP_Number__c);
            
        }
    }
    For(Account acc:[Select id, ONTAP_SAP_Number__c from Account WHERE ONTAP_SAP_Number__c in:AccountlistSapnumber AND RecordTypeId=:Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Account').getRecordTypeId()]){
        Accountlistaccount.add(acc);
    }
    For(Attachment att:[Select id,Parentid from Attachment WHERE id in:AccountlistId]){
        MapaaccAttachment.put(att, att.ParentId);
    }
    
 
        
    }
    
}

    

        
     
Hi All,

I am trying to understand if there is a way to make connected app exclusively use a non-Salesforce IDP? For example, we would like to fully use PingFederate for our Oauth IDP instead of exclusively relying on Salesforce to issue/validate Oauth tokens. Is this possible?

Thanks,
Dave
Hi, 

I am getting error while loading client records detail page in lightning experience for all users other than system admin. Please see error  below:

Unfortunately, there was a problem. Please try again. If the problem continues, get in touch with your administrator with the error ID shown here and any other related details. Error ID: 1601992352-71480 (-1778772804)

Nothing is showing in debug log as while loading it gets failed. Seems like internal error. 

Can some one help me ?

Regards
Amit Dubey
Hi, 

I am recieving this error, do I have to change DE? 


Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: MXVTVNHU
 
I have the following trigger which is poorly written and causing during data load and record update for certain records. I am trying to fix the query issue at list for now. But I am not expert like you guys so need help. 

Following Code trying to update but getting- Unexpected token issue. 
List <Investor_Position__c> listIvPost = [Select Id,Investor_Position_Account__c,Is_Active__c, Current_Commitments_Functional__c, Source_of_Capital__c,
                                                Investment_Vehicle__r.Id, Investment_Vehicle__r.Number_of_Current_Investors__c, Investment_Vehicle__r.Number_of_Historical_Investors__c
                                                from Investor_Position__c where Investment_Vehicle__r.Id IN  InvestmentVehicleIds];
            for(Id id : InvestmentVehicleIds)
            {
                for( Investor_Position__c obj :listIvPost )
                {
                    
                    if(obj.Is_Active__c == TRUE && obj.Source_of_Capital__c != null)
                    {



Original Code: 
trigger InvestorPositionTrigger on Investor_Position__c (after insert, after update, after delete) {

Set<Id> numofhistinvestors = new Set<Id>(); 
Set<Id> numofcurrentinvestors = new Set<Id>(); 
Set<Id> InvestmentVehicleIds = new Set<Id>(); 

List<Investment_Vehicle__c> lstUpdateInvVehicle = new List<Investment_Vehicle__c>();

if(trigger.isafter)
{
    if(trigger.isinsert || trigger.isupdate)
    {
        
            for(Investor_Position__c inv : Trigger.New)
            {
                InvestmentVehicleIds.add(inv.Investment_Vehicle__c);
            }    
    }   
     if(trigger.isdelete)
    {
        
            for(Investor_Position__c inv : Trigger.old)
            {
                InvestmentVehicleIds.add(inv.Investment_Vehicle__c);
            }    
    }       
    
            for(Id id : InvestmentVehicleIds)
            {
                for( Investor_Position__c obj : [Select Id,Investor_Position_Account__c,Is_Active__c, Current_Commitments_Functional__c, Source_of_Capital__c,
                                                Investment_Vehicle__r.Id, Investment_Vehicle__r.Number_of_Current_Investors__c, Investment_Vehicle__r.Number_of_Historical_Investors__c
                                                from Investor_Position__c where Investment_Vehicle__r.Id =:id])
                {
                    
                    if(obj.Is_Active__c == TRUE && obj.Source_of_Capital__c != null)
                    {                       
                    
                        if(obj.Current_Commitments_Functional__c > 0 && (obj.Source_of_Capital__c.contains('Limited Partners') || obj.Source_of_Capital__c.contains('Operating Partner')))
                        {
                            numofcurrentinvestors.add(obj.Investor_Position_Account__c);  
                        }
                        if(obj.Source_of_Capital__c.contains('Limited Partners') || obj.Source_of_Capital__c.contains('Operating Partner'))
                        {
                            numofhistinvestors.add(obj.Investor_Position_Account__c); 
                        }
                    }                   
                }
                
                Investment_Vehicle__c invveh = new Investment_Vehicle__c();
                invveh.Id = id;
                invveh.Number_of_Historical_Investors__c = numofhistinvestors.size();
                invveh.Number_of_Current_Investors__c = numofcurrentinvestors.size();
                
                lstUpdateInvVehicle.add(invveh);
                numofcurrentinvestors.clear();
                numofhistinvestors.clear();
            }  
            
            try
            {
                    if(lstUpdateInvVehicle.size() > 0)
                    {
                        update lstUpdateInvVehicle; 
                    }
                    
            }
            catch(exception ex)
            {
                 for (Investor_Position__c obj : trigger.new) 
            {         
                obj.addError(ex.getmessage());        
            } 
            }      
        
    
}

	if(Trigger.isInsert){
		ConfigurableRollup.rollup(trigger.new);
	}
	if(Trigger.isUpdate){
		system.debug('when is update------');
		ConfigurableRollup.rollup(trigger.new, Trigger.OldMap);
	}
	if(Trigger.isDelete){
		ConfigurableRollup.rollup(trigger.old);
	}
}

 
I need help determining the logic to use in my flow. Basically, I want to call a flow from process builder that will create new records based on the value passed in from the process builder. We have a custom obejct (transaction) and a new records is created, if the frequency of the parent object of the transaction is "Annual", I need the flow to create 11 additional records with the date for each record equal to the first day of the next 11 months. If the frequency is "Quarterly", I need the flow to create 2 additional records with date equal to the first day of the next two months. If the Frequency is "Semiannual", I need the flow to create 5 additional records with the date of each one equal to the first day of the next 5 months. 

Is this somethig flow can do? My plan was to create a counter based on the frequency and then loop until the frequency counter is reached. However, I can't seem to figure out how to loop through anything other then a Salesforce object. However in this case the objects don't exist yet. 
Hi All,

I have the below code in lightning component. I am trying to get some field values to validate in controller and I am getting null when I try to alert it. The record id alone is working.

     <aura:attribute name="recordId" type="id" />
     <aura:attribute name="record" type="Object" />
     <aura:attribute name="CaseRecord" type="Object" />
<force:recordData aura:id="record" fields="Id,Name,Responsibility_Lookup__c,Index_Lookup__c" layoutType="FULL" recordId="{!v.recordId}" targetError="{!v.recordError}" targetRecord="{!v.record}" targetFields="{!v.CaseRecord}"  mode="VIEW"/>

Controller

var getid = component.get('v.recordId');     
var rcname = component.get('v.Responsibility_Lookup__c'); 
alert("SR ID==="+getid);
alert("Resp Name==="+rcname);

I also tried var rcname = component.get('v.CaseRecord.Responsibility_Center_Lookup__c');

Still it comes as null or undefined, any suggestions on how to retrieve case field values in lightning controller ?

Thanks
Natraj
I have used only Task to display activities but i need to use wrapper class too
Hi !

I deployed 5 differents packages today.  But there is one that I cannot deploy. 
My package include 1 lightning component and 2 customs labels.
Every time I run the validation tests I got this screen:
User-added image

And when I click on view details I got this:
User-added image

Is there any way I can get more detail on the failure reason ?
I've checked all my dependencies and everything is already on the production environment....  I cannot see what is missing...

Any help will be really appreciated.

Thank you

Hi, how are you?
I'm trying to have code coverage Could you support me in determining the reason why the code is not covered?


first of all, Thanks


@isTest
public class ISSM_WSCancelarPedidos_tst {
    static testmethod void processWebService() {
        // VARIABLES
        Id RT_Emergency_id;
        Id RT_GPOrder_id;
        List<RecordType> RecordType_lst = new List<RecordType>();
RecordTypeId_id =  Schema.SObjectType.ONTAP__Order__c.getRecordTypeInfosByDeveloperName().get('Emergency').getRecordTypeId();
                Orders_lst = [SELECT Id, ONCALL__SAP_Order_Number__c, ISSM_IdEmptyBalance__c, toLabel(ONTAP__OrderStatus__c), ONCALL__Order_Created_Date_Time__c, RecordtypeId FROM ONTAP__Order__c WHERE Id =:RegistroId_id];
            
                if (Orders_lst != null  && !Orders_lst.isEmpty()) {
                    for (ONTAP__Order__c reg : Orders_lst) {
                        // Get date of datetime format
                        DateTime date_dt = reg.ONCALL__Order_Created_Date_Time__c;
                        date_dt = date.newInstance(date_dt.year(), date_dt.month(), date_dt.day());
                        
                        // Validate that the record type of the order will be "Emergency" and the status in progress
                        if ((reg.RecordtypeId == RecordTypeId_id) && (reg.ONTAP__OrderStatus__c == System.label.ISSM_OrderStatusInProgress)) {
             
                            if (date_dt == date.today()) {
                                    result_bln = ISSM_WS_CancelaPedidos_helper.UpdateStatusOrder(Orders_lst,'El pedido de emergencia fue cancelado con éxito.',System.label.ISSM_Canceled);
                                if (result_bln == true) {
                                    ApexPages.addMessage(new ApexPages.Message(ApexPages.Severity.CONFIRM, System.Label.ISSM_SuccessfulSAPOrder));
                            
                                }


The sentence that I have in the test class is as follows.

Id stExam = Schema.getGlobalDescribe().get('ONTAP__Order__c').getDescribe().getRecordTypeInfosByDeveloperName().get('Emergency').getRecordTypeId();
        RecordType_lst = [SELECT Id, Name FROM RecordType WHERE DeveloperName = 'Emergency' LIMIT 1];
        for (RecordType rt : RecordType_lst) { RT_Emergency_id = rt.Id; 
                                              ONTAP__Order__c orderEmergency = new ONTAP__Order__c();
I need to have a field on the multiline edit page of opportunity product which calculates the value of quantity multiplied by sale price. This field should have the value before the save button is clicked, That means when user enters a value in quantity and sale price it field should automatically show the value multiplied from quantity and sale Price, how I can achieve this 
I am trying to do a new validation rule on an object - Relationship.
I need to test if another active record exists for the same person record - ie. I want to stop the user create a new relationship for a person if they already have a relationship!
So - basically need a 2 filed lookup on the object Relationship - Active bit = True and Person = Current person on record user is trying to save

Can this be done???
I am trying to create a trigger that assigns a profile to a customer that will give them access to a SF community. 

Trigger
trigger Assign_Customer_Community_User on Contact (after insert, after Update) {
	set<user> usersId = new set<user>();
    set<id> contactIdsSet = new set<id>();
    
    for (contact c : trigger.new) {
        
        List<OrderAPI__Badge__c> contactBadge = [SELECT id, OrderAPI__Badge_Type__c, OrderAPI__Contact__c FROM OrderAPI__Badge__C WHERE OrderAPI__Contact__c = :c.id];
        
        for (OrderAPI__Badge__c b : contactBadge) {
            if (b.OrderAPI__Badge_Type__c == 'a0k1g000000n4vLAAQ') {
                contactIdsSet.add(c.id);
            } else {
                //do nothing
            }
        }  
    }
    
    For(User usr : [SELECT Id FROM User WHERE ContactID!=null AND ContactId IN : contactIdsSet]) {
        usersId.add(usr);
    }
    
    Assign_Customer_Community_User.AssignProfileToUser(usersId);
    
    
    
    
}

Class
public class Assign_Customer_Community_User {

    public static void assignProfileToUser(set<User> userIds) {
        list<User> updatedUserlst = new list<User>();
        profile p = [SELECT ID FROM profile WHERE name = 'Customer Community User'];
        if (userIds.size() > 0 && userIds !=null) {
            for (user u : userIds) {
                u.profileId = p.id;
                updatedUserlst.add(u);
            } 
        }
        updatedUserlst.addAll(userIds);
        
        update updatedUserlst;
    } 
}

 
Hello, I've a VF page on Case object. I've custom picklist fields for Site State and Site Region. Site state is the controlling picklist field and Site region is the dependent field. Upon creating a case on VF page and saving it, I want the Site state and Site region fields to be read-only. I've tried different ways but I'm getting this error:"The dependent picklist 'Site Region' requires its controlling field 'Site State' to be present on the page." The fields show up as picklist fields. I want them to be read-only. How do I overcome it? Please help me. Thank you!
I have 2 record types in Accounts object, I need copy since Prospect RecordType to Accounts RecordType if boath record have the same "Sap number" (Custom field) i need to copy Attachments from Prospect to Account. in my code I get ids, Developer names and list of records but  I have no Idea how I can clone the attachments from prospect and put it in account record do you have any similar code that could helps me ? or any solution to my problem.

Apex Class:

public class Set_attachments {
public static void TESTMETOD(list<Account>Accountlist){
    //obtener lista de  prospectos
    List<Account>Accountlistprospect=new List<Account>();
    //obtener lista de cuentas
    List<Account>Accountlistaccount=new List<Account>();
    //obtener Id de las cuentas 
    Set<id>AccountlistId=new Set<id>();
    //obtener numero de sap
    Set<String>AccountlistSapnumber=new Set<String>();
    //obtener Attachments
    Map<Attachment,id> MapaaccAttachment = new Map<Attachment, id>();
    // hace el recuento de cuentas 
    for(Account acc:Accountlist){
        
        //Record Type prospectos
        if((acc.RecordTypeId==Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Prospect').getRecordTypeId()) && acc.ONTAP_SAP_Number__c!=null){
            Accountlistprospect.add(acc);
            AccountlistId.add(acc.id);
            AccountlistSapnumber.add(acc.ONTAP_SAP_Number__c);
            
        }
    }
    For(Account acc:[Select id, ONTAP_SAP_Number__c from Account WHERE ONTAP_SAP_Number__c in:AccountlistSapnumber AND RecordTypeId=:Schema.SObjectType.Account.getRecordTypeInfosByDeveloperName().get('Account').getRecordTypeId()]){
        Accountlistaccount.add(acc);
    }
    For(Attachment att:[Select id,Parentid from Attachment WHERE id in:AccountlistId]){
        MapaaccAttachment.put(att, att.ParentId);
    }
    
 
        
    }
    
}

    

        
     
Hi everyone!

I'm working through the Business Administration superbadge and hit a bit of a snag. The challenge won't let me move past the reports/dashboards section citing some kind of unknown error listed below. 

Does anyone know how I can make sure to continue working through this badge. I'd hate to lose the progress I've made, so far!!

"Challenge Not yet complete... here's what's wrong: 
There was an unexpected error while verifying this challenge. Usually this is due to some pre-existing configuration or code in the challenge Org. We recommend using a new Developer Edition (DE) to check this challenge. If you're using a new DE and seeing this error, please post to the developer forums and reference error id: PYQLYUGO"