• Priya Govindasamy
  • NEWBIE
  • 40 Points
  • Member since 2014

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
    Questions
  • 16
    Replies
Hello!

I would like to add a condition to my controller so that only records that match a certain field value will be evalueted... but I can not get the syntax correct.  Here is what I currently have: 
 
[Select id, name, Call_Volume_This_Week__c, Spend_Last_Week__c, Week_to_Date_SpendFRM__c, Record_Scope__c from Buyer_Performance__c]

And I would like it to function as: 

[Select id, name, Call_Volume_This_Week__c, Spend_Last_Week__c, Week_to_Date_SpendFRM__c, Record_Scope__c from Buyer_Performance__c WHERE Record_Scope__c = "YES"]

How would I properly execute this?

Thanks, 

John
Can I do a soql on existing custom metadata and update the record in apex class?  When I try that it says list cannot be updated.
I have a lightning datatable with checkbox. I want to preselect checkbox on load/refresh of the component. I was able to set selectedRows with id. Console log shows before and after the ids are set. However on UI the checbox does not appear. How can I show the checkbox with the checked mark?

some thing like this - 

var idVal = ['a013D000003R0EQQA0'];
component.set("v.selectedRows", idVal);
console.log( ' Before ', component.get("v.selectedRows") );
        component.set("v.selectedRows", idVal);
        console.log( ' After ', component.get("v.selectedRows") );
Hi,

There is an old external integration in my org. At the time of development .net team used enterprise wsdl and its service link . Now we want to do some testing in dev environment. There is no change in the object on which the create method is used.
Question 1: Can they continue to use the old wsdl service link for dev testing. Will it work in production as I see the current enterprise wsdl has new version.
Question 2: How to get the wsdl file from the old service link that was used before? because I can only get the latest wsdl from generate from enterprise link. I want see the old wsdl file from the old serive link. 

Thanks,
Priya
Hi,

An external system is connecting to Salesforce using SOAP enterprise wsdl and uses create method to insert a record. I have enabled debug log but it does not show any information on record created. I can see the  login history. How to capture the log of record created.

Thanks,
Priya
We have updated to TLS 1.1 in our .Net Integration to salesforce and has tested it out in Sandbox. Now can we move the update to PROD before March 2017. Will teh updraded framework work fine in PROD before the due date? Has anyone done the changes in PROD already?
I am creating a datepicker and want to create a picklist value with time slot.s. When a timeslot is chosen for a particular date next person creating a record for the same date should not see the already chosen time slot in picklist.
Hi All, 

I know there are ways to do what I'm outlining here, but the ones that I know are kind of ugly and involve double for-loops and the like. I'm trying to streamline this code a little, so I'm looking for a more efficient method.  

Desired Functionality:
Taking a SOQL query of a custom metadata object, returning 2 text fields, and comparing this to a list of objects.  If value1 == the object parameter we're looking for, then replace it with  value2.  

Current Code:

