• Sanjay92062
  • NEWBIE
  • 0 Points
  • Member since 2021

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 4
    Replies
Hi,
How can see custom fields from the lookup field from visualforce page?

User-added image How can see other fields as well along with Data Asset Id?

Thanks in Advance.
Hi,
I am using the below code for multi-select.
<apex:selectList value="{!tab.tables__c}" title="Select" multiselect="true" size="5" id="selectListValue">
                              <apex:selectOptions value="{!tables}"/>
                          </apex:selectList>

and controller method is below,
public List<selectOption> getselectValues1(){
        List<Column___c> relatedprod = new List<Column___c>();
        relatedprod = [Select Id,name from Column___c where Table_Name__r.id =:tableValue ];
        List<SelectOption> columns = new List<SelectOption>();
        columns.add(new SelectOption('','-None-'));
        for(Column___c prod:relatedprod){
            columns.add(new SelectOption(prod.Name,prod.Name));
            
        }
        return columns;
    }

From the visualforce page,i can select multiple columns, but the issue is those columns are coming like [column1,column2]
How can I remove those brackets from the visualforce code?

Thanks in Advance !!
 
Hi,
I am looking to fire the approval process when any fields are updated with new values.is it possible?
Thanks in Advance.
 
Hi,
I have a custom object with two record types. Now i am trying to redirect Visualforce page for one record type.
 Below is my controller code  :
 
public PageReference CaseRedirect() {
       
        	PageReference newPage;
          
            if(m.RecordTypeId =='0000111111'){
                  newPage = new PageReference('/apex/MPage');
                  newPage.getParameters().put('nooverride', '2');
                 return newPage;
                }
        else{
            PageReference pageRef2 = new PageReference('https://test.com/new?count=5&nooverride=1&recordTypeId=00002222');
            return pageRef2;
        }
       
}
Else Condition working as expected, but whenever i selected corrected record type it shows :
Cyclical server-side forwards detected: /apex/MPage
From internet,i added,
newPage.getParameters().put('nooverride', '2');
as well.But i am facing same issue.

Please help me.
Thank you.

 
Hi,i am new to VS pages.
I am trying to maintain different pageBlockSections, whenever,i saved the record,it is not saved one of the pageBlocksection code.
Please help me here.

I am able to save the name and description, but not multi select values.

Below is the code :
 
<apex:page standardController="test__c" extensions="multitest" lightningStylesheets="true">
    <style type="text/css">
        .customPopupStyle{ background-color: white; border-style: solid; border-width: 2px; left:20%; padding:10px; position: absolute; z-index: 9999; width: 500px; top:20%;} .disabledTextBoxStyle{ background-color: white; border: 1px solid; color: black; cursor: default; width: 90px; display: table; padding: 2px 1px; text-align: right;}.closeButtonStyle{ float: right;}
    </style>
    <apex:form >
        <apex:pagemessages ></apex:pagemessages>
        <apex:pageBlock title="Create a test Job" id="pgBlkId">
                              <apex:pageBlockButtons >
        <apex:commandButton action="{!Save}" value="Save"/>
        <apex:commandButton action="{!Cancel}" value="Cancel"/>
      </apex:pageBlockButtons>
           
            <apex:pageBlockSection title="MultiSelection" collapsible="true" id="pgBlkSecId">
                
            <apex:inputtextarea value="{!lookUp}" label="Contact"/>
            <apex:commandButton value="Add Value" reRender="out" action="{!add}"/>
            <apex:outputPanel id="out">
                <apex:outputPanel styleClass="customPopupStyle" rendered="{!bool}">
                    <apex:commandButton value="X" title="Close the popup" action="{!closePopup}" styleClass="closeButtonStyle" rerender="out"/>
                    <apex:pageBlockTable value="{!show}" var="e" title="show">
                        <apex:column >
                            <apex:inputCheckbox value="{!e.check}"/>
                            <apex:actionSupport event="onclick" action="{!inIt}"/>
                        </apex:column>
                        <apex:column >
                            <apex:commandLink value="{!e.con.Name}"/>
                        </apex:column>
                    </apex:pageBlockTable>
                </apex:outputPanel>
            </apex:outputPanel>
                
            <apex:commandButton value="Save" action="{!mySave}"/> 
            </apex:pageBlockSection>
            <apex:pageBlockSection title="Details" collapsible="true" id="pgBlkSecIdd">
                <apex:inputField value="{!tes.Name}"/>
                <apex:inputField value="{!tes.Description__c}"/>
                
            </apex:pageBlockSection>

        </apex:pageBlock>
    </apex:form>
