• Chellappa
  • NEWBIE
  • 40 Points
  • Member since 2010

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 33
    Replies
A. Use a custom controller.
B. Use a custom controller with extensions.
C. Use a standard controller with extensions.
D. Do not specify a controller.
E. Use a standard controller.
Before opening a report , I want to call Apex method from LWC JS.
In the Apex method, I want to add filters to an existing report and run Report. Come back to JS method and then invoke Navigation to the report.

This is what my assumption is :
The Navigation to report from LWC JS method will open the report in the browser with the filters i just set in the Apex Class method. I don't want to change the Report Source conditions. Please confirm if this approach is valid and possible.

If it is not possible, please tell me how i can open a report from LWC with new/Modified filter values.
Thanks.

Hi ,

 

I am finding a strange issue with the generated Apex code from the WSDL file.

 

<?xml version="1.0" encoding="UTF-8"?>

<env:Envelope xmlns:env="http://schemas.xmlsoap.org/soap/envelope/" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">

<env:Header/>

<env:Body>

<CustomerTnC_Input xmlns="http://ycrm.yahoo.com/schemas/CustomerSchema/SelfServe">

<ListOfYmitSsContact>

<Contact xmlns="http://www.siebel.com/xml/YMIT%20SS%20Contact">

<ContactSiebelId>1-94JH6X</ContactSiebelId>

<YMITSSTCTimestamp>05/05/2011 12:12:12</YMITSSTCTimestamp>

<YMITSSUserId></YMITSSUserId>

</Contact>

</ListOfYmitSsContact>

</CustomerTnC_Input>

</env:Body></env:Envelope>

 

This is the request XML generated to the WS call.. 

If you look at the highlighted portion above, it doesnt have any XMLNS attached to it. So it inherits the namespace of its parent tag.

 

But according to the WSDL it should have a namespace similar to the one below it.

 

Hence there is a validation issue with the TIBCO side and they are sending fault response.

 

In the WSDL everything seems to be properly placed. I am not able to figure out how the Namespace is missing for the highlighted element.

 

Any clue to this would be of great help.As we are at the end of development, help would be greatly appreciated.

 

i Can post the WSDL if required.

 

Thanks in advance.,

Chellappa

 

A. Use a custom controller.
B. Use a custom controller with extensions.
C. Use a standard controller with extensions.
D. Do not specify a controller.
E. Use a standard controller.
Hi I am getting this error when i call one component from another component by clicking on the button.

Comp2CompNav:

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction,lightning:isUrlAddressable" description="c:Comp2CompNav component" access="global" >
    <aura:attribute name="firstname" type="String" />
    <aura:handler name="init" value="{!this}" action="{!c.doinit}"/>
    Hello {!v.firstname}.
</aura:component>    

js: 
({
    doinit: function(cmp, evt, helper) {
        var myPageRef = cmp.get("v.pageReference");
        var firstname = myPageRef.state.c__firstname;
        console.log('Check value with new way of fetching: '+firstname);
        cmp.set("v.firstname", firstname);
    }
})


Comp2CompNav2:
From this component I am calling another Component.

<aura:component implements="force:appHostable,flexipage:availableForAllPageTypes,flexipage:availableForRecordHome,force:hasRecordId,forceCommunity:availableForAllPageTypes,force:lightningQuickAction" description="c:Comp2CompNav2 component" access="global" >
    
    <aura:attribute name="pageReference" type="Object"/>
    <aura:handler name="init" value="{!this}" action="{!c.doinit }"/>
    <lightning:navigation aura:id="navService"/>
    <lightning:button label="Navigate" onclick="{!c.handleClick}"/>
</aura:component>    


js:

({
    doinit : function(component, event, helper) {
        var pageReference = {
            type: 'standard__component',
            attributes: {
                componentName: 'c__Comp2CompNav',
            },
            state: {
                "c__firstname": "John"
            }
        };
        component.set("v.pageReference", pageReference);
     },
     handleClick: function(component, event, helper) {
        var navService = component.find("navService");
        var pageReference = component.get("v.pageReference");
       // event.preventDefault();
        navService.navigate(pageReference);
    }
})

Error Message
Hi All,
I have a dynamic table and reach row binding with inputCheckbox. onClick i am calling an Apex class methos but method is not calling. Could anyone please help and Thanking you in advance.

