• kitsunebrave
  • NEWBIE
  • 0 Points
  • Member since 2016
  • Salesforce Developer
  • ABB


  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 7
    Replies
What does this error mean?
Below the debug log with the entire Log Name:
User-added image
I have been working on a custom functionality to clone mass asset by specific product vesion. I have two visualforce pages: AssetProduct_ManualClone_ResultPage and AssetProduct_ManualClonePage when I click on the Previous Page button on my AssetProduct_ManualClone_ResultPage the system quickly prompt the error message and prevent me to load to another page. Is this related to a Profile issue? How can I avoid this error in my controller or in my visualforce page with another solution without giving Write Access to my User on the Product2 in the production org? Any ideas why is preventing my User reload the AssetProduct_ManualClonePage.
public PageReference back(){
        return Page.AssetProduct_ManualClonePage;
    }
Here is the screenshot with the prompt error message:
User-added image

Please if anyone knows about this issue and already done with beatiful solutions let me know.
Thanks
hi,
I have a custom clone button from a Support Order custom detail page and I am retrieving an Opportunity with Partners to clone a new support order with a new Opportunity using profile different than Sys Administrator such as New Profile without Sys Admin permission setting eg: below

1. Ventyx Finance/Accounting (it is not a sys admin)
2. Ventyx Finance/Accounting Manage with report (it is not a sys admin)

I am getting a error message Is Invalid field IsPrimary from the standard Partner object in salesforce.com. This field seems like any not sys admin does not have access to that object to be cloned.

Also I tried changing the Organization Wide-Default OWD and that did not avoid the error. It seems like I do not have visiable Partner object setting to add spefici permission set to partner fields such as Primary or Active or wherever salesforce does not provide User Interface to make those changes.

There is a work around to avoid this issue and sucessfully clone a Partner record? Please help me with this problem.
Thanks.
Debug log output:
15:15:52.27 (1287536739)|USER_DEBUG|[503]|DEBUG|>>>>>>saveFunctionality ExceptionInvalid field IsPrimary
15:15:52.27 (1287581051)|USER_DEBUG|[504]|DEBUG|>>>>>>saveFunctionality Exceptionnull
15:15:52.27 (1287611412)|USER_DEBUG|[505]|DEBUG|>>>>>>saveFunctionality Exception597
15:15:52.27 (1287634702)|USER_DEBUG|[506]|DEBUG|>>>>>>saveFunctionality ExceptionClass.SupportOrder_ManualCloneController.insertOpp: line 597, column 1
Class.SupportOrder_ManualCloneController.saveFunctionality: line 210, column 1
Class.SupportOrder_ManualCloneController.save: line 160, column 1
15:15:52.27 (1287815984)|USER_DEBUG|[507]|DEBUG|>>>>>>saveFunctionality ExceptionSystem.SObjectException
15:15:52.27 (1287946803)|VF_PAGE_MESSAGE|Invalid field IsPrimary null 597 Class.SupportOrder_ManualCloneController.insertOpp: line 597, column 1
Class.SupportOrder_ManualCloneController.saveFunctionality: line 210, column 1
Class.SupportOrder_ManualCloneController.save: line 160, column 1 System.SObjectException
following is a code portion when the error message display as well as the screenshot with the error.
for(Integer i=0;i<lstOPT.size();i++){
            if (lstOPT.get(i).IsPrimary != null) {
                System.debug('>>>>>>>Manual Clone: '+lstOPT.get(i).IsPrimary);
                Partner opt2 = new Partner();
                Boolean primary = OpportunityPartner.IsPrimary.getDescribe().isUpdateable();
                System.debug('Manual Clone Partner Describe field: '+primary);
                Boolean creatable = true;
                opt2.IsPrimary = lstOPT.get(i).IsPrimary;
                //opt2.AccountFromId = opt.AccountFromId;
                opt2.AccountToId = lstOPT.get(i).AccountToId;
                opt2.OpportunityId = opp.Id;       
                opt2.Role = lstOPT.get(i).Role; 
            
                newLstOPT.add(opt2);
            }   
        }
        if (!newLstOCR.isEmpty()) {
            insert newLstOCR;
        }
        
        if (!newLstOPT.isEmpty()) {
            insert newLstOPT;
        }
        upsert opp;
        return opp.Id;
    }

