• msb-appsupport1.3905906418879758E12
  • NEWBIE
  • 30 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 6
    Replies


I want to check only on box at a time. Then I worte the following script and visualforce page.
However, the js could not work.
Could anyone give me any suggestions?

Thanks a lot.

<script>
    function checkFullName(last_name_box, first_name_box, ticket_num_box, fullNameText, lastNameInput, firstNameInput, inputNumText) {
        ticket_num_box.checked = false;
        last_name_box.checked = false;
        first_name_box.checked = false;
        document.getElementById(fullNameText).disabled = false;
        document.getElementById(lastNameInput).disabled = true;
        document.getElementById(firstNameInput).disabled = true;
        document.getElementById(inputNumText).disabled = true;
    }
  
    function checkLastName(full_name_box, first_name_box, ticket_num_box, fullNameText, lastNameInput, firstNameInput, inputNumText) {
        full_name_box.checked = false;
        first_name_box.checked = false;
        ticket_num_box.checked = false;
        document.getElementById(fullNameText).disabled = true;
        document.getElementById(lastNameInput).disabled = false;
        document.getElementById(firstNameInput).disabled = true;
        document.getElementById(inputNumText).disabled = true;
    }
  
    function checkFirstName(full_name_box, last_name_box, ticket_num_box, fullNameText, lastNameInput, firstNameInput, inputNumText) {
        full_name_box.checked = false;
        last_name_box.checked = false;
        ticket_num_box.checked = false;
        document.getElementById(fullNameText).disabled = true;
        document.getElementById(lastNameInput).disabled = true;
        document.getElementById(firstNameInput).disabled = false;
        document.getElementById(inputNumText).disabled = true;
    }
  
    function checkTicketNum(full_name_box, last_name_box, first_name_box, fullNameText, lastNameInput, firstNameInput, inputNumText) {
        full_name_box.checked = false;
        last_name_box.checked = false;
        first_name_box.checked = false;
        document.getElementById(fullNameText).disabled = true;
        document.getElementById(lastNameInput).disabled = true;
        document.getElementById(firstNameInput).disabled = true;
        document.getElementById(inputNumText).disabled = false;
    }
</script>


<p>Please Choose Search Condition: </p>
      
        <apex:inputCheckbox id="full_name_box" value="{!isFullName}"
        onclick="checkFullName(last_name_box,first_name_box, ticket_num_box,
        '{!$Component.fullNameInput}','{!$Component.lastNameInput}','{!$Component.firstNameInput}','{!$Component.ticketNumInput}');"/>
        Full Name:&nbsp;
        <apex:inputText value="{!tickFullName}" id="fullNameInput"/> <p />
      
        <apex:inputCheckbox id="last_name_box" value="{!isLastName}"
        onclick="checkLastName(full_name_box, first_name_box, ticket_num_box,
        '{!$Component.fullNameInput}','{!$Component.lastNameInput}','{!$Component.firstNameInput}','{!$Component.ticketNumInput}');"/>
        Last Name:&nbsp;
        <apex:inputText value="{!tickLastName}" id="lastNameInput"/> <p />
      
        <apex:inputCheckbox id="first_name_box" value="{!isFirstName}"
        onclick="checkFirstName(full_name_box, last_name_box, ticket_num_box,
        '{!$Component.fullNameInput}','{!$Component.lastNameInput}','{!$Component.firstNameInput}','{!$Component.ticketNumInput}');"/>
        First Name:&nbsp;
        <apex:inputText value="{!tickFirstName}" id="firstNameInput"/> <p />
      
        <apex:inputCheckbox id="ticket_num_box" value="{!isTicketNum}"
        onclick="checkTicketNum(full_name_box, last_name_box, first_name_box,
        '{!$Component.fullNameInput}','{!$Component.lastNameInput}','{!$Component.firstNameInput}','{!$Component.ticketNumInput}');"/>
        Ticket Number:&nbsp;
        <apex:inputText value="{!inputNum}" id="ticketNumInput"/>
        <p />
The problem I got is I could not update the selected field.

It seems when I check the checkbox, the value {!tItem.selectedCheck} and {!tItem.selectedUnCheck} could not got update.

Could anyone tell me how to solve it?

Thanks so much.

The following is my code:

