• Jordan Miles 9
  • NEWBIE
  • 0 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 2
    Replies
I need to roll back a package to beta that isn't installed anywhere because we have some changes to make to custom fields. We are in development with it currently. I had to change it to released because I have an extension package that also uses this one, and you can't deploy a package that's an extension of a beta package. When I go to log a case, it tells me that all cases are supported by the developer community for this. Can anyone help me?

I have a Visualforce page that's a table where the user can add or delete rows. The rows contain key value pairs of data that, when saved, are aggregated into a delimited string and updated. It's basically a way of input control for our users because the number of rows can be dynamic. Here is the page:

 

<apex:page standardController="Account" extensions="LegalIdController">
	
	<apex:form >      
        <apex:pageBlock title="Manage Legal Ids">
            <apex:outputPanel id="legalIdHead">
                <apex:variable value="{!0}" var="rowNum"/>
                <apex:pageBlockSection columns="1">
                    <apex:pageBlockTable value="{!legalIdRowList}" var="legalIdRow" >
                        <apex:column headerValue="Id Type">           
                        	<apex:selectList size="1" id="countryList" value="{!legalIdRow['legalIdType']}" disabled="{!NOT(legalIdRow['doEdit'])}">
	    						<apex:selectOptions value="{!legalIdTypes}"/>
	    					</apex:selectList>
                        </apex:column>
                        <apex:column headerValue="Id Value">
                            <apex:inputText value="{!legalIdRow['legalIdValue']}" disabled="{!NOT(legalIdRow['doEdit'])}"/>
                        </apex:column>
                        <apex:column headerValue="Action">
                            <apex:commandLink value="Edit" style="color:red" action="{!allowEditForLidRow}" reRender="legalIdHead" rendered="{!NOT(legalIdRow['doEdit'])}">
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>
                            <apex:commandLink value="Ok" style="color:red" action="{!disAllowEditForLidRow}" reRender="legalIdHead" rendered="{!legalIdRow['doEdit']}">                             
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>
                            |&nbsp;
                            <apex:commandLink value="Remove" style="color:red" action="{!removeRowFromLidList}" reRender="legalIdHead" rendered="{!rowNum >= 0}">
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>                        
                            <apex:variable var="rowNum" value="{!rowNum + 1}"/>
                        </apex:column>
                    </apex:pageBlockTable>
                    <apex:outputPanel rendered="{! $User.UIThemeDisplayed == 'Theme3' }">
                    	<apex:commandButton action="{!addNewRowToLidRowList}" value="New Row"/>
                    	<apex:commandLink value="Save" action="{!save}" oncomplete="" target="_parent" styleClass="btn" style="text-decoration:none;padding:4px;"/>
                    </apex:outputPanel>
                    <apex:outputPanel rendered="{! $User.UIThemeDisplayed == 'Theme4d' }">
                    	<apex:commandButton action="{!addNewRowToLidRowList}" value="New Row"/>
                    	<apex:commandLink value="Lightning Save" action="{!saveLightning}" rerender="none" oncomplete="doLightningRefresh()" styleClass="btn" style="text-decoration:none;padding:4px;"/>
                    </apex:outputPanel>
                </apex:pageBlockSection>
            </apex:outputPanel>
        </apex:pageBlock>    
    </apex:form>
</apex:page>


Here is the save method in the controller:
 

public PageReference save() {
        
        String legalIdString = '';
        
        for( LegalIdRow row : legalIdRowList ) {
            
            if( ( row.legalIdType != null && !row.legalIdType.equals('') )
               && ( row.legalIdValue != null && !row.legalIdValue.equals('') ) ) {
            
                   legalIdString += row.legalIdType + ':' + row.legalIdValue + ';';
               }
        }
        
        account.Legal_Identifiers__c = legalIdString;
       
        update account;
        
        return new PageReference( '/' + account.Id );
         
    }
 

The problem is, this is not going to work if the user is using lightning experience, because LEX doesn't support PageReference and I'm having to use apex:inputvalue for my form. Is there a simple way to do this in both Classic and Lightning? I've been digging around all day and haven't found anything. I thought I could add an oncomplete attribute to the command link and then use the sforce.one object to redirect to the detail page, but it looks like the save action redirects automatically.

Is there a way to include null values in a Trigger.new record? It looks like the record only includes non-null. In an "after update" trigger, I post the data to an external system to be updated, and I need to know what fields have been removed. I haven't been able to find any information on this.

Thanks.
I have a visualforce page on my account detail layout that allows users to input legal identifiers, and an account can have multiple legal identifiers. The issue is, we have about 200 possible countries each of which have up to 7 legal identifier types, so 1400 max. I can't use a picklist because it only allows 1000 max. What I'm wondering is if there's a way to have something like a lookup field on the VF page and let the user pick the type. Note I don't want to "link" the account and the type together, just give the user a standard set of id "types" to pick from.

Is there any way to do this? Thanks in advance for the help.

I have a custom visualforce page that looks like this:
User-added image

