• Jayant Kumar Jaiswal
  • 0 Points
  • Member since 2014

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 6
  • 9
On click of OK in showNotice, I want the whole Lightning component configured in quick action to close. I'm using below code:
                "variant": "error",
                "header": "Create QIF",
                "message": validationMessageString,
                closeCallback: function() {
                alert('You closed the alert!');
Is is possible this way?
I have to simply call a lightning component from a VisualForce Page. Later this VF page is configured as a list button in Opportunity.
VF Page::
<apex:page standardController="Opportunity" recordSetVar="opp"  tabStyle="Opportunity"> 
<apex:includeLightning />
    //    var recordid = "{!$CurrentPage.parameters.id}";    
         $Lightning.use("c:LightningOutContainerApp", function() {
         oppRecordId : "0069000000x6KWSAA2" 
         function(cmp) {
         console.log('Component created, do something cool here');
Lightning App:
<aura:application access="GLOBAL" extends="ltng:outApp">
 	<aura:dependency resource="c:RelatedListNewRecordPOC"/>	

<aura:component controller="RelatedListNewRecordPOCController" implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,forceCommunity:availableForAllPageTypes" access="global" >
    <aura:attribute name="oppRecordId" type="String"/>
    <aura:handler name="init" value="{!this}" action="{!c.doInit}"/>

JS Controller:

    doInit: function(component, event, helper) {
        var myRecordId = "0069000000x6KWSAA2";//component.get("v.recordId");
        var getParameters = component.get('c.getParameters');
            "myRecordId": myRecordId

        getParameters.setCallback(this, function(response) {
            var state = response.getState();
            if (state === "SUCCESS") {
                var Opportunity = response.getReturnValue();               
                var createAcountContactEvent = $A.get("e.force:createRecord");
                    "entityApiName": "Opportunity",
                    "RecordTypeId": Opportunity.RecordTypeId,
                    "defaultFieldValues": {
                        'AccountId': Opportunity.AccountId,
                        'Name': Opportunity.Name,

            } else {
                var closeAction = $A.get("e.force:closeQuickAction");

Apex Controller:
public class RelatedListNewRecordPOCController {
    public static Opportunity getParameters(Id myRecordId){
        return [SELECT Id, AccountId, RecordTypeId, Name, Description, StageName, Amount
                , TotalOpportunityQuantity, CloseDate, Type, LeadSource, IsClosed FROM Opportunity WHERE Id =: myRecordId ];    }
Here I'm getting an error while calling the getParameters() function from LC only when from VF page which is configured in list button.
If I run the LC from actions, it is working.
Error:  $A.getCallback() [Unable to get property 'setParams' of undefined or null reference] Callback failed: apex://RelatedListNewRecordPOCController/ACTION$getParameters
Can anyone please help. As per requirement I have to configure it in list button and I'm not able to dibug this.
Hi All,

We are transitioning from classic to lightning and we are using a lot of URL hacks to pre populate standard page fields from List buttons.
Is there any other solution except creating actions, where we can re-use the existing URL hacks somehow?

Thanks in advance
We have a existing system which is exposing SOAP over JMS. Can we consume those API's from Apex?
I worked on SOAP over https/http in salesforce but not on SOAP over JMS.

How different is it to implement?
I'm exposing and consuming HTTP GET API both within Salesforce. I want to know if we can pass a request body along with the request in GET method?
Currently I'm getting exception when i include a body in request. 
I'm recieving the a JSON string in API response which is containing /n and / in between.
{\n  \"Return Code\" : \"Ok\",\n  \"Return Mess\" : \"No Error\",\n  \"Time Zone\" : \"SA\",\n  \"FNN Line Type Potent\" : \"AB\",\n  \"Number Of FNNs Returned\" : 5,\n  \"FNNs\" : [ {\n    \"fnnExt\" : \"122525\",\n    \"fnnNode\" : \"Node 1\",\n    \"technology\" : \"S\",\n    \"lastUsed\" : \"2017-04-25\",\n    \"workingStatusCode\" : \"R\",\n    \"remarks\" : \"No Remarks\",\n    \"disconnectReason\" : \"TD\",\n    \"quarantineDate\" : \"2017-06-05\",\n    \"quarantineIndicator\" : \"Y\"\n  }, {\n    \"fnnExt\" : \"225632\",\n    \"fnnNode\" : \"Node 2\",\n    \"technology\" : \"S\",\n    \"lastUsed\" : \"2017-08-04\",\n    \"workingStatusCode\" : \"R\",\n    \"remarks\" : \"No Remarks\",\n    \"disconnectReason\" : \"TD\",\n    \"quarantineDate\" : \"2017-08-02\",\n    \"quarantineIndicator\" : \"Y\"\n  }, {\n    \"fnnExt\" : \"552365\",\n    \"fnnNode\" : \"Node 3\",\n    \"technology\" : \"S\",\n    \"lastUsed\" : \"2017-07-06\",\n    \"workingStatusCode\" : \"R\",\n    \"remarks\" : \"No Remarks\",\n    \"disconnectReason\" : \"TD\",\n    \"quarantineDate\" : \"2017-02-26\",\n    \"quarantineIndicator\" : \"Y\"\n  }, {\n    \"fnnExt\" : \"225417\",\n    \"fnnNode\" : \"Node 4\",\n    \"technology\" : \"S\",\n    \"lastUsed\" : \"2017-01-05\",\n    \"workingStatusCode\" : \"R\",\n    \"remarks\" : \"No Remarks\",\n    \"disconnectReason\" : \"DD\",\n    \"quarantineDate\" : \"2017-02-10\",\n    \"quarantineIndicator\" : \"Y\"\n  }, {\n    \"fnnExt\" : \"441256\",\n    \"fnnNode\" : \"Node 5\",\n    \"technology\" : \"S\",\n    \"lastUsed\" : \"2017-04-02\",\n    \"workingStatusCode\" : \"R\",\n    \"remarks\" : \"No Remarks\",\n    \"disconnectReason\" : \"DD\",\n    \"quarantineDate\" : \"2017-06-04\",\n    \"quarantineIndicator\" : \"Y\"\n  } ]\n}

I am only using the Array part of JSON and i have a wrapper class for it as well.
I'm using below code to convert this Json Array to list of wrapper class.

 while (parser.nextToken() != null) {
            if (parser.getCurrentToken() == JSONToken.START_ARRAY) {
                while (parser.nextToken() != null) {
                    if (parser.getCurrentToken() == JSONToken.START_OBJECT) {
                        FNN fnnRecord = (FNN)parser.readValueAs(FNN.class);
                        String s = JSON.serialize(fnnRecord);
                        system.debug('Serialized -----> ' + s);
                        // Skip the child start array and start object markers.

Now this peace of code works very well for if the JSON string doesn't contain /n and /. But since my response contains these characters the code is breaking.
Any solutions please.

An after trigger on the account object performs a DML update operation on all of the child opportunities of an account. There are no active triggers on the opportunity object, yet a "maximum trigger depth exceeded" error occurs in certain situation.Which two reasons possibly explain the account trigger firing recursively?choose 2 answers

A. Changes are being made to the account during criteria based sharing evaluation
B. Changes are being made to the account during an unrelated parallel save operation
C. Changes to opportunities are causing cross-object workflow field updates to be made on the account
D. Changes to opportunities are causing roll-up summary fields to update on the account
We have a existing system which is exposing SOAP over JMS. Can we consume those API's from Apex?
I worked on SOAP over https/http in salesforce but not on SOAP over JMS.

How different is it to implement?
When we click on visualforce page tab in lightning app how to display the loading spinner
I am new to Visualforce and am struggling with something that should be easy. I am creating a complete custom page for a Community landing page. This is replacing an older page that was used on an existing customer portal page being phased out. I basically want a VisualForce page that has multiple tabs. Now the tabs are already created under Create/Tabs referencing their own VF pages. What I can't seem to figure out is how to call these tabs into the tabPanel/tab tags.

So I would expect to do something like this-
<tab name=customtabalreadycreated1></tab>
<tab name=customtabalreadycreated2></tab>

I can just as easily just copy and paste the code from the VF pages for each tab into the new page but then the code is very long and not very readable. Is this my only option or is there some way to reference the custom tabs in the tab panel of the new VF page?

In my test class I insert new products and pricebookentries, in my test class I don't use seeAllDate=true annotation and in order to retrieve standard pricebook id I used Test.getStandardPricebookId() method, here's my code:
Product2 p1 = new Product2(Name='Product Monthly 1111', Family='Monthly', isActive=true, CurrencyIsoCode='USD');
Product2 p2 = new Product2(Name='Product Yearly 2222', Family='Yearly', isActive=true, CurrencyIsoCode='USD');

insert new List<Product2>{p1, p2};

Id pricebookId = Test.getStandardPricebookId();

PricebookEntry pbe1 = new PricebookEntry(Pricebook2id=pricebookId, Product2id=p1.ID, isActive=true, CurrencyIsoCode='USD', unitPrice=100);
PricebookEntry pbe2 = new PricebookEntry(Pricebook2id=pricebookId, Product2id=p2.ID, isActive=true, CurrencyIsoCode='USD', unitPrice=50);

insert pbe1;
insert pbe2;

List<PricebookEntry> pbes = [SELECT ID FROM PricebookEntry 
    WHERE Product2id IN (:p1.Id, :p2.Id) AND Pricebook2.isStandard = TRUE AND Pricebook2.isActive = TRUE AND CurrencyIsoCode = 'USD' AND isActive = TRUE];

System.assertEquals(2, pbes.size());

pbes.size() returns 0. I used the same query in console for existing data and I got results. What am I doing wrong?
I have pretty simple code which was working on an older sandbox, when i migrate to a new one, nothing happens when i click on other tabs.

<apex:page standardcontroller="Opportunity" extensions="ExtendedSalesProcess">

      .activeTab {background-color: #236FBD; color:white; 
      .inactiveTab { background-color: lightgrey; color:black; 
   <apex:tabPanel switchType="set" selectedTab="tabdetails" 
                  id="AccountTabPanel" tabClass="activeTab" 
      <apex:tab label="Solution Mapping" name="AccDetails1" id="tabdetails1">
      <apex:include pageName="OpportunityDealSummary"/>
      <apex:tab label="Tech Plan" name="AccDetails2" id="tabdetails2">
      <apex:include pageName="OpportunitySE"/>
       <apex:tab label="Lead" name="LeadDetails3" id="tabdetails3">
       <apex:include pageName="OpportunityLead" rendered="true"/> 
      <apex:tab label="Competitor Intelligence" name="AccDetails4" id="tabdetails4">
      <apex:include pageName="OpportunityCompetitor"/>

      <apex:tab label="Notes and Attachments" 
                name="NotesAndAttachments" id="tabNoteAtt">
         <apex:relatedList subject="{!opportunity}" 
                           list="CombinedAttachments" />
Hi All,

   How to use datepicker on visualforcepage ?
   I tried different codes avialble on internet but it is either not showing calendar else gives error while saving page itself i.e.  "Error: Component <apex:input> in '/apex/samplePage' requires HTML docType version 5.0 or higher in samplePage at line 16 column 82"
  I want to run it on my current settings.

Can anyone please help me ?

Tried code : 
1) public Date datename { get; set; }

    <apex:input label="datePicker" value="{! datename }" type="auto"/>

2) public String datename { get; set; }

    Date: <apex:inputText value="{!datename}" size="10" id="demo"    onfocus="DatePicker.pickDate(false, this , false);" />