• Parmanand Pathak
  • NEWBIE
  • 148 Points
  • Member since 2019
  • Vyomlabs

  • Chatter
    Feed
  • 4
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 25
    Replies
I want two tab on that when i click on contact it shows records related to contact whatever i search on input text.
now i click on Account tab ,account list records should be displyed when i search something on input.


public  class Searchname {
    
    public String name            {get;set;}
    public list<contact> myCon    {get;set;}
    public list<Account> myAcc    {set;get;}
    public boolean searched       {get;set;}
    public boolean flagForAccount  {get;set;}
    public boolean flagForContact  {set;get;}
    
    public searchname() {
        flagForAccount=true;
        flagForContact=true;
        searched=false;
        string namestr=ApexPages.currentPage().getParameters().get('name');
        if(null!=namestr) {
            name=namestr;
        }
    }
    public PageReference executeSearch() {
        searched=true;
        flagForAccount=false;
        flagForContact=true; 
        System.debug('name' +name);
        string searchstr=('%'+name+'%');
        System.debug(searchstr);
        myCon=[select id,lastName,firstName from contact where name Like:searchstr limit 10];
        System.debug(myCon);
        return null;
    }
    
    public void showAccountPanel(){
        flagForAccount=true;
        flagForContact=false;
        
      }
    
    public PageReference executeSearchForAccount() {
        searched=true;
        flagForAccount=true;
        flagForContact=false; 
        System.debug('name' +name);
        string searchstr=('%'+name+'%');
        System.debug(searchstr);
        myAcc=[select id,name,rating from account where name Like:searchstr limit 10];
        System.debug(myCon);
       return null;
    }
}
=======
Vf page
<apex:page controller="Searchname" showHeader="false">
    <apex:form >
        <!--    <apex:actionFunction name="someMet" action="" />
--> 
        <apex:tabPanel id="ObjectPanel">
            <apex:tab label="Contact" name="nameCons" id="con" />
            <apex:tab label="Account" name="nameAcc" id="acc" onclick="nameAcc()"/>   
        </apex:tabPanel>
        <apex:actionFunction action="{!showAccountPanel}" name="nameAcc" reRender="acc"/>
        <apex:PageBlock>
            <!-- Contact Section.. -->
            <apex:PageBlockSection id="con" >
                <apex:PageBlockSectionItem >
                    <apex:outputLabel >Name</apex:outputLabel>
                    <apex:inputText value="{!name}"/>
                </apex:PageBlockSectionItem>
                <apex:commandButton value="Search Contact" action="{!executeSearch}"/>
                
                <apex:PageBlockTable var="act" value="{!myCon}" id="con"> 
                    <apex:column value="{!act.lastName}" />  
                    <apex:column value="{!act.firstName}"/>
                </apex:PageBlockTable>
            </apex:PageBlockSection>
        </apex:PageBlock>
            <apex:pageBlock>
           
              <!-- Account Section..   --> 
            <apex:pageBlockSection  id="acc" rendered="{!flagForAccount}">
                <apex:pageBlockSectionItem>
                    <apex:outputLabel>Account Name</apex:outputLabel>
                    <apex:inputText value="{!name}"/>
                </apex:pageBlockSectionItem>
                <apex:commandButton value="Search Account"  action="{!executeSearchForAccount}" reRender="acc"/>
            </apex:pageBlockSection>
            <apex:pageBlockTable var="acc" value="{!myAcc}">
                <apex:column value="{!acc.name}"/>
                <apex:column value="{!acc.rating}"/>
            </apex:pageBlockTable>
                </apex:pageBlock>
        
    </apex:form>
</apex:page>



 
how to when to use the remoteaction in salesforce, any small examples to start ... i??

 how do the remote action will work in the salesforce ..
thanks 
sree
  • February 06, 2019
  • Like
  • 0

I have a button created and I wish to have a function where user could just hover to the button and then it will pop up a small window showing the information(String) that I have initialized in the controller.


VF page:

                        <a href="/{!showing}" id="aa" onblur="LookupHoverDetail.getHover('aa').hide();" onfocus="LookupHoverDetail.getHover('aa', '/{!showing}/m?retURL=%2F{!showing}&isAjaxRequest=1').show();" onmouseout="LookupHoverDetail.getHover('aa').hide();" onmouseover="LookupHoverDetail.getHover('aa', '/{!showing}/m?retURL=%2F{!showing}&isAjaxRequest=1').show();">

                            <apex:commandButton value="submit" action="{!submit}" style=""/>