Basically, it's a list of identifiers for an account (this is embedded on the account page). Everything behaves as I expect, I can add and remove rows, and when I click "edit" the input fields become active so the data can be modified and the "Edit" changes to "Ok". When I click "Ok" I want the data to be changed and the view to be refreshed with the updated data. However, when I do this, say, changing "12345" to "11111" I click OK and the data reverts back to what it was. I'm not exaclty sure what is going on. Any help would be appreciated. Code is below for reference.

Visualforce Page:

 

<apex:page standardController="Account" extensions="LegalIdController">
	<apex:form>      
        <apex:pageBlock title="Manage Legal Ids">
            <apex:outputPanel id="accountHead">
                <apex:variable value="{!0}" var="rowNum"/>
                <apex:pageBlockSection columns="1">
                    <apex:pageBlockTable value="{!legalIdRowList}" var="legalIdRow" >
                        <apex:column headerValue="Id Type">
                            <apex:inputText value="{!legalIdRow['legalIdType']}" disabled="{!NOT(legalIdRow['doEdit'])}"/>
                        </apex:column>
                        <apex:column headerValue="Id Value">
                            <apex:inputText value="{!legalIdRow['legalIdValue']}" disabled="{!NOT(legalIdRow['doEdit'])}"/>
                        </apex:column>
                        <apex:column headerValue="Action">
                            <apex:commandLink value="Edit" style="color:red" action="{!allowEditForLidRow}" rendered="{!NOT(legalIdRow['doEdit'])}" rerender="accountHead" immediate="true" >
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>
                            <apex:commandLink value="Ok" style="color:red" action="{!disAllowEditForLidRow}" rendered="{!legalIdRow['doEdit']}" rerender="accountHead" immediate="true" >                             
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>
                            |&nbsp;
                            <apex:commandLink value="Remove" style="color:red" action="{!removeRowFromLidList}" rendered="{!rowNum >= 0}" rerender="accountHead" immediate="true" >
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>                        
                            <apex:variable var="rowNum" value="{!rowNum + 1}"/>
                        </apex:column>
                    </apex:pageBlockTable>
                    <apex:commandButton action="{!addNewRowToLidRowList}" value="New Row"/>
                </apex:pageBlockSection>
            </apex:outputPanel>
        </apex:pageBlock>    
    </apex:form>
</apex:page>

Controller:

public class LegalIdController {
    
    public Integer rowToModify {get;set;}
    public String modifiedLidType {get;set;}
    public String modifiedLidValue {get;set;}

    Account account;
    
    public LegalIdController(ApexPages.StandardController acon) {
        
        account = ( Account ) acon.getRecord();       
    }
    
    public void removeRowFromLidList() {
   		legalIdRowList.remove(rowToModify);
    }
    
    public void allowEditForLidRow() {
        legalIdRowList.get(rowToModify).doEdit = true;
    }
    
    public PageReference disAllowEditForLidRow() {
		
        System.debug('INSIDE disAllowEditForLidRow()');
        System.debug(JSON.serialize(legalIdRowList));
        legalIdRowList = legalIdRowList;
        return null;
    }
    
     public void addNewRowToLidRowList() {

        LegalIdRow legalIdRow = new LegalIdRow();
         legalIdRow.doEdit = true;
         legalIdRow.legalIdType = '';
         legalIdRow.legalIdValue = '';
         
         legalIdRowList.add(legalIdRow);
    }
    
    public List<LegalIdRow> legalIdRowList {
       
        get {
        
            System.debug('INSIDE getLegalIdRowList()');
            
            if( legalIdRowList == null ) {
                
               System.debug('list was null');
                
               legalIdRowList = new List<LegalIdRow>(); 
                
               Account account = 
                    [ SELECT ts_Legal_Identifiers__c
                     FROM Account
                     WHERE Id = :account.Id];
                
                String[] legalIdentifiersForOrg = 
                    account.ts_Legal_Identifiers__c.split(';');
                
                if( legalIdentifiersForOrg != null && legalIdentifiersForOrg.size() != 0 ) {
                    
                    for( String legalId : legalIdentifiersForOrg ) {
                        
                        LegalIdRow legalIdRow = new LegalIdRow();
                        
                        legalIdRow.legalIdType = legalId.split(':').get(0).trim();   
                        legalIdRow.legalIdValue = legalId.split(':').get(1).trim();
                        legalIdRow.doEdit = false;
                        
                        legalIdRowList.add(legalIdRow);
                    }
                }
            }
            
            return legalIdRowList;
        }
        set;
    }
    
     public without sharing class LegalIdRow{
        public Boolean doEdit {get;set;}
        public String legalIdType {get;set;}
        public String legalIdValue {get;set;}
   } 
}
Is there a way to include null values in a Trigger.new record? It looks like the record only includes non-null. In an "after update" trigger, I post the data to an external system to be updated, and I need to know what fields have been removed. I haven't been able to find any information on this.

Thanks.
I need to roll back a package to beta that isn't installed anywhere because we have some changes to make to custom fields. We are in development with it currently. I had to change it to released because I have an extension package that also uses this one, and you can't deploy a package that's an extension of a beta package. When I go to log a case, it tells me that all cases are supported by the developer community for this. Can anyone help me?