<!-- display the result and check-in -->
        <apex:pageblockSection columns="2" id="result_section">
            <apex:pageblockTable value="{!ticket_result_list}" var="tItem" id="result_table">
                <apex:column headerValue="Ticket Search Result">
                    <apex:outputText value="No result" rendered="{!NOT(found)}"/>
                    <apex:outputText value="{!tItem.ticket.name}" rendered="{!found}"/>
                </apex:column>
             
                <!-- check box to select which the user want to check-->
                <apex:column headerValue="Check-in">
                    <apex:inputCheckbox value="{!tItem.selectedCheck}"/>
                </apex:column>
                <apex:column headerValue="Uncheck">
                    <apex:inputCheckbox value="{!tItem.selectedUncheck}"/>
                </apex:column>

                <!--
                <apex:column headerValue="Check-in">
                     <apex:commandButton action="{!check}" value="Check-in" reRender="result_table"/>
                </apex:column>
                <apex:column headerValue="Uncheck">
                    <apex:commandButton action="{!uncheck}" value="Uncheck" reRender="result_table"/>
                </apex:column>
                -->
            </apex:pageblockTable>
        </apex:pageblockSection>
            <p />
            <apex:commandButton action="{!check}" value="Check-in" reRender="result_table"/>
            <p />
            <apex:commandButton action="{!uncheck}" value="Uncheck" reRender="result_table"/>
        </apex:pageBlock>

--------------------------------------------------------------------------------------------------------------------------------

//check button and uncheck button
    public PageReference check() {
        List<DisplayTicket> selectedTickets = new List<DisplayTicket>();
     
        for(DisplayTicket selectTic: getTicket_result_List()) {
            if(selectTic.selectedCheck == True) {
                selectTic.ticket.sbxe1__sbx_Attended__c = TRUE;
                update selectTic.ticket;
            }
        }
     
        selectedTickets = null;

        return null;
    } 

    public PageReference uncheck() {
        List<DisplayTicket> selectedTickets = new List<DisplayTicket>();
     
        for(DisplayTicket selectTic: getTicket_result_List()) {
            if(selectTic.selectedCheck == FALSE && selectTic.selectedUncheck == TRUE) {
                selectTic.ticket.sbxe1__sbx_Attended__c = FALSE;
                update selectTic.ticket;
            }
        }
     
        selectedTickets = null;

        return null;
    }

public class DisplayTicket {
        public sbxe1__Ticket__c ticket {
            get; set;
        }
        public Boolean selectedCheck {
            get; set;
        }
        public Boolean selectedUncheck {
            get; set;
        }     
        public DisplayTicket(sbxe1__Ticket__c item) {
            this.ticket = item;
            selectedCheck = false;
            selectedUncheck = false;
            //this.no_found_msg = 'No result';
        }
        public String name {
            get {return ticket.Name;}
        }
        public String no_found_msg {
            get {return 'No result';}
        }

    }

Hi,
I have displayed a list of result. And I want to check the on I want with a check function.

How could I do it?

Thanks so much.

The below is related code.

<apex:pageblockSection columns="2" id="result_section">
            <apex:pageblockTable value="{!ticket_result_list}" var="tItem" id="result_table">
                <apex:column headerValue="Ticket Search Result">
                    <apex:outputText value="No result" rendered="{!NOT(found)}"/>
                    <apex:outputText value="{!tItem.name}" rendered="{!found}"/>
                </apex:column>
                <apex:column headerValue="Check-in">
                     <apex:commandButton action="{!check}" value="Check-in" reRender="ticket_check_in"/>
                </apex:column>
                <apex:column headerValue="Uncheck">
                    <apex:commandButton action="{!uncheck}" value="Uncheck" reRender="ticket_check_in"/>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageblockSection>

public PageReference check() {
        //what should I do here to check the on I want.
        update ticketFound;
        return null;
    }

The following is the result list.

This image is not available because: You don’t have the privileges to see it, or it has been removed from the system

Hi, 
I have displayed a list of result. And I want to check the on I want with a check function. 

How could I do it?

Thanks so much.

The below is related code.