IsPrimary exception
Hi everyone,

Regarding Visualforce, force.com and Javascript development. Basically, I have two table primary and secondary. I want to retrieve the Product Info from a primary table and show to a secondary table. The Wrapper logic is completed, however, I need to display multiple selection based on one or more selected Products. Here is the Partial visualforce page, Javascript resource and the apex method.

Therefore, I need to refresh/onchange the checkbox based on specific event "selected" "removed" "multiselection" filter values.

I am waiting from anyone to answer this question regardless the post question https://developer.salesforce.com/forums/?id=906F00000009683IAA by @Surjendu, @kmccoll and @TehNrd. How can complete and avoid this issue basically to have a Specific Salesforce Product based on the selection of the Product Checkbox.

Please, follwing is the related code snippets regarding my issue:

Visualforce Page:
 
<table width="100%" border="2">
  <tr>
      <td width="75" valign="top" ><b>Search by Product</b>
           <div style="overflow:auto; height:250px;">
              <apex:pageBlockTable title="Search by Product Table" value={!ProductFilters}" var="productrecord" id="productsList">
                  <apex:column style="width:25px" >
                     <apex:inputCheckbox id="productLine1" onclick="showContent(this)" value="{!productrecord.selectedProduct}" />
                   </apex:column>
                   <apex:column style="width:50px" onclick="uncheckOther('productLine1')" value="{!productrecord.filter.Entitlement}" >
                   </apex:column>
               </apex:pageBlockTable>
            </div>
         </td>
    </tr>
</table>
<table width="100%" border="2" id="splitTable">
   <tr>
       <td width="100%" valign="top">
          <div id="content" style="overflow:auto; height:400px; display: block">
               <apex:pageBlockTable title="Results of the selection of Version/Entitlement Products on the initial page" value="{!displayItems}" var="record" id="displayListing">
                   <apex:column style="width:25px" >
                       <apex:facet name="header">
                         <apex:inputCheckbox id="displayChkBx" onclick="checkAll('productLine1','{!$Component.displayListing}', 'displayItemsLine1')" />
                       </apex:facet>
                         <apex:inputCheckbox value="{!record.selected}" id="selectLine1" />
                    </apex:column>
                    <apex:column id="colVersion" style="width:60px" value="{!record.dispItem.ProductVersion}" headerValue="Release Version">
                    </apex:column>
               </apex:pageBlockTable>
             </div>
          </td>
     </tr>
</table>
Apex Method:
 
public class productfilterWrapper{
        public V1_NoteSelectionItems filter {get; set;}
        public Boolean selectedProduct {get; set;}
        public productfilterWrapper(V1_NoteSelectionItems a)
        {
            filter = a;
            selectedProduct = false;
        }
    }

public void filterBySelections(){
		selectionItemsListing.SetSelectedItemsList(collectSelectedProducts());			
	}

public Set<String> collectSelectedProducts() {
    	Set<String> allProducts = new Set<String>();
        this.selectedProductFilters.clear();
        for(productFilterWrapper productWrapper : this.productFiltersList)
        {
            if(productWrapper.selectedProduct == true)
            {
	        	System.debug('Product selected: ' + productWrapper.filter.Entitlement);
        		allProducts.add(productWrapper.filter.Entitlement);
            	this.selectedProductFilters.add(productWrapper.filter);
            }
        }
        return allProducts;
    }
JS:
 
