• Diksha Goel 6
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 14
    Replies
In Lightning components, one would typically collect a set of new records and save them all in a single server transaction. I'm working in Visual Workflows now, and I've gathered a whole group of object records, but it appears I have to loop and create the records one at a time. Am I wrong? This seems like a feature that would be quite practical.

Thanks.
Hi,
Can we fire Workflow Rule or Process builder on change in formula field..?
Hi,

I have a requirement to change the owner on a WorkOrder from a list view. There doesn't appear to be a standard behaviour for this. I can create a quick action, or use the change owner on the record itself, but we need to do this from the list view.
Does anyone know how you can call a user look up from a custom button?

Thanks
I'm trying to replicate a custom button I had that would launch a report and immediately bring up the dialogue box to save the report.

I used this code to make that happen:
window.open('/00O63000000HEhL?pv0={!Batch__c.Id}&export=1')

I have read all of the documentation and am trying to get the following to work:
{!URLFOR( $Action.Report.ReportExportAction , "00O63000000HEhL", [ fv0=Batch__c.Id ])}

Anybody know what I am doing wrong here?  It will launch the report but will not apply my parameters and will not export it.


 
Below is the URL the Web Application use to authenticate with Salesforce and get the Auth Code for further API calls.
https://login.salesforce.com/services/oauth2/authorize?response_type=code&client_id=
<client_id>&redirect_uri=<callback_uri>&state=<state>

To get the client Id we need to create a Connected App in Salesforce and use the details to connect to Salesforce. This is clear.

But, how does the applications like Aside.io, Workbench etc., connect to any salesforce Org? What client Id these applications pass to different salesforce orgs for authentication? Can anyone explain it?


 
 
  • July 19, 2017
  • Like
  • 0
Hi,
We have 6 fields in Opportunity Team( 2 custom and 4 standard).We use lightning.So Opportunity Team comes as a related list on the right side and once you click on View all, it shows the list of all team members with only 3 fields Member name, Role and title (which is not part of my list of fields)showing on screen.I want to show  all 6 fields in a particular order .I tried reordering using Opportunity>PageLayout >RelatedList>Opportunity Team>Properties.This works in Classic view but not in lightning.
Thanks in advance for any help!
-Nisha
Hi ALL,

Can any body know how can we use chatter in field service lightning.
Hi everyone

Anyone know why I can¿t query the field "MiddleName" of the Account object? The API version of my Apex class is 33.0

I'm getting the error:
No such column 'MiddleName' on entity 'Account'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name.

I've enabled the options:
Enable Middle Names for Person Names and Enable Name Suffixes for Person Names

Regards
Hi,

I am new to Salesforce Reporting. I create two reports- one on Custom Object (Parent Object) and other on Custom Child Object (Parent object look up is applied). I want to create Dashboards which allows filter on Parent Object where User can select Parent element.

Example 

Company Object (Custom Object)  has 3 records  - 
1 - IBM
2- Google
3 - Apple

And each above company has deals records with fields Deal name, Deal amount, Deal status, Deal Date(Child custom object)

IBM  has 2 deals
Google has 4 deals
Apple has no deals

I want to create one pager report based on Company Name selection. How to give Company filter in Dashboard.
My Company Filter should auto populate all company names




 
Hi friends , 

I write a trigger for importing records in custom object. while importing records in custom object , i written some condition for importing these record into contacts and Leads objects at the same time. 
How do you know the how many records inserted in contacts , how many updated in contacts object. Same issue for lead object also . In my org i  have already records. and I import more than 1000 records . That's y i need to find out this one .
Is it possible ?
Even after completing all the units (including challenges) in Data Modelling, Module is not getting complete. all other modules are completed successfully. Screenshot for reference

User-added image
Hi guys, is there a global search in Lightning similar to Classic that use &startURL=/_ui/search/ui/UnifiedSearchResults?str=valueToSearch ?.
If you know something please let me know. Thank you.

-Austin
I am looking for -any- way to thumbs up/down a content record from a visualforce page. It is doesn't look like I can edit ContentVersion record.

Thanks in advance,
Marijus 
Lets start from the first step i create an visualforce tab on this tab i add one vf page which have three inner tab(using TabPanel), on click on each tab their is a new button when we click on that a new vf page(on which we add something and we also have save & cancel button) will be open but my problem is that on this page my tabs are not shown and on cancel it come to first page their also tab panel are not shown.