<apex:pageblockSection columns="2" id="result_section">
            <apex:pageblockTable value="{!ticket_result_list}" var="tItem" id="result_table">
                <apex:column headerValue="Ticket Search Result">
                    <apex:outputText value="No result" rendered="{!NOT(found)}"/>
                    <apex:outputText value="{!tItem.name}" rendered="{!found}"/>
                </apex:column>
                <apex:column headerValue="Check-in">
                     <apex:commandButton action="{!check}" value="Check-in" reRender="ticket_check_in"/>
                </apex:column>
                <apex:column headerValue="Uncheck">
                    <apex:commandButton action="{!uncheck}" value="Uncheck" reRender="ticket_check_in"/>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageblockSection>

public PageReference check() {
        //what should I do here to check the on I want.
        update ticketFound;
        return null;
    }

The following is the result list.
User-added image

Hi,
I want to search ticket number based on campagin. However, the console told me the campaing is not on the entity list of the ticket. 

The code I have tried is below

sbxe1__Ticket__c[] ticket = [SELECT Name FROM sbxe1__Ticket__c WHERE campaing =:'CampaginTest'];
System.debug(ticket);

How could I search based on campaign?

Thanks.

Hi,
I am building a visualforce page associating with Apex code.
I have multiple checkboxes. And I want user to check only one checkbox at a time.

How could I do it?

I have tried some javascript associating with onclick feature, however, it doesn't work.

Thanks.
Hi,
I have built a visualforce page on web.
And I create a new tab related to it.
Then when I log into the Salesforce1, the user interface, like new button, output text box, is different than others, which originally exist in the Salesforce1, such as lead, contact etc.

Could anyone tell me how to customize the design of the visualforce page?

Thanks.
When I insert a lead, I want to assign a campaign to the lead. However, after I do it, the SF will convert the lead to a contact automatically. How could I solve this using Apex code or Visualforce?

The code I use is as following:

Map<String,Id> recordtypeMap  = new Map<String,Id>();
for(RecordType leadRT :  [select id, Name from RecordType where SObjectType = 'Lead' ]){
recordtypeMap.put(leadRT.Name,leadRT.Id);
}
Lead l = new Lead(firstname='testInsertLead-1-0326', lastname='test-1-0326',company='Temp Company',
                  RecordTypeId = recordtypeMap.get('Temp Lead Type'));
insert l;
Campaign c = [Select id from Campaign limit 1];
CampaignMember mem = new CampaignMember (campaignid=c.id, leadid=l.id);
insert mem;

Thanks.
I want to use Apex code and visualforce page to create a new lead.

In web, I need to choose a record type before I create a new lead. And there are three types of leads.
In visualforce page, I want to create a new lead with assigned record type using code.

The confusion for me is that the recordType is related list for the lead. I could extract a list of record type by the following.

for (list<RecordType> rts : [SELECT ID, name FROM RecordType WHERE SObjectType = 'Lead' Order by name])

However, I could not pull out the recordType for a lead by the following, since the recordType is related list.

Lead l = [SELECT RecordType FROM LEAD].

Besides, what I want is create a new lead like below.
Lead l = new Lead(firstname='testInsertLead2', lastname='test',company='Temp Company', RecordType = 'registration type lead');

Could anyone help me with this to access the related list using apex code or visualforce page?

Thanks a lot.
I want to use Apex code and visualforce page to create a new lead.

In web, I need to choose a record type before I create a new lead. And there are three types of leads.
In visualforce page, I want to create a new lead with assigned record type using code.

The confusion for me is that the recordType is related list for the lead. I could extract a list of record type by the following.

for (list<RecordType> rts : [SELECT ID, name FROM RecordType WHERE SObjectType = 'Lead' Order by name])

However, I could not pull out the recordType for a lead by the following, since the recordType is related list.

Lead l = [SELECT RecordType FROM LEAD].

Besides, what I want is create a new lead like below.
Lead l = new Lead(firstname='testInsertLead2', lastname='test',company='Temp Company', RecordType = 'registration type lead');

Could anyone help me with this to access the related list using apex code or visualforce page?

Thanks a lot.


Here is the user case:
We usually need to hold  a lot of events. And every time, we need to print RSVP list out and check in the registration manually. Could we build a mobile app which could automatically pull out of the RSVP list of happening event and check in the registration on mobile?
Hi all, 
is there any process or apps in the salesforce to fit the following cases assuming users are out of office and has no access to the desktop?
1. Users may need to access to the salesforce via their ipad or mobile, because they may need to report some urgent cases or problems.
2. When the user report the urgent case, the support could see the location of the user, so that he could find the user immediately without asking the user.
3. When some user has too many tasks to do, he need to assign some tasks, which he could no finish, to some other users. Then he could user the mobile to do it.