function showContent(chkboxCtrl){
	try{
		Product = document.getElementById('{!$Component.frm.secondTable.bottomTableId.splitTable.content.displayListing.colProduct}');
  		Version = document.getElementById('{!$Component.frm.secondTable.bottomTableId.splitTable.content.displayListing.colVersion}');
  		Component = document.getElementById('{!$Component.frm.secondTable.bottomTableId.splitTable.content.displayListing.colComponent}');
  		Backlog = document.getElementById('{!$Component.frm.secondTable.bottomTableId.splitTable.content.displayListing.colBacklog}');
		if (chkboxCtrl.checked){
			if(Product != null)
				Product.style.display = 'block';
			else
				Product.style.display = 'none';
			if(Version != null)
				Version.style.display = 'block';
			else
				Version.style.display = 'none';
			if(Component != null)
				Component.style.display = 'block';
			else
				Component.style.display = 'none';
			if(Backlog != null)
				Backlog.style.display = 'block';
			else
				Backlog.style.display = 'none';
		}			
		else
			document.getElementById('{!$Component.frm.secondTable.bottomTableId.splitTable.content.displayListing}').style.display = 'none';
	}
	catch(e){
		alert(e);
	}	
}
/*uncheck content and checkbox*/
var selectedChkbox;

function uncheckOther(chkboxCtrl){
	if(chkboxCtrl.checked){
		if((chkboxCtrl != selectedChkbox) && (selectedChkbox != null)){
			selectedChkbox = false;
		}
		selectedChkbox = chkboxCtrl;
	}
}

Please, any solution, partial post or any things related to this, let me know.

Thanks in advance.

kitsunebrave

 
Hi,

I would like to pass a list of attributes from an SObject inside the after insert trigger.

Below is my code:
 
trigger Milestone_Tasks_Creation_Trigger on Milestone1_Milestone__c (after insert) {
    
    
    List<Milestone1_Task__c> tasks = new List<Milestone1_Task__c>();
    
    List<String> names = new List<String>{'Charter', 'Discovery', 'Impact Analysis', 'Design', 
    									  'Risk Assessment/Contigency Plan', 'User Acceptance Testing', 
    									  'Producition Approval', 'Survey'};
    
    for(Milestone1_Milestone__c milestone : Trigger.New){
    	//Milestone1_Milestone__c milestone = Trigger.New;
    	// Filling out Apporval Task:Impact, test, all rest
    	//for example:
    	
    	Milestone1_Task__c task = new Milestone1_Task__c(Milestone1_Milestone__c = milestone.ID);
    	task.Name = names;
    	task.Complete__c = false;
    	task.Priority__c = '0';
    
    	tasks.add(task);
    }
    insert tasks;
}

 
Hi,

I would like to pass a list of attributes from an SObject inside the after insert trigger.

Below is my code:
 
trigger Milestone_Tasks_Creation_Trigger on Milestone1_Milestone__c (after insert) {
    
    
    List<Milestone1_Task__c> tasks = new List<Milestone1_Task__c>();
    
    List<String> names = new List<String>{'Charter', 'Discovery', 'Impact Analysis', 'Design', 
    									  'Risk Assessment/Contigency Plan', 'User Acceptance Testing', 
    									  'Producition Approval', 'Survey'};
    
    for(Milestone1_Milestone__c milestone : Trigger.New){
    	//Milestone1_Milestone__c milestone = Trigger.New;
    	// Filling out Apporval Task:Impact, test, all rest
    	//for example:
    	
    	Milestone1_Task__c task = new Milestone1_Task__c(Milestone1_Milestone__c = milestone.ID);
    	task.Name = names;
    	task.Complete__c = false;
    	task.Priority__c = '0';
    
    	tasks.add(task);
    }
    insert tasks;
}

 
Hello Experts,

We have a integration between salesforce and SAP via SAP PI. The external system is using HTTPS protocol and has asked if any other set up is required to have a secure connection while triggering outbound messages from SAP to salesforce.

This is when certificates come to my mind. We have both inbound as well as outbound integration between the systems.
I would want to know if:
1.While sending outbound messages from salesforce the certificate generated and provided by the external system has to be used in SOAP callouts. Correct?
2.When the external system sends outbound messages from SAP to salesforce, we need to generate and provide them CA signed certificate,which they will sign and send back to us. We then upload it in salesforce and the external system uses it while sending outbound messages from SAP to salesforce? Is my assumption correct?
3. Also i wish to know the difference between self signed and CA signed certificates and why should we not use self signed instead of CA signed?