I have a custom visualforce page that looks like this:
User-added image

Basically, it's a list of identifiers for an account (this is embedded on the account page). Everything behaves as I expect, I can add and remove rows, and when I click "edit" the input fields become active so the data can be modified and the "Edit" changes to "Ok". When I click "Ok" I want the data to be changed and the view to be refreshed with the updated data. However, when I do this, say, changing "12345" to "11111" I click OK and the data reverts back to what it was. I'm not exaclty sure what is going on. Any help would be appreciated. Code is below for reference.

Visualforce Page:

 

<apex:page standardController="Account" extensions="LegalIdController">
	<apex:form>      
        <apex:pageBlock title="Manage Legal Ids">
            <apex:outputPanel id="accountHead">
                <apex:variable value="{!0}" var="rowNum"/>
                <apex:pageBlockSection columns="1">
                    <apex:pageBlockTable value="{!legalIdRowList}" var="legalIdRow" >
                        <apex:column headerValue="Id Type">
                            <apex:inputText value="{!legalIdRow['legalIdType']}" disabled="{!NOT(legalIdRow['doEdit'])}"/>
                        </apex:column>
                        <apex:column headerValue="Id Value">
                            <apex:inputText value="{!legalIdRow['legalIdValue']}" disabled="{!NOT(legalIdRow['doEdit'])}"/>
                        </apex:column>
                        <apex:column headerValue="Action">
                            <apex:commandLink value="Edit" style="color:red" action="{!allowEditForLidRow}" rendered="{!NOT(legalIdRow['doEdit'])}" rerender="accountHead" immediate="true" >
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>
                            <apex:commandLink value="Ok" style="color:red" action="{!disAllowEditForLidRow}" rendered="{!legalIdRow['doEdit']}" rerender="accountHead" immediate="true" >                             
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>
                            |&nbsp;
                            <apex:commandLink value="Remove" style="color:red" action="{!removeRowFromLidList}" rendered="{!rowNum >= 0}" rerender="accountHead" immediate="true" >
                                <apex:param value="{!rowNum}" name="rowToModify" assignTo="{!rowToModify}"/>
                            </apex:commandLink>                        
                            <apex:variable var="rowNum" value="{!rowNum + 1}"/>
                        </apex:column>
                    </apex:pageBlockTable>
                    <apex:commandButton action="{!addNewRowToLidRowList}" value="New Row"/>
                </apex:pageBlockSection>
            </apex:outputPanel>
        </apex:pageBlock>    
    </apex:form>
</apex:page>

Controller:

public class LegalIdController {
    
    public Integer rowToModify {get;set;}
    public String modifiedLidType {get;set;}
    public String modifiedLidValue {get;set;}

    Account account;
    
    public LegalIdController(ApexPages.StandardController acon) {
        
        account = ( Account ) acon.getRecord();       
    }
    
    public void removeRowFromLidList() {
   		legalIdRowList.remove(rowToModify);
    }
    
    public void allowEditForLidRow() {
        legalIdRowList.get(rowToModify).doEdit = true;
    }
    
    public PageReference disAllowEditForLidRow() {
		
        System.debug('INSIDE disAllowEditForLidRow()');
        System.debug(JSON.serialize(legalIdRowList));
        legalIdRowList = legalIdRowList;
        return null;
    }
    
     public void addNewRowToLidRowList() {

        LegalIdRow legalIdRow = new LegalIdRow();
         legalIdRow.doEdit = true;
         legalIdRow.legalIdType = '';
         legalIdRow.legalIdValue = '';
         
         legalIdRowList.add(legalIdRow);
    }
    
    public List<LegalIdRow> legalIdRowList {
       
        get {
        
            System.debug('INSIDE getLegalIdRowList()');
            
            if( legalIdRowList == null ) {
                
               System.debug('list was null');
                
               legalIdRowList = new List<LegalIdRow>(); 
                
               Account account = 
                    [ SELECT ts_Legal_Identifiers__c
                     FROM Account
                     WHERE Id = :account.Id];
                
                String[] legalIdentifiersForOrg = 
                    account.ts_Legal_Identifiers__c.split(';');
                
                if( legalIdentifiersForOrg != null && legalIdentifiersForOrg.size() != 0 ) {
                    
                    for( String legalId : legalIdentifiersForOrg ) {
                        
                        LegalIdRow legalIdRow = new LegalIdRow();
                        
                        legalIdRow.legalIdType = legalId.split(':').get(0).trim();   
                        legalIdRow.legalIdValue = legalId.split(':').get(1).trim();
                        legalIdRow.doEdit = false;
                        
                        legalIdRowList.add(legalIdRow);
                    }
                }
            }
            
            return legalIdRowList;
        }
        set;
    }
    
     public without sharing class LegalIdRow{
        public Boolean doEdit {get;set;}
        public String legalIdType {get;set;}
        public String legalIdValue {get;set;}
   } 
}