</a>

 

Controller:

public with sharing class toshow{

public String showing {get;set;}

public toshow{
     showing = 'I just want to show information';
}
}

I tried this but it just load and then nothing shown, the small window dissappeared after loading. Can anyone assist me?

 

Web Service : 

@RestResource(urlMapping='/UsageInput/') 
global class APTS_UsageInputWS {
   @HttpPost
    global static void loadUsageInputs ()
    { 
        RestRequest req =RestContext.request;
           Blob body = req.requestBody;
           String requestString = body.toString();
        APTS_UsageInputWrapper inputList = (APTS_UsageInputWrapper)JSON.deserialize(requestString,APTS_UsageInputWrapper.class);
        List<EQ_TempSSP1Data__c> tempData = new List<EQ_TempSSP1Data__c>();
        system.debug('***1');
        system.debug('%%%inputList');
        if(inputList.ValidateOnly)
        {
            validateData(inputList);
        }
        else
        {
            delete [select id from EQ_TempSSP1Data__c];
            Integer counter = 1;
            for(APTS_UsageInputWrapperData record : inputList.data)
            {
                tempData.add(new EQ_TempSSP1Data__c(EQ_WorkId__c = inputList.EQ_WorkId,
                            EQ_SourceSystem__c = record.EQ_SourceSystem,
                            EQ_IssueNumber__c = record.EQ_IssueNumber,
                            EQ_ServiceCode__c = record.EQ_ServiceCode,
                            EQ_Quantity__c = record.EQ_Quantity,
                            EQ_QuantityID__c = record.EQ_QuantityID,
                            EQ_RecordKey__c = record.EQ_RecordKey,
                            EQ_LoadMonth__c = Date.newInstance(Integer.valueOf(record.EQ_LoadMonth.left(4)), Integer.valueOf(record.EQ_LoadMonth.subString(4,5)), Integer.valueOf(record.EQ_LoadMonth.subString(6,7))),            
                            Name = counter + '-' + record.EQ_LoadMonth + '-' + record.EQ_IssueNumber));
                counter++;
            }
            insert tempData;
            system.debug('validation called%%%%');
            validateData(inputList);
        }
            
        
    }


JSON input:

{
 "EQ_Count":1,
 "EQ_WorkId":"B-080319-4",
 "ValidateOnly":False,
 "Data":
     [{"EQ_RecordKey":"ab3ff95a-42cc-4778-888d-e1f4c4beb78d",
     "EQ_LoadMonth":"20190101",
     "EQ_Quantity":32116,
     "EQ_ServiceCode":"trsactmata",
     "EQ_IssueNumber":"NW22",
     "EQ_SourceSystem":"SSP1",
     "EQ_QuantityID":"4737301"
     },
     {"EQ_RecordKey":"ab3ff95a-42cc-4778-888d-e1f4c4beb78d",
     "EQ_LoadMonth":"20190101",
     "EQ_Quantity":32116,
     "EQ_ServiceCode":"trsactmata",
     "EQ_IssueNumber":"NW22",
     "EQ_SourceSystem":"SSP1",
     "EQ_QuantityID":"4737301"
     }]
 }


While calling service from workbecnh getting error:


APEX_ERROR
message: System.JSONException: Unexpected character ('F' (code 70)): expected a valid value (number, String, array, object, 'true', 'false' or 'null') at [line:4, column:18] Class.System.JSON.deserialize: line 15, column 1 Class.APTS_UsageInputWS.loadUsageInputs: line 14, column 1

Hi everyone,

I created a new button for creating a task, 'Log a Call', located in the Contact object. The button works well, it is opening the New Task window, but the problem is that it is not pre-populating the Related To and Name fields with the name of the contact and account. Here is the button:

/00T/e?title&who_id={!Contact.Id}&what_id={!Account.Id}&followup=1&tsk5=Call&retURL=%2F{!Contact.Id}

Can you let me know how we could achieve that? It would be awesome to be able to prepopulate the fields, the same it is doing when clicking on the 'Log a Call' action under the Activities related list in the contact layout.

PS. We are making the transition to Lightning, which is why I am asking this.

Thank you lots!

Working through the Visualforce Mobile module  I want to do an exercise (3rd unit) that consists of displaying the contacts their names and phone numbers.
 
<apex:page showHeader="true" sidebar="true" standardController="Contact" recordSetVar="contacts">
<head>
<apex:slds />
</head>
<apex:repeat value="{!contacts}" var="c">
    <dl class="slds-list_horizontal slds-wrap">
        <dt class="slds-item_label slds-text-color_weak slds-truncate" title="Contact Name:">{!c.Name}</dt>
        <dd class="slds-item_detail slds-truncate" title="Mobile Phone Number:">{!c.Phone}</dd>
    </dl>
</apex:repeat>
 tried this code,I have no errors, however the list of contacts is not displayed! I tried to display a simple text it works, so the problem is at the level of the apex repeat I think
apex visualforce community slds
We have scheduled a job year a go, and it might have expired now, but we are unsure about it, how to check if its still running or expired ?
Already tried with CronTrigger object !
I want two tab on that when i click on contact it shows records related to contact whatever i search on input text.
now i click on Account tab ,account list records should be displyed when i search something on input.


public  class Searchname {
    
    public String name            {get;set;}
    public list<contact> myCon    {get;set;}
    public list<Account> myAcc    {set;get;}
    public boolean searched       {get;set;}
    public boolean flagForAccount  {get;set;}
    public boolean flagForContact  {set;get;}
    
    public searchname() {
        flagForAccount=true;
        flagForContact=true;
        searched=false;
        string namestr=ApexPages.currentPage().getParameters().get('name');
        if(null!=namestr) {
            name=namestr;
        }
    }
    public PageReference executeSearch() {
        searched=true;
        flagForAccount=false;
        flagForContact=true; 
        System.debug('name' +name);
        string searchstr=('%'+name+'%');
        System.debug(searchstr);
        myCon=[select id,lastName,firstName from contact where name Like:searchstr limit 10];
        System.debug(myCon);
        return null;
    }
    
    public void showAccountPanel(){
        flagForAccount=true;
        flagForContact=false;
        
      }
    
    public PageReference executeSearchForAccount() {
        searched=true;
        flagForAccount=true;
        flagForContact=false; 
        System.debug('name' +name);
        string searchstr=('%'+name+'%');
        System.debug(searchstr);
        myAcc=[select id,name,rating from account where name Like:searchstr limit 10];
        System.debug(myCon);
       return null;
    }
}
=======
Vf page
<apex:page controller="Searchname" showHeader="false">
    <apex:form >
        <!--    <apex:actionFunction name="someMet" action="" />
--> 
        <apex:tabPanel id="ObjectPanel">
            <apex:tab label="Contact" name="nameCons" id="con" />
            <apex:tab label="Account" name="nameAcc" id="acc" onclick="nameAcc()"/>   
        </apex:tabPanel>
        <apex:actionFunction action="{!showAccountPanel}" name="nameAcc" reRender="acc"/>
        <apex:PageBlock>
            <!-- Contact Section.. -->
            <apex:PageBlockSection id="con" >
                <apex:PageBlockSectionItem >
                    <apex:outputLabel >Name</apex:outputLabel>
                    <apex:inputText value="{!name}"/>
                </apex:PageBlockSectionItem>
                <apex:commandButton value="Search Contact" action="{!executeSearch}"/>
                
                <apex:PageBlockTable var="act" value="{!myCon}" id="con"> 
                    <apex:column value="{!act.lastName}" />  
                    <apex:column value="{!act.firstName}"/>
                </apex:PageBlockTable>
            </apex:PageBlockSection>
        </apex:PageBlock>
            <apex:pageBlock>
           
              <!-- Account Section..   --> 
            <apex:pageBlockSection  id="acc" rendered="{!flagForAccount}">
                <apex:pageBlockSectionItem>
                    <apex:outputLabel>Account Name</apex:outputLabel>
                    <apex:inputText value="{!name}"/>
                </apex:pageBlockSectionItem>
                <apex:commandButton value="Search Account"  action="{!executeSearchForAccount}" reRender="acc"/>
            </apex:pageBlockSection>
            <apex:pageBlockTable var="acc" value="{!myAcc}">
                <apex:column value="{!acc.name}"/>
                <apex:column value="{!acc.rating}"/>
            </apex:pageBlockTable>
                </apex:pageBlock>
        
    </apex:form>
</apex:page>



 
how to when to use the remoteaction in salesforce, any small examples to start ... i??

 how do the remote action will work in the salesforce ..
thanks 
sree
  • February 06, 2019
  • Like
  • 0

I have a button created and I wish to have a function where user could just hover to the button and then it will pop up a small window showing the information(String) that I have initialized in the controller.


VF page:

                        <a href="/{!showing}" id="aa" onblur="LookupHoverDetail.getHover('aa').hide();" onfocus="LookupHoverDetail.getHover('aa', '/{!showing}/m?retURL=%2F{!showing}&isAjaxRequest=1').show();" onmouseout="LookupHoverDetail.getHover('aa').hide();" onmouseover="LookupHoverDetail.getHover('aa', '/{!showing}/m?retURL=%2F{!showing}&isAjaxRequest=1').show();">

                            <apex:commandButton value="submit" action="{!submit}" style=""/>

</a>

 

Controller:

public with sharing class toshow{

public String showing {get;set;}

public toshow{
     showing = 'I just want to show information';
}
}

I tried this but it just load and then nothing shown, the small window dissappeared after loading. Can anyone assist me?

 

Hello,

I am receiving a vales from api.
instead of Value i get "Value", How can i remove the two semicolon if they exsist in apex code.

Thank you for suggetion
  • February 05, 2019
  • Like
  • 0
iam using the bootstarp buttons in the salesforce-- button it was not effection eventhough used the libraries ... 
 in need the default button colurs for the all the buttons in the visualforce page... what should have to be include 

 
<apex:page >
 <html>
 
 <head>
  <title>Bootstrap Example</title>
  <meta charset="utf-8"/>
  <meta name="viewport" content="width=device-width, initial-scale=1"/>
  <link rel="stylesheet" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css"/>
  <script src="https://ajax.googleapis.com/ajax/libs/jquery/3.3.1/jquery.min.js"></script>
  <script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/js/bootstrap.min.js"></script>
</head>


<body>

<div class="container">
  <h2>Button Styles</h2>
  <button type="button" class="btn">Basic</button>
  <button type="button" class="btn btn-default">Default</button>
  <button type="button" class="btn btn-primary">Primary</button>
  <button type="button" class="btn btn-success">Success</button>
  <button type="button" class="btn btn-info">Info</button>
  <button type="button" class="btn btn-warning">Warning</button>
  <button type="button" class="btn btn-danger">Danger</button>
  <button type="button" class="btn btn-link">Link</button>      
</div>

</body>


 </html>
</apex:page>

 
  • February 01, 2019
  • Like
  • 0
I am trying to deserialize some JSON into a custom class. If I deserlize just a single object, it works, but when wrapped in a list, it fails.

Here is an example:
public class attendanceWrapperClass {
    @AuraEnabled public Case eachContact{get;set;}
    @AuraEnabled public Attendance_Breakfast_Lunch_Snack__c eachAttendance{get;set;}
    @AuraEnabled public List<Attendance_Breakfast_Lunch_Snack__c> previousAttendanceRecordsList{get;set;}
}

string wrapperListItems = '[{"eachAttendance":{"Attendance_Code__c":"Y - Yes"},"eachContact":{"Client__c":"0036F00002xYORdQAO","Admission_Pathway_Site__c":"Wolverine Center","WHS_Treatment_Unit__c":"WC CMO Respite","WHS_Treatment_Program__c":"Wolverine Center Respite","Id":"5006F0000240Jv2QAE","Client__r":{"Name":"Cedric Russ","FirstName":"Cedric","LastName":"Russ","Id":"0036F00002xYORdQAO"}}}]';
list<attendanceWrapperClass> wrapperList = (List<attendanceWrapperClass>)JSON.deserialize(wrapperListItems,List<attendanceWrapperClass>.class);
system.debug(wrapperList);

The error I get is System.JSONException: Expected attendanceWrapperClass but found } at [line:1, column:369] basically it errors when the first item in the list ends.

What am I doing wrong?
I have couple of pages in an application Says as page1 ,page2,page3,page4,page5.All the five pages are having same content as footer and header?? when i add some sentences on page 1 ,it should appear in all the pages .How can u achieve this??
Hi All,

When I have tried to execute the query as 
        "Select Id, Subject from ActivityHistory"

in 'Query Editor' from the developer console in the context of 'System Administrator'.

After executing the query, I got the error as  "entity type ActivityHistory does not support query"

Can anybody will help me how to solve this error?

Thanks 
I need to use the angular 6 with salesforce visualforce . Is that possible