My Apex Page
<apex:page controller="DynamicCheckBox_Ctrl">
  <apex:form >
      <apex:pageBlock >
          <apex:pageBlockSection columns="1">
              <apex:inputText value="{!firstValue}" label="Enter Field Name"/>
              <apex:inputText value="{!secondValue}" label="Enter another Filed Name"/>
          </apex:pageBlockSection>
          <apex:pageBlockButtons location="top">
              <apex:commandButton value="Get Data" action="{!showValues}"/>
              <apex:commandButton value="Delete" onclick="if (!confirmDelete()) return false;" action="{!deleteAccount}"  />
          </apex:pageBlockButtons>
          <apex:outputPanel rendered="{!hideTable}">
              <apex:pageblockTable value="{!accList}" var="acct" >
                  <apex:column >
                    <apex:inputCheckbox onclick="storeAccoutIds({acct.id},selected)" />
                  </apex:column>
                  <apex:repeat value="{!lstFields}" var="filedName">
                      <apex:column value="{!acct[filedName]}"/>
                  </apex:repeat>
              </apex:pageblockTable>
          </apex:outputPanel>
      </apex:pageBlock>
  </apex:form>
  <script>
      function confirmDelete()
      {
        return confirm(‘Are you sure you want to delete?’);
      }
  </script>
</apex:page>

Apex Class

public class DynamicCheckBox_Ctrl {
    
    public string prepareQuery{get;set;}
    public string firstValue{get;set;}
    public string secondValue{get;set;}
    public boolean hideTable{get;set;}
    public boolean enableDelButton{get;set;}
    
    public list<Account> accList{get;set;}
    public List<String> lstFields{get;set;}
    
    //store account id, if checkbox is checkedselectedcheckbox
    public Map<String,Boolean> mapAccountId = new Map<String,Boolean>();

         
    public void storeAccoutIds(string accId, boolean isSelected)
    {
        if(isSelected)
        {
            mapAccountId.put(accId,isSelected);
            enableDelButton = true;
        }   
        
        system.debug(mapAccountId);
    }
    
       
    //Get records from datanase and send to apex page
    public void showValues()
    {
        try{

            //Add all the fileds into a list
            lstFields=new list<String>();
            lstFields.add('id');
            lstFields.add(firstValue);
            lstFields.add(secondValue);

            system.debug(lstFields);

            //Prepare dynamic query
            prepareQuery = 'SELECT id,'+firstValue+','+secondValue+' FROM Account';
            system.debug(prepareQuery);

            //Execute query
            accList = new List<Account>();
            accList = Database.query(prepareQuery);
            
            if(accList.size()>0)
            {
                hideTable=true;
            }
            system.debug(accList);

        }catch(Exception ex){
            ApexPages.Message msg = new ApexPages.Message(ApexPages.Severity.Error, ex.getMessage());
            ApexPages.addMessage(msg);         
        }
    }
public class MOperators              {
      public void main()          {

            integer x =  42       ;
            double y =  42.25  ;

     system.debug('x MOD 10 = ' + math.mod (x,10));
     system.debug('y MOD 10 = ' + math.mod (y,10));

       }

}

 
How the Javascript will be there in the HYPERLINK function. Please give an example for this. What is the solution for this.
Please share an example of HYPERLINK in which Javascript is used.
Thanks in advance
Guys we are getting multiple "Too many SOQL queries: 101" emails at the moment. We are using Classic.
We have not used any triggers just Process Builder for various functionality requirements. 
I have read on one of the ideas that this had been resolved and Process Builder is now "bulkified".
Can anyway guide me as to how we can resolve this
Would this only occur if there is a mass upload of records to the object where the Process Builder is built on?
  • August 17, 2017
  • Like
  • 0
During the Cat Rescue module when verifying the Install Einstein Vision Apex Wrappers I am getting the following error:  There was an unexpected error in your org which is preventing this assessment check from completing: System.NullPointerException: null argument for JSONGenerator.writeStringField()
Hello all,

I'm doing the "Build a Cat Rescue App That Recognizes Cat Breeds" module but I have issue with Install Einstein Vision Apex Wrappers step. Could you please help.
Thanks for your answers.

Challengre error
Hi,

I'm currently working with the "Discover Built-in XSS Protections in Force.com" Unit of Developer Advanced Trail. The point of the challenge is to edit the comments below each use of "{!sampleMergeField1}" to determine if is vulnerable to XSS. 

Based on the criteria found within the unit and in the guidelines in the Secure Coding Cross Site Scripting page for Built in Auto Encoding (All merge-fields are always auto HTML encoded provided they: do not occur within a <style> or <script> tag, AND do not occur within an apex tag with the escape='false' attribute) I came up with the following answers:
<apex:page controller="Built_In_XSS_Protections_Challenge" sidebar="false" tabStyle="Built_In_XSS_Protections_Challenge__tab">
<apex:sectionHeader title="Built-In XSS Protections Challenge" />
<apex:form >
    <apex:pageBlock >
        <c:Classic_Error />
        <apex:pageMessages />      
        <apex:pageBlockSection title="Demo" columns="1" id="tableBlock">          
            