When I insert a lead, I want to assign a campaign to the lead. However, after I do it, the SF will convert the lead to a contact automatically. How could I solve this using Apex code or Visualforce?

The code I use is as following:

Map<String,Id> recordtypeMap  = new Map<String,Id>();
for(RecordType leadRT :  [select id, Name from RecordType where SObjectType = 'Lead' ]){
recordtypeMap.put(leadRT.Name,leadRT.Id);
}
Lead l = new Lead(firstname='testInsertLead-1-0326', lastname='test-1-0326',company='Temp Company',
                  RecordTypeId = recordtypeMap.get('Temp Lead Type'));
insert l;
Campaign c = [Select id from Campaign limit 1];
CampaignMember mem = new CampaignMember (campaignid=c.id, leadid=l.id);
insert mem;

Thanks.
I want to use Apex code and visualforce page to create a new lead.

In web, I need to choose a record type before I create a new lead. And there are three types of leads.
In visualforce page, I want to create a new lead with assigned record type using code.

The confusion for me is that the recordType is related list for the lead. I could extract a list of record type by the following.

for (list<RecordType> rts : [SELECT ID, name FROM RecordType WHERE SObjectType = 'Lead' Order by name])

However, I could not pull out the recordType for a lead by the following, since the recordType is related list.

Lead l = [SELECT RecordType FROM LEAD].

Besides, what I want is create a new lead like below.
Lead l = new Lead(firstname='testInsertLead2', lastname='test',company='Temp Company', RecordType = 'registration type lead');

Could anyone help me with this to access the related list using apex code or visualforce page?

Thanks a lot.



Hi,
I have displayed a list of result. And I want to check the on I want with a check function.

How could I do it?

Thanks so much.

The below is related code.

<apex:pageblockSection columns="2" id="result_section">
            <apex:pageblockTable value="{!ticket_result_list}" var="tItem" id="result_table">
                <apex:column headerValue="Ticket Search Result">
                    <apex:outputText value="No result" rendered="{!NOT(found)}"/>
                    <apex:outputText value="{!tItem.name}" rendered="{!found}"/>
                </apex:column>
                <apex:column headerValue="Check-in">
                     <apex:commandButton action="{!check}" value="Check-in" reRender="ticket_check_in"/>
                </apex:column>
                <apex:column headerValue="Uncheck">
                    <apex:commandButton action="{!uncheck}" value="Uncheck" reRender="ticket_check_in"/>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageblockSection>

public PageReference check() {
        //what should I do here to check the on I want.
        update ticketFound;
        return null;
    }

The following is the result list.

This image is not available because: You don’t have the privileges to see it, or it has been removed from the system

Hi, 
I have displayed a list of result. And I want to check the on I want with a check function. 

How could I do it?

Thanks so much.

The below is related code.

<apex:pageblockSection columns="2" id="result_section">
            <apex:pageblockTable value="{!ticket_result_list}" var="tItem" id="result_table">
                <apex:column headerValue="Ticket Search Result">
                    <apex:outputText value="No result" rendered="{!NOT(found)}"/>
                    <apex:outputText value="{!tItem.name}" rendered="{!found}"/>
                </apex:column>
                <apex:column headerValue="Check-in">
                     <apex:commandButton action="{!check}" value="Check-in" reRender="ticket_check_in"/>
                </apex:column>
                <apex:column headerValue="Uncheck">
                    <apex:commandButton action="{!uncheck}" value="Uncheck" reRender="ticket_check_in"/>
                </apex:column>
            </apex:pageblockTable>
        </apex:pageblockSection>

public PageReference check() {
        //what should I do here to check the on I want.
        update ticketFound;
        return null;
    }

The following is the result list.
User-added image

Hi,
I want to search ticket number based on campagin. However, the console told me the campaing is not on the entity list of the ticket. 

The code I have tried is below

sbxe1__Ticket__c[] ticket = [SELECT Name FROM sbxe1__Ticket__c WHERE campaing =:'CampaginTest'];
System.debug(ticket);

How could I search based on campaign?

Thanks.