(This is currently in the process of being revised, so it currently does not work, and has been 'scrubbed of actual data, so if some syntax is off, it is not the cause of my issue)
List<custObj__c> relatedList = [Select oldValue from custObj__c];

if(relatedList.size() > 0){
         
         //******This is not correct, and does not work*****       
         Map<String, String> z = new Map<String, String>([SELECT value1__c, value2__c FROM X__mdt WHERE isActive__c=True]);     
//*********//
                              
         if(z != null) {
             for(custObject__c related : relatedList){ 
                  if(z.contains(related.oldValue)){
                        related.oldValue = z.get(related.oldValue);                          
                  }
             }
         }
         Database.update(relatedList, true);
}

So the question is: Is there a way to create a Map to use in the manner I'm trying to above that would not involve creating another for-loop to populate it?
trigger populateContactEmail on Case (before insert , before update){
    Set<Id> setConIds = new Set<Id>();

    for(Case  obj : trigger.new){
        if(obj.Secondary_Contact__c != null)
            setConIds.add(obj.Secondary_Contact__c);
    }

    Map<Id , Contact> mapCon = new Map<Id , Contact>([Select Id, Email from Contact where id in: setConIds]);
    for(Case obj : trigger.new)
    {
        if(obj.Secondary_Contact__c != null)
        {
            //Protecting against bad Ids
            if ( mapCon.containsKey(obj.Secondary_Contact__c)) {
                Contact c = mapCon.get(obj.Secondary_Contact__c);
                obj.Secondary_Contact_Email__c = c.Email;
            }
        }
    }
}

 
Can I do a soql on existing custom metadata and update the record in apex class?  When I try that it says list cannot be updated.
how render will work in LWC? it will render specific component or entire template?

Can i use render in lwc as follows
 
<lightning-button class="slds-button" variant="neutral" render={checkFlag}>Escalate to AMS</lightning-button>

 
I have a lightning datatable with checkbox. I want to preselect checkbox on load/refresh of the component. I was able to set selectedRows with id. Console log shows before and after the ids are set. However on UI the checbox does not appear. How can I show the checkbox with the checked mark?

some thing like this - 

var idVal = ['a013D000003R0EQQA0'];
component.set("v.selectedRows", idVal);
console.log( ' Before ', component.get("v.selectedRows") );
        component.set("v.selectedRows", idVal);
        console.log( ' After ', component.get("v.selectedRows") );
Hi,
I am updating the datatable rows in lightning by selecting the selectedRows() .
when I am reloading the datatable the check box, SELECTION is still checked.
How do I get the selection to be false.
Thanks 

Hello All!

I have created an integration that pulls Salesforce data from a client's organization and uses it for an on-premise solution. With TLS 1.0 support being decprecated, I wanted to verify whether my solution will require any adjustments to continue functioning moving forward.

I have already run a test and was able to connect to the tls1test.salesforce.com server farm without error, therefore I was curious whether there are any further tests that can be performed to validate the integration.

On a semi-related note: the client's organization has signed-certificates that are expiring within the next 60-days. If I log in and update the signed certificates through Salesforce, can this cause any issues with integrations or site functionality?

Thank you very much for your help!

Brandon

 

 

 

Hi, 

  I wrote a trigger on a custom object which will conterts data into Account Opportunity and Opportunity Products 

  It is converting into account and opportunity but not able to add products into opportunity product 

  String SOQLCloudProduct = deal.AP_Product__c; //Product Name
  CloudProduct = [SELECT ID FROM Product2 where name = :SOQLCloudProduct limit 1 ].ID; // To get Product ID 

   Above SOQL is not working please suggest me how to fix 

Complete trigger is 
 
trigger DealReg_To_Opportunity on DealReg__c (After Insert)
{
 // asyncApex.processOpportunity(Trigger.newMap.keySet());
 
     Set<Id> idSet = Trigger.newMap.keySet();

    Account acc = new Account();
    Opportunity opp = new opportunity();     
    List<OpportunityLineItem> oliList  = new List<OpportunityLineItem>();
    String Don = '00560000003W8gx';
    String Roger = '00560000004HPy1';
    String OppOwner;
    
    
  DealReg__c deal = [SELECT id, customer_name__c, deal_stage__c,
                            account_id__c, estimated_close_date__c,
                            estimated_value__c, competitor__c,
                            account__c, project_name__c,
                            distributor__c, reseller__c,
                            channel_source__c, discount_program__c,
                            ownerid, status__c, owner.type,
                            field_representative__c, theater__c,
                            Partner_Initiated__c,Partner_Led__c,K_12__c,Industry__c,Company_Url__c,Cloud_Deal_Registration__c,Product_Quantity__c,
                            Cloud_Product__c,Cloud_Service_Term__c,Cloud_Subscription_Term__c,
                            AP_Product__c,Service_Term__c,Subscription_Term__c
                        FROM DealReg__c
                        WHERE id = :idSet ];
 
 
 System.debug(LoggingLevel.INFO,'Start Testing my trigger');
  
 
  
  String Distributor;   
  String Region = deal.theater__c;
  
  /* Assign Opportunity owner */
  
  if ( Region == 'NAM') 
  {
     OppOwner  = '00560000004HPy1';
   }
  else if ( Region == 'EMEA')
  {   
     OppOwner = '00560000003W8gx';
   }
     
  
  /* Assign distributor */
  if ( deal.AP_Product__c <> NULL && deal.Service_Term__c <> NULL )                 
   {
   Distributor =  deal.distributor__c ;    
   }                     
  else if ( deal.Subscription_Term__c <> NULL && deal.theater__c == 'NAM'  ) 
   {
    Distributor = '0016000000pyLll'; // defaulting to westcon
   }
  else if ( deal.Subscription_Term__c <> NULL && deal.theater__c == 'EMEA'  )
   { 
   Distributor = '0016000000YmDkh'; //defaulting to zyko
   }

  System.debug(LoggingLevel.INFO,Distributor );

  If ( deal.Cloud_Deal_Registration__c == 'Yes') 
   {                        
  acc.name = Deal.customer_name__c;
  acc.Industry = Deal.Industry__c;
  acc.Website = Deal.Company_Url__c;
  acc.Type = 'Prospect';
                  
  Insert acc;                      
   
        opp.AccountId = acc.id;                     
        opp.name = Deal.project_name__c +  ' ' +'FOR'+' '+deal.customer_name__c;    
        opp.OwnerId = '00560000004HPy1';
        opp.discount_program__c = 'DEALREG/PI/PL';
        opp.Abbv_Discount_Program__c =  'DR/PI/PL';  
        opp.StageName = Deal.deal_stage__c;
        opp.CloseDate = Deal.estimated_close_date__c;   
        opp.Primary_Competitor__c = deal.competitor__c;
        opp.type = 'Existing Customer';
        opp.Government_Contract__c = 'None';
        opp.leadsource = 'Deal Registration';
        opp.Partner_Driven__c = 'yes';
        opp.Partner_Account__c = Distributor;
        opp.primary_distributor__c = Distributor;
        opp.primary_reseller__c = deal.reseller__c;
        opp.channel_source__c = deal.channel_source__c;
        opp.K_12__c  = deal.K_12__c;
        opp.Renewal_Opportunity__c = 'No';
        opp.Renewal_Incumbant_Reseller__c = 'No';
        opp.Renewal_K_12__c = 'No';    
        opp.DEALREG_SEND_QUOTE__c = 'Do Not Send';
        opp.RENEWAL_SEND_QUOTE__c = 'Do Not Send';  
        opp.Partner_Driven__c  = 'Yes';
        opp.Partner_Led__c = 'Yes';     
        opp.deal_registration__c = deal.id; 
        opp.Partner_Initiated_International__c = 'No';                      
   
   insert opp; 
   
    
    String priceBookName = 'Standard'; 
    String SOQLCloudProduct = deal.AP_Product__c;
	String SOQLCloudServiceTerm = deal.Service_Term__c;
	String SOQLCloudSubscription = deal.Subscription_Term__c; 
    String CloudProduct;
    String CloudServiceTerm;
    String CloudSubscription;
    
    if ( SOQLCloudProduct <> NULL )
    {
    CloudProduct = [SELECT ID FROM Product2 where name = :SOQLCloudProduct limit 1 ].ID;
    system.debug(CloudProduct);
    }   
    
    if ( SOQLCloudServiceTerm <> NULL ) 
    {
    CloudServiceTerm = [SELECT ID FROM Product2 where name = :SOQLCloudServiceTerm limit 1 ].ID;
    system.debug(CloudServiceTerm);
    }
    
    if ( CloudSubscription <> NULL ) 
    {
    
    CloudSubscription = [SELECT ID FROM Product2 where name = :SOQLCloudSubscription limit 1 ].ID;
    system.debug(CloudSubscription);
    }
    
    String CloudPricebookId;
    
    
    IF ( Region == 'NAM') 
    {
      CloudPricebookId = '01s60000000AKxZAAW';
    }
    ELSE IF ( Region == 'EMEA') 
    {
      CloudPricebookId = '01s60000000AKxUAAW';
    }  
      
    List<PricebookEntry>  pbeList  = new List<PricebookEntry>();
    
       
     pbeList = [Select ProductCode, UnitPrice, Product2Id, priceBook2Id From PricebookEntry 
                          where ( Product2Id = :CloudProduct or  Product2Id = :CloudServiceTerm or Product2Id = :CloudSubscription )
                                and priceBook2Id  = :CloudPricebookId];   
     
      system.debug(pbeList);
      
    for(PricebookEntry pbe: pbeList){
         OpportunityLineItem oli = new OpportunityLineItem();
        oli.OpportunityId = opp.id; 
        //oppprod.Product2 = pbe.Product2Id;
        //oppprod.ProductCode = pbe.Product2.ProductCode;
        oli.PricebookEntryId = pbe.id; 
        oli.Quantity = deal.Product_Quantity__c; 
        oli.UnitPrice = pbe.UnitPrice;
        oliList.add(oli);
      }  

   insert oliList;
   }
}

Thanks
Sudhir

 
Hi All,

I have a requiremnt where I have 3 custom objects - P__c, T__c, Ts__c.

1. Ts__c has a lookup to P__c.
2. Ts__c has a lookup to T__c.
3. T__c has a lookup to P__c.

Now when I will create record in Ts__c i can see lookup to P__c and T__c.
1. Ts__c is a related list in P__c.
2. T__c is a related list in P__c.
3. Ts__c is a related list in T__c.

I want when i will create a record in Ts__c(related list to T__c) , P__c lookup should get disabled.

Please let me know how to approach this scneario.

Regards
How to prevent Trigger to be fired after workflow field update? Any suggestions on this?
I have a test class where I am trying to cover code on an update trigger when the Effective Date or Stage is changed. However, when I run the test, none of the Opportunity data gets changed. Do I have the proper syntax in my test to test for a change to the Opportunity?
 
static testmethod void testAcctData(){

    Account acct5 = TestCreateRecords.createAcct(0);
    insert acct5;

    Opportunity opp1 = TestCreateRecords.createOppNew(acct5.Id);
    insert opp1;

Test.startTest();
    Opportunity opp1a = [SELECT Id,Effective_Date__c,StageName
                        FROM Opportunity
                        WHERE Id =: opp1.Id];
        opp1a.Effective_Date__c = Date.TODAY().addDays(5);
        opp1a.StageName = 'Phase 5: Closed Won';
        UPDATE opp1a;

Test.stopTest();
}

 
Hello!

I would like to add a condition to my controller so that only records that match a certain field value will be evalueted... but I can not get the syntax correct.  Here is what I currently have: 
 
[Select id, name, Call_Volume_This_Week__c, Spend_Last_Week__c, Week_to_Date_SpendFRM__c, Record_Scope__c from Buyer_Performance__c]

And I would like it to function as: 

[Select id, name, Call_Volume_This_Week__c, Spend_Last_Week__c, Week_to_Date_SpendFRM__c, Record_Scope__c from Buyer_Performance__c WHERE Record_Scope__c = "YES"]

How would I properly execute this?

Thanks, 

John
Hello!

I have created a pageBlockTable, but my column names disappear when I apply the "rendered" tag.  Is there a way that I can statically set the column names so that my table has headers?
 
<apex:pageBlock title="Underfunded Buyers">
    <apex:pageBlockTable value="{!listOfBuyer}" var="by">
            <apex:column value="{!by.Name}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>
            <apex:column value="{!by.Spend_Last_Week__c}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>
            <apex:column value="{!by.Total_Spend_this_Week__c}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>
            <apex:column value="{!by.Forecasted_Spend__c}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>
            <apex:column value="{!by.Current_Balance__c}" rendered="{! by.Funding_Status__c = 'Funds Needed'}"/>
             </apex:pageBlockTable>
            </apex:pageBlock>

Thanks!

John