Tab Panel:-
<apex:page standardController="BusterSetting__c" showHeader="true" sidebar="true">
    <!-- Define Tab panel .css styles -->
    <style>
    .activeTab {background-color: #236FBD; color:white; background-image:none}
    .inactiveTab { background-color: lightgrey; color:black; background-image:none}
    </style>
            
    <!-- Create Tab panel -->
    <apex:tabPanel switchType="client" selectedTab="name1" id="BusterSettingsTabPanel"
        tabClass="activeTab" inactiveTabClass="inactiveTab">
        <apex:tab label="Find Duplicate Layout" name="name1" id="tabOne">
        <apex:include pageName="FindDuplicatePageLayout"/>
        </apex:tab>
        <apex:tab label="Result Page Layout" name="name2" id="tabTwo">
         <apex:include pageName="ResultPageLayout"/>
        </apex:tab>
        <apex:tab label="Type Ahead" name="name3" id="tabThree">
        content for tab Three
        </apex:tab>
    </apex:tabPanel>
</apex:page>

Hear is a new Button:-
<apex:page controller="FindDuplicateFieldSetController">
    <apex:form >
        <apex:pageblock id="pb">
            <apex:pageblockButtons location="top">
                <apex:commandButton value="New" action="{!clickOnNew}"/>
            </apex:pageblockButtons>
        </apex:pageblock>
        <apex:pageblock >
            <apex:pageblockTable value="{!busterSetting}" var="c">
                <apex:column value="{!c.Name}"/>
                <apex:column value="{!c.Object_Name__c}"/>
                <apex:column value="{!c.Field_List__c}"/>       
                <apex:column value="{!c.Layout_Name__c}"/>
            </apex:pageblockTable>
            <apex:panelGrid columns="7">
                <apex:commandButton status="fetchStatus" reRender="pb" value="|<" action="{!first}" disabled="{!!hasPrevious}" title="First Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value="<" action="{!previous}" disabled="{!!hasPrevious}" title="Previous Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value=">" action="{!next}" disabled="{!!hasNext}" title="Next Page"/>
                <apex:commandButton status="fetchStatus" reRender="pb" value=">|" action="{!last}" disabled="{!!hasNext}" title="Last Page"/>
                <apex:outputText >{!(pageNumber * size)+1-size}-{!IF((pageNumber * size)>noOfRecords, noOfRecords,(pageNumber * size))} of {!noOfRecords}</apex:outputText>
                <apex:commandButton status="fetchStatus" reRender="pb" value="Refresh" action="{!refresh}" title="Refresh Page"/>
                <apex:outputPanel style="color:#4AA02C;font-weight:bold">
                    <apex:actionStatus id="fetchStatus" startText="Fetching..." stopText=""/>
                </apex:outputPanel>
            </apex:panelGrid>
        </apex:pageblock>
    </apex:form>
</apex:page>

Click on New this vf will be shown:-
<apex:page controller="FindDuplicateFieldSetController">
    <apex:form > 
        <apex:pageMessages ></apex:pageMessages>
            <apex:pageBlock title="Duplicate Filter Edit">
            
                <apex:pageBlockSection title="Filter Name" collapsible="false" columns="2">
                    <apex:pageBlockSectionItem >
                        <apex:outputLabel value="Buster Job Name:"></apex:outputLabel>
                            <apex:inputText title="Buster Job Name" value="{!saveJobName}" required="true"/>
                        </apex:pageBlockSectionItem>
                     </apex:pageBlockSection> 
                   
                <apex:pageBlockSection title="Select Standard or Custom Object" columns="2" collapsible="false">
                    <apex:pageBlockSectionItem >
                        <apex:outputlabel value="Object:"/> 
                            <apex:actionRegion >      
                                <apex:selectList value="{!selectedObject}" size="1">
                                    <apex:selectOptions value="{!objNames}"/>
                                        <apex:actionSupport event="onchange" action="{!getObjectFields}" rerender="myFields"/>
                                </apex:selectList>
                            </apex:actionRegion>                         
                    </apex:pageBlockSectionItem>
                </apex:pageBlockSection>
                
                    <apex:outputPanel id="myFields"> 
                <apex:pageBlockSection title="Select Fields" collapsible="false">
                    <apex:pageblocksectionitem > 
                            <c:MultiselectPicklist leftLabel="Available Fields"
                            leftOption="{!allFields}" 
                            rightLabel="Selected Fields"
                            rightOption="{!selectedFields}"
                            size="14" width="150px" />  
                        </apex:pageblocksectionItem>       
                </apex:pageblocksection>
                    </apex:outputpanel>
                    
                <apex:pageblockButtons location="top">
                        <apex:commandButton value="Save" action="{!save}" />
                        <apex:commandButton value="Save & New" action="{!saveAndNew}" />
                        <apex:commandButton value="Cancel" action="{!cancel}" immediate="true"/>
                </apex:pageblockButtons> 
            </apex:pageBlock>
    </apex:form>
</apex:page>
Hi All,

I have a custom object named Payment, which has look up to Lead. On Payment page, I have a button to call Apex class, which changes Lead status which in turn results in after update lead trigger that converts lead using  Database.convertLead() method.
I am having System Administrator profile, but I am getting error as ConvertLead failed. First exception on row 0; first error: UNAVAILABLE RECORDTYPE EXCEPTION, Unable to find default record type

Note: I just created new sandbox, and this function has stopped working on new sandbox. Same functionality is working on Production. My profile has default record type assigned for Account, which is common answer found for this issue. But that is already in place and issue still persists.

Lead, Opportunity do not have record types and there is no custom field vaidation exception shown in debug log.

Any help is highly appreciated.

Approval Page Error on Payment details page:
User-added image
 
//Code for class called from Payment detail page button: 

global class nmLeadWebService 
{
    //New method for Approve registration by IC
    webService static string ApproveRegistrationNew(String strLeadId) 
    {
         Lead objLead = new Lead(id=strLeadId);
         objLead.nm_LeadContacted__c = 'Yes'; 
         
         update objLead;
        
         objLead.nm_PaymentCompleted__c = true;
         
         update objLead;
       
         objLead = [select id, ConvertedAccountId, convertedOpportunityId from Lead where id =: strLeadId];
        
         //Code to transfer registration payment record to opportunity from lead
         List<nm_Payment__c> lstPayment = [select id, nm_OpportunityNew__c from nm_Payment__c where nm_Lead__c =: strLeadId and nm_PaymentStatus__c='Payment Made'];
         if(lstPayment != null && lstPayment.size() > 0)
         {
            for(nm_Payment__c objPayment : lstPayment)
            {
                       
                objPayment.nm_Lead__c = null;
                objPayment.nm_OpportunityNew__c = objLead.ConvertedOpportunityId;               
            }
            
            update lstPayment;
         }
         system.debug('Done');
         return objLead.ConvertedAccountId;
    }
 
//Code in Lead Trigger handler class
//Method to convert lead once Registration payments completed
    public void ConvertLead(list<Lead> lstLead, map<id, Lead> leadOldMap)
    {
        if(lstLead != null && lstLead.size() > 0)
        {
            set<string> strDuplicate = new set<string>();
            //Adding Email MobilePhone in set in string format 
            for(Lead objLead : lstLead)
            {
                strDuplicate.add(((String)objLead.Email + (String) objLead.MobilePhone ).toLowerCase());
                System.debug('**strDuplicate'+strDuplicate);
            }
            
            //getting accounts already in Account
            list<Account> lstAccount = [select id,(select id from Contacts limit 1), 
                                        nm_CheckDuplicate__c from Account
                                         where nm_CheckDuplicate__c in : strDuplicate];
            System.debug('**lst account'+lstAccount);
            map<string, Account> mapDupAccounts = new map<string, Account>();
            for(Account objAccount : lstAccount)
            {
                mapDupAccounts.put(objAccount.nm_CheckDuplicate__c, objAccount);
            }
            LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
            for(Lead objLead : lstLead)
            {
                //Checking is registration payment done
                if(objLead.nm_Program__c != null && objLead.nm_EligiblityCriteria__c != null && objLead.nm_PaymentCompleted__c == true && leadOldMap.get(objLead.id).nm_PaymentCompleted__c == false)
                {
                    string strLead = ((String)objLead.Email + (String) objLead.MobilePhone ).toLowerCase();
                    if(mapDupAccounts.get(strLead) != null)
                    {
                        Database.LeadConvert lc = new Database.LeadConvert();
                        
                        lc.setLeadId(objLead.id);
                        lc.setAccountId(mapDupAccounts.get(strLead).id);
                        
                        lc.setContactId(mapDupAccounts.get(strLead).Contacts[0].id);
                        
                        
                        lc.setConvertedStatus(convertStatus.MasterLabel);
                        
                        try{
                            Database.LeadConvertResult lcr = Database.convertLead(lc);
                        }
                        catch(exception ex)
                        {
                            objLead.addError(ex.getMessage()); 
                        }
                    }
                    
                    else
                    {
                        Database.LeadConvert lc = new Database.LeadConvert();
                        
                        lc.setLeadId(objLead.id);
                        
                       // LeadStatus convertStatus = [SELECT Id, MasterLabel FROM LeadStatus WHERE IsConverted=true LIMIT 1];
                        lc.setConvertedStatus(convertStatus.MasterLabel);
                        
                        try{
                            Database.LeadConvertResult lcr = Database.convertLead(lc);
                        }
                        catch(exception ex)
                        {
                            objLead.addError(ex.getMessage());
                        }
                    }                   
                }
            }
        }
    }

 

I have a controller which is querying a webservice and returns a JSON formatted response that I need to then display in a VF table on a Contact record. I have the query working and then use JSON.deserialize to put the response into a list. I have a pageBlockTable setup right now  to display a few columns from the response and the values but to properly display anything I've had to hardcode the list position in each value (listName[4] etc..) and when doing so the list values auto-repeat until the row limit defined in the table. I've thought about just building out a very large table with the unique list reference positions (they won't change, only the data in the response) but figured there must be a better way. 

 

How can I take this list and autopopulate the table with the values, ideally using the headers provided in the JSON structure? The structure will stay the same but the contents will change based on a value in the Contact record.  Would using the class deserialize method work better? I've tried to get that to work but I've been unsuccessful. 

 

Thanks!

 

Current VF Page (with hard-coded list references to display something...):

 

<apex:page controller="MemberRestAPI">
    <apex:form >
        <apex:pageblock >
            <apex:commandButton value="Update" onclick="getMemberTransactions(); return false;"/>
            </apex:pageBlock>
            <apex:pageBlock >
            <apex:outputPanel id="RecentTransPanel" layout="block" style="margin-bottom: 5px;width:100%">
                <apex:pageBlockTable value="{!MemberTransactions2}" var="MemberTransactions" id="transactionTable" rows="5">
                
                <apex:column >
                <apex:facet name="header">Transaction Date</apex:facet>
                <apex:outputText value="{!MemberTransactions2[6]}"/>
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Reference Id</apex:facet>
                <apex:outputText value="{!MemberTransactions2[4]}"/>
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Retailer Name</apex:facet>
                <apex:outputText value="{!MemberTransactions2[12]}"/>
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Site ID</apex:facet>
                <apex:outputText value="{!MemberTransactions2[14]}"/>
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Site Name</apex:facet>
                <apex:outputText value="{!MemberTransactions2[16]}"/>
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Card Number</apex:facet>
                <apex:outputText value="{!MemberTransactions2[26]}"/>
                </apex:column>
                
                <apex:column >
                <apex:facet name="header">Transaction Type</apex:facet>
                <apex:outputText value="{!MemberTransactions2[28]}"/>
                </apex:column>
                
                </apex:pageBlockTable>
            </apex:outputPanel>
            </apex:pageblock>
            
<!-- Debug section --> <apex:pageBlock > <apex:outputText value="{!MemberTransactions2}" id="transactionValues" /> </apex:pageBlock> </apex:form> </apex:page>

 Current Controller Code:

 

public with sharing class MemberRestAPI {

public pageReference getMemberTransactions() {
        getMemberTransactions2();
        return null;
}
    
public List<String> getMemberTransactions2() {
     
     //For Execute Anonymous only
     String accessToken = '7064f046-eb0b-49ad-a4fd-11978e6d2191';
     String memberId = '2375070';
        
     HttpRequest req = new HttpRequest();
    req.setEndpoint('URL/public/rest/transactions?programId=320&accountNumber='+memberId);
     req.setMethod('GET');
     req.setHeader('Content-type', 'application/json');
     req.setHeader('access_token', accessToken); 
  
     Http http = new Http();
     System.debug(req.getBody());

     HTTPResponse res = http.send(req);
     System.debug(res.getBody());
    
    //String mTs1 = res.getBody();
    String Transactions = res.getBody();
    //String Transactions = mTs1.replaceAll('transaction', 'transactions');

    List<String> MemberTransactions = (List<String>)JSON.deserialize(Transactions, List<String>.class);
    
    
    System.debug(MemberTransactions);
    
    return MemberTransactions;
   
}
   
//end Class   
}

 

Sample List:

 

[{, transaction, {, referenceId, 1432023700, transactionDateTime, 2012-10-31 11:08:17.0 EDT, postDateTime, 2012-10-31 11:08:35.316 EDT, retailerId, 10001, retailerName, Test, siteId, 10001-1, siteName, Test, transactionAmount, , rewardEarned, 0.03, rewardRedeemed, , expirationDate, 2012-11-01 23:59:59.999 EDT, cardNumber, *9010, transactionType, Adjustment, categoryType, -, siteNameFlag, false, }, }, {, transaction, {, referenceId, 1432023187, transactionDateTime, 2012-10-31 11:04:33.0 EDT, postDateTime, 2012-10-31 11:05:02.179 EDT, retailerId, 10001, retailerName, Test, siteId, 10001-1, siteName, Test, transactionAmount, , rewardEarned, 0.02, rewardRedeemed, , expirationDate, 2012-11-01 23:59:59.999 EDT, cardNumber, *9010, transactionType, Adjustment, categoryType, -, siteNameFlag, false, }, }, {, transaction, {, referenceId, 1432023697, transactionDateTime, 2012-10-31 10:05:40.88 CST, postDateTime, 2012-10-31 11:07:30.445 CST, retailerId, 49000, retailerName, Test, siteId, 49000-4, siteName, Test, transactionAmount, 2.00, rewardEarned, 0.03, rewardRedeemed, , expirationDate, 2012-11-30 23:59:59.999 CST, cardNumber, *9010, transactionType, Issuance, categoryType, -, siteNameFlag, false, }, }, {, transaction, {, referenceId, 1432023293, transactionDateTime, 2012-10-31 10:05:40.88 CST, postDateTime, 2012-10-31 11:07:28.105 CST, retailerId, SH2196, retailerName, Test, siteId, 57441911203, siteName, Test, transactionAmount, 2.00, rewardEarned, , rewardRedeemed, 0.05, expirationDate, , cardNumber, *9010, transactionType, Redemption, categoryType, Fuel Stations, siteNameFlag, false, }, }, {, transaction, {, referenceId, 1432023159, transactionDateTime, 2012-10-31 09:45:40.88 CST, postDateTime, 2012-10-31 11:02:38.822 CST, retailerId, SH2196, retailerName, Test, siteId, 57441911203, siteName, Test, transactionAmount, 2.00, rewardEarned, , rewardRedeemed, 0.03, expirationDate, , cardNumber, *9010, transactionType, Redemption, categoryType, Fuel Stations, siteNameFlag, false, }, }, {, transaction, {, referenceId, 1432023286, transactionDateTime, 2012-10-31 09:45:40.88 CST, postDateTime, 2012-10-31 11:02:40.036 CST, retailerId, 49000, retailerName, Test, siteId, 49000-4, siteName, Test, transactionAmount, 2.00, rewardEarned, 0.03, rewardRedeemed, , expirationDate, 2012-11-30 23:59:59.999 CST, cardNumber, *9010, transactionType, Issuance, categoryType, -, siteNameFlag, false, }, }, {, transaction, {, referenceId, 1430059132, transactionDateTime, 2012-08-03 23:18:00.0 CDT, postDateTime, 2012-08-04 00:17:40.784 CDT, retailerId, part1, retailerName, part1 - iss/red, siteId, SiteA, siteName, SiteA - iss/red, transactionAmount, 20.33, rewardEarned, 2.05, rewardRedeemed, , expirationDate, 2012-10-31 23:59:59.999 CDT, cardNumber, *1011, transactionType, Issuance, categoryType, Participant Programs, siteNameFlag, true, }, }, {, transaction, {, referenceId, 1427148165, transactionDateTime, 2012-05-15 17:33:48.337 EDT, postDateTime, 2012-05-15 17:33:48.362 EDT, retailerId, part1, retailerName, part1 - iss/red, siteId, part1-2, siteName, Promotion Code Activation, transactionAmount, 0.00, rewardEarned, 0.20, rewardRedeemed, , expirationDate, 2012-07-31 23:59:59.999 EDT, cardNumber, *1011, transactionType, Issuance, categoryType, Participant Programs, siteNameFlag, true, }, }]

 The deserialize method seems to not remove the brackets which seems weird so i'll probably need to add a line to remove those. 

 

JSON Response Sample: 

 

[
{
"transaction":{
"referenceId":1432023700,
"transactionDateTime":"2012-10-31 11:08:17.0 EDT",
"postDateTime":"2012-10-31 11:08:35.316 EDT",
"retailerId":"10001",
"retailerName":"Test",
"siteId":"10001-1",
"siteName":"Test",
"transactionAmount":"",
"rewardEarned":"0.03",
"rewardRedeemed":"",
"expirationDate":"2012-11-01 23:59:59.999 EDT",
"cardNumber":"*9010",
"transactionType":"Adjustment",
"categoryType":"-",
"siteNameFlag":false
}
}
]

 Ideally I don't need to display everything in the response on the page but will if needed. I'd like to change the headers so they display as a normal name and not a variable name and the table will display a maximum of 20 rows (20 transactions). 

 

Screenshot of VF Page:

 

http://i.imgur.com/dqPtPRA.png