</apex:page>

Controller Code is below :
 
public with sharing class multi_test {
    public string lookUp{get;set;}
    public list<conContact> contactList{get;set;}
    public boolean allbool{get;set;}
    public string inputValue{get;set;}
    public boolean bool{get;set;}
    public set<id> contactids{get;set;}
    public test_c tes {get;set;}
    
    ApexPages.StandardController controller;

    public multijtbdaction_test(ApexPages.StandardController con) {
        controller = con; 
        contactList = new list<conContact>();
        bool = false; 
        contactids = new Set<Id>();
        this.tes = (test__c)con.getRecord();
 
    }    

    public class conContact {
        public car__c con{get;set;}
        public boolean check{get;set;}
        public conContact(car__c c, boolean boo){ con = c; check = boo; }
    }

    public void inIt() {
        list<car__c> selectedContact = new list<car__c>();
        lookUp = '';
        for(conContact conObj : contactList) {
            if(conObj.check != false){
                system.debug('conObj.con'+conObj.con);
                selectedContact.add(conObj.con);
                lookUp += conObj.con.name + ' ';
                system.debug('lookUp::'+lookUp);
                contactids.add(conObj.con.id);
            }
        }
        bool = true;
    }

    public list<conContact> getShow(){
        for(car__c coObj:[select id,name from car__c]){
            contactList.add(new conContact(coObj,allbool));
        }
        return contactList;
    }

    public PageReference mySave() {
        list<car__c> updateSelectedContact = new list<car__c>();
        id accId = ApexPages.CurrentPage().getparameters().get('id');
        for(car__c co:[select id,name,test__c from car__c where id =: contactids]) {
            co.test__c = accId;
            updateSelectedContact.add(co);
        }
        
        update updateSelectedContact;
        return null;
    }

    public void closePopup() {
        bool = false;
    }

    public void add(){
        bool = true;
    }
    
}

Please help me.

Thank you in advace.​​​​​​​
 
Hi,
I am using the below code for multi-select.
<apex:selectList value="{!tab.tables__c}" title="Select" multiselect="true" size="5" id="selectListValue">
                              <apex:selectOptions value="{!tables}"/>
                          </apex:selectList>

and controller method is below,
public List<selectOption> getselectValues1(){
        List<Column___c> relatedprod = new List<Column___c>();
        relatedprod = [Select Id,name from Column___c where Table_Name__r.id =:tableValue ];
        List<SelectOption> columns = new List<SelectOption>();
        columns.add(new SelectOption('','-None-'));
        for(Column___c prod:relatedprod){
            columns.add(new SelectOption(prod.Name,prod.Name));
            
        }
        return columns;
    }

From the visualforce page,i can select multiple columns, but the issue is those columns are coming like [column1,column2]
How can I remove those brackets from the visualforce code?

Thanks in Advance !!
 
Hi,
I am looking to fire the approval process when any fields are updated with new values.is it possible?
Thanks in Advance.
 
Hi,
I have a custom object with two record types. Now i am trying to redirect Visualforce page for one record type.
 Below is my controller code  :
 
public PageReference CaseRedirect() {
       
        	PageReference newPage;
          
            if(m.RecordTypeId =='0000111111'){
                  newPage = new PageReference('/apex/MPage');
                  newPage.getParameters().put('nooverride', '2');
                 return newPage;
                }
        else{
            PageReference pageRef2 = new PageReference('https://test.com/new?count=5&nooverride=1&recordTypeId=00002222');
            return pageRef2;
        }
       
}
Else Condition working as expected, but whenever i selected corrected record type it shows :
Cyclical server-side forwards detected: /apex/MPage
From internet,i added,
newPage.getParameters().put('nooverride', '2');
as well.But i am facing same issue.

Please help me.
Thank you.