            <apex:outputText value="{!sampleMergeField1}"/>
            <!-- sampleMergeField1 is vulnerable to XSS: NO -->


            <apex:outputText value="{!sampleMergeField2}" escape="false"/>
            <!-- sampleMergeField2 is vulnerable to XSS: YES -->


            <apex:outputText >
                {!sampleMergeField3}
            </apex:outputText>
            <!-- sampleMergeField3 is vulnerable to XSS: NO -->
       
       
            <style>
                .foo {
                    color: #{!sampleMergeField4};
                }
            </style>
            <!-- sampleMergeField4 is vulnerable to XSS: YES -->
             
            
            {!sampleMergeField5}
            <!-- sampleMergeField5 is vulnerable to XSS: NO -->
            
            
            <script>
                var x = '{!sampleMergeField6}';
            </script>
            <!-- sampleMergeField6 is vulnerable to XSS: YES -->
            
            
            <apex:outputLabel value="{!sampleMergeField7}" escape="false"/>
            <!-- sampleMergeField7 is vulnerable to XSS: YES -->
            
       
        </apex:pageBlockSection>
        <apex:pageBlockSection title="Code links" columns="1">
            <apex:outputPanel >
                <ul>
                    <li><c:codeLink type="Visualforce" namespace="security_thail" name="Built_In_XSS_Protections_Challenge" description="Visualforce Page"/></li>            
                    <li><c:codeLink type="Apex" namespace="security_thail" name="Built_In_XSS_Protections_Challenge" description="Apex Controller"/></li>
                </ul>
            </apex:outputPanel>        
        </apex:pageBlockSection>        
    </apex:pageBlock>          
</apex:form>

But everytime y check the challenge, the same message is displayed:

User-added image

I already checked that I am pointing to the right playground. 

If you can check it and help find where I am going wrong I would be thankful.

Thanks


 
I have linked my lightning component with Quick action button,
but width of that pop-up has fixed width, my requirement is I want full screen to be acquire by that component.
through mew window or new tab,
How should I achieve this
I am implementing an EmailService. I would like to store the emails I receive as an EmailMessage that would show up on the ActvityHistory for a record like Contact or Account. To do that I wrote the following code (treat it as pseudo code) : 

Task emailTask = new Task (
            ActivityDate  = Date.today(),
            Description   = results.getEmailBodyAsText(),
            // IsArchived    = False, -- This is not writable
            IsRecurrence  = False,
            IsReminderSet = False,
            OwnerId       = results.getPrimaryUser().Id,
            Priority      = 'High',
            Status        = 'Open', // Revisit this - We should check if an email requires response
            Subject       =    results.getSubject(),
            TaskSubType   = 'Email',
            WhoId         =  results.getPrimaryContact().Id
        );


        insert emailTask; // This will provide an Id
        // Notes: Salesforce Requires a Task be Present to associate
        // with it an EmailMessage. Email Message provides a cleaner
        // looking inteface for Emails
        EmailMessage emailMessage = new EmailMessage(
            ActivityId  = emailTask.Id,
            FromAddress = ((Contact)results.getSender()).Email,
            FromName    = ((Contact)results.getSender()).Name,
            Incoming    = False,
            MessageDate = Date.today(),
            Subject     = results.getSubject()
        );
        insert emailMessage;

Where "results" is an object that is created from parsing the Inbound Email (Some decoupling from that Object).  When I do this I get the following error - 
Line: 42, Column: 1
System.DmlException: Insert failed. First exception on row 0; first error: INSUFFICIENT_ACCESS_OR_READONLY, You cannot edit this field: [ActivityId]

Based on the document on EmailMessage it appears that ActivityId is the Id of the task that the email replaces in the ActivityHistory. I would like to use the EmailMessage object because it looks much cleaner than a Task that is of an Email SubType. Any ideas how to get this to really work?
Hi,

I am stuck at the Create and Train the Dataset step on the Build a Cat Rescue App That Recognizes Cat Breeds Trailhead module.

I have successfully created the lightning component, uploaded the zip file and clicked on the train button but when I try to Verifiy I get the following error message:
"Challenge Not yet complete... here's what's wrong: 
Could not find a successful cat dataset training. The training may take a couple of minutes after the model is created."

Could you please advise ?

Thanks for your help.
Hi,
when i click an action button on my account detail page it should redirect to a URL and close the action modal page. But the problem is the modal page is still there. Only redirection is happening.

this is my controller code,
({
    myAction : function(component, event, helper) {
        var recordId = component.get("v.recordId");
        var urlEvent = $A.get("e.force:navigateToURL");
        urlEvent.setParams({
            "url": "http://google.com&SalesforceRecordId="+recordId
        });
        urlEvent.fire();
        var dismissActionPanel = $A.get("e.force:closeQuickAction");
        dismissActionPanel.fire();
    }
})

I used 'closequickaction' method to close the modal window. But it is not working. Any idea..?

Thanks in advance..

Regards,
Vivek
All, I am a bit stuck to complete the challenge of the Apply Service Layer Principles in Apex trail.
I have created what has been requested and tested it successfully but I keep getting the following error: 

Challenge Not yet complete... here's what's wrong: 
The Apex service does not appear to be closing cases correctly with the specified reason.

Any idea on how to debug and findout what is wrong?

Below you can see my code:

Class CaseService:

public class CaseService 
{
    public static void closeCases(Set<ID> cases, String closeReason)
    {
        System.debug('SKA - ' + cases);
        System.debug('SKA - ' + closeReason);
        List<Case> caseToUpdate = new List<Case>();
        for (Id caseId : cases)
        {
            Case c = new Case(Id = caseId);
            c.Reason = closeReason;
            c.Status = 'Closed'; 
            
            caseToUpdate.add(c);
        }
     
        update caseToUpdate;
        
    }
}

Class CaseCloseResource:

@RestResource(urlMapping='/case/*/close')
global class CaseCloseResource 
{
    @httpPost
    global static void closeCase(String closeReason)
    {
        System.debug('SKA - HTTPPOST - ' + closeReason + ' - ' + RestContext.request.requestURI);
         // Parse context
        RestRequest req = RestContext.request;
        String[] uriParts = req.requestURI.split('/');
        Id caseId = uriParts[2];
        // Call the service
        CaseService.closeCases(new Set<ID> { caseId }, closeReason);  
        
    }
}
 
Hi Folks,

I need to get the attachments from EmailMessage. Is there any way to get it ? EmailMessage object has a property called hasattachments but how to get attachments and its body ?

Regards,
Ajay
I have created a table to house basic information for putting into an email (subject, intro etc). I will call this EMAIL. I have created a child table to house the content for emails, so each EMAIL object can have one or more CONTENT objects.
I have created a many-many relationship between CONTACT and EMAIL via another table called LINK.
I have two email templates. One is 'Custom' and as follows. This works fine, when I trigger it (by adding a LINK object),  I get an email send to my Contact with both the expected merge fields filled in.
Dear {!CONTACT.FirstName}, Intro: {!EMAIL__c.Introduction__c}
However, I have a second template created using Visualforce (below). If I switch my email alert to use it instead, then perform the same action to get the email to be sent to a Contact, neither the Contact's Name or the EMAIL Introduction is merged in! Also note that, if I use this template and 'Send Test and Verify Merge Fields', entering my Contact and EMAIL ID causes the merge from both objects to work perfectly! Can anyone offer any advice?
Thanks
<messaging:emailTemplate recipientType="Contact"
    relatedToType="Queued_Email__c"
    subject="ed test 3">
    <messaging:htmlEmailBody >
        <html>
            <body>
            <p>Dear {!recipient.name},</p>
            <p>{!relatedTo.Introduction__c}</p>
            </body>
        </html>
    </messaging:htmlEmailBody>
</messaging:emailTemplate>
 
In flow design pilot I need to concatenate a Custom City, Custom State Custom Zip and Custom County into a custom field.  It would be formula like:
City__c & ", " & State__c & " " &  Zip_Code__c & " " &   County__c

Hi,

 

I am investigating the differences between SFDC "Send an Email" and "Compose Gmail". What are the avantages and disadvatages? 

 

Thanks,

SC

Hi

 

I tried to make the visualforce page renderas PDF in landscape with following styles

 

<style >
    @page {
        size:landscape;
   }
 </style>
 

 

But it is not working now. Is anybody face the same issue? or have any idea to render the PDF as landscape??

 

Thanks!

  • August 18, 2009
  • Like
  • 0