• ravi sharma 148
  • 3 Points
  • Member since 2020

  • Chatter
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
  • 8
I am new to LWC and cant seem to figure out how to open the source code for LWC. Aura can be opened in the dev console but from what i understand this is not possible with LWC.

Is it possible to open a LWC source code from within the org? I have a LWC that was developed by someone else that needs editing. How can I access the source code?
Error Message:
Challenge Not yet complete... here's what's wrong: 
The AccountTab Visualforce page does not include one or both of the following: the apex:slds tag in the page, or the slds-table value in the table.

Hello all. I am working on the new superbadge and getting stuck on Challenge 3 . I have tried several solutions but cannot get the data to display in table format. Here is my code below, my main issue is where to place the table class in realtion to the pageBlockTable.

<apex:page standardStylesheets="false" standardController="Account" recordSetVar="accounts" tabStyle="account" applyBodyTag="false">
    <apex:slds >
        <div class="slds-scope">
                    <table class="slds-table"> 
                    <apex:pageBlockTable  value="{!accounts}" var="a">
                        <apex:column headerValue="{!$ObjectType.Account.Fields.Name.Label}">
                            <apex:outputLink value="{!URLFOR($Action.Account.View, a.id)}">{!a.name}</apex:outputLink>

In Objective C, I follow the steps as outlined here and it works fine: https://developer.salesforce.com/docs/atlas.en-us.noversion.mobile_sdk.meta/mobile_sdk/ios_rest_apis_using_methods.htm?search_text=forceios

But when following the same steps translating the code into Swift, I run into an issue with the SFRestRequest initializer, whose signature is below:
Public convenience init(method: SFRestMethod, path: String, queryParams: [String : String]?)

As you can see, queryParams takes a Swift Dictionary with a key and value of the String type.  But when you follow the example, it seems you end up with a Dictionary with a key of the String type and value of the Dictionary type; and thus we have a type mismatch.

This doesn't seem to be a problem in Objective C, because upon inspection of the method signature in SFRestRequest.m, queryParams appears to be able to take a generic NSDictionary: 
+ (instancetype)requestWithMethod:(SFRestMethod)method path:(NSString *)path queryParams:(NSDictionary *)queryParams

For reference here is the Swift code I'm trying out:
//build the queryParams dictionary from a JSON String
let body: String = "{ \"body\" :{\"messageSegments\" :[{ \"type\" : \"Text\",\"text\" : \"My Comment\"}]}}"
        let queryParams = SFJsonUtils.objectFromJSONString(body) as! [String:AnyObject] 
//construct and send the request
        let request = SFRestRequest(method: SFRestMethod.POST, path: "/services/data/v36.0/connect/communities/my_community_ID/chatter/feed-elements/my_element_ID/capabilities/comments/items", queryParams: queryParams as? [String:String])
        SFRestAPI.sharedInstance().send(request, delegate: self)

But unwrapping queryParams fails and resolves to nil.  Trying to forcefully cast queryParams to [String:String] does not work either, and just causes a crash.

How might I get around this?
Anyone else having trouble connecting to the UpWork group for Salesforce.com? I've tried everything and can't get past the screen to start a dev. org. and submit my application. *sigh*
  I need to autopopulate the number datatype field after the record is deleted.
For example,
I have 5 records and their serial numbers are  1,2,3,4 and 5. If i delete the 3rd record , then the serial number of the 4th record should be automatically populated as 3 and 5th records as 4.
How to achieve this delete operation?

My Trigger Code:

trigger RecordSteps on Record__c(before insert,after delete) 
        List<Record__c> cp = new List<Record__c>(); 
        set<id> id = new set<id>();
        List <AggregateResult> requirements = new List<AggregateResult>();  
       if (Trigger.isBefore && Trigger.isInsert)
        for(Record__c pt:trigger.new)
         requirements=[select Count(Seq__c) from Record__c];
         if(requirements.size() > 0)
         for(AggregateResult ar:requirements)
         pt.Seq__c = Decimal.ValueOf(String.ValueOf(ar.get('expr0')));
      if (Trigger.isAfter&& Trigger.isDelete) 
      for(Record__c pt1:trigger.old)
I found good presentation on Aura framework (http://jessealtman.com/2013/12/introduction-to-aura/ (http://jessealtman.com/2013/12/introduction-to-aura/" target="_blank)), installed it the Aura Note sample app but still struggle how to connect the app to Salesfoce as it is done in demo. Could you provide a sample how I can use the note application with Salesforce?
- Salesforce apex class does not understand the annotation @AuraEnabled  (sample from tutorial). How to enable it for coding on SF side or to apdate SF records from note application?
public with sharing class AuraConnect {
                        public static void updateAnnualRevenue(String accountId, Decimal annualRevenue) {
                                   Account acct = [SELECT Id, Name, BillingCity FROM Account];
                                   acct.AnnualRevenue = annualRevenue;
                                   update acct;

- Should I use web services for this (get session, token and login in SF from Note app) in order to connect Aura app with SF dev organization (if yes, could you provide a sample as well)?