Any help is appreciated

Regards,
SFDC coder

I am trying to achieve a simple thing but somehow not able to get the desired result, may be due to my amateur CSS skills.

I have an apex:inputcheckbox and all I want is, when someone selects this checkbox, the CSS of accompanying should change i.e., just to show this one is highlighted. Just want to make it bold and different colour. Here is my sample:

 

<apex:pageBlockSectionItem > 
            <apex:inputCheckbox value="{!Dept2}" label="">Elektron
                <apex:actionsupport event="onchange" action="{!getSomething}" rerender="working" />     
            </apex:inputCheckbox>   
</apex:pageBlockSectionItem>

 

The inputcheckbox is a subsection in pageBlockSectionItem. There are 10 items for the user to select and I want to highlight which one he has selected. When I display "Elektron" in the label, it doesn't show you up on the screen.

The function getSomething is an apex page-reference function and displays result in another PageBlockSection depending upon user selection

It doesn't matter if we use jquery or not, although I believe this can be achieved without query.

Many thanks in advance.

  • October 21, 2013
  • Like
  • 0

Hi all,

 

I want to ask is it possible for trigger / apex class to not call validation rule? My case is, I want my validation rules to be run when only users create / update some records in the object from web ui but NOT in trigger / apex class, meaning only from trigger / apex class ignore the active validation rule. Are there any ways to achieve my goal?

 

Second question, is validation rule can be configured in profile? My second case is, for example the validation rule named 'checked by admin' only affected for system admin profile, the standard user profile is not affected by that validation rule.

 

Any suggestions would be great..

Thanks...

  • September 20, 2011
  • Like
  • 0

This is a knowledge repository sort of posting.  No help is needed.  I put it here because it would have been nice to find it when I was trying to figure out what was happening.

 

If you're coding Apex in Eclipse and you make a change to an Object via the Salesforce UI and you forget to refresh the Object in your Eclipse workspace, you may get a message with this obscure reference to a MetadataELAdapter which I presume has something with Metadata elements.

 

In my case I was passing an instance of the object to a constructor of another class.  There may be other circumstances which give rise to this message, but that's what I was trying to do and I couldn't understand why it was failing.  Note, that it compiled fine, and the VF page started up fine, etc.  I ran into this in the Controller constructor where I was pre-loading data.

 

So, just refreshing the Object in Eclipse clears it all up.  Unclear to me why the state of the Eclipse object should effect code that's being uploaded and then compiled on the server, but...

 

Either way, I hope this saves someone some time.  Steve.

 

 

My code works like this. I have n number of Lead objects. When I click a checkbox I am trying to pass the value to a javascript function. It is not working. Any help. Also How do i achieve this functionality?

<apex:page controller="registerDomainController" tabStyle="Lead">
<script>
function addUsers(userid)
{
var idsToAdd = new Array();
alert('Before adding' + userid);
idsToAdd.add(userid);
}
</script>
<apex:sectionHeader title="Add User">
<apex:form>

<apex:pageBlock>
<apex:facet name="footer">

<apex:pageBlockSection title="Add Users to the Extranet">
<apex:dataTable value="{!allLeads}" var="user" cellspacing="0" cellpadding="4" border="0" width="800px">
<apex:column>
<apex:facet name="header">First Name</apex:facet>
<apex:outputText>{!user.firstname}</apex:outputText>
</apex:column>
<apex:column>
<apex:facet name="header">Last Name</apex:facet>
<apex:outputText>{!user.lastname}</apex:outputText>
</apex:column>
<apex:column>
<apex:facet name="header">Email Address</apex:facet>
<apex:outputText>{!user.email}</apex:outputText>
</apex:column>
<apex:column>
<apex:facet name="header">Phone number</apex:facet>
<apex:outputText>{!user.phone}</apex:outputText>
</apex:column>
<apex:column>
<apex:facet name="header">Add User</apex:facet>
<apex:inputCheckbox value="{!user.id}" onclick='addUsers({!user.id})'/>
</apex:column>

</apex:dataTable>

</apex:pageBlockSection>

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