• rubixtious
  • NEWBIE
  • 50 Points
  • Member since 2009

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 15
    Replies

I tried searching for this simple formula but could not find anything that would work for me.

 

We have an account code that needs to be manually entered by a user. The field is 12 characters long and should not have any spaces in it. 

 

I tried

 

CONTAINS(Account_Code_c,"")

 

but it doesn't save on anything.

 

What other formula can I use?

 

Thanks in advance

  • November 24, 2009
  • Like
  • 0

When adding a new "Public Comment" to a case, the client is notified to login to their self-service portal to view the comment. Is there an email field to place into template that lists the actual comment made to the client? I do not see a field like "Last Public Case Comment", etc.

We'd like this email to look much like the email notfications that are sent directly to the case owner if someone internal places a comment on the case.

This functionality is desired so clients do not need to log in to their self service portal to view a simple update to one case.

 

Any thoughts?

 

<apex:pageBlockSectionItem >

 <apex:outputPanel id="pnlRecommendedNda">

<apex:outputLabel value="Recommended NDA" for="lnkRecommendedNda" rendered="{!currentContract.NDA_In_Place__c == 'No'}" /> </apex:outputPanel>

<apex:outputPanel id="pnlRecommendedNda2" >

<apex:outputLink value="{!nda.NDALink__c}" id="lnkRecommendedNda" rendered="{!currentContract.NDA_In_Place__c == 'No'}" target="_blank">{!NdaRegionForContent}</apex:outputLink>

</apex:outputPanel>

</apex:pageBlockSectionItem>

 

private void GetNdaLink(){ string queryString; string docId; if(currentContract.Region__c == 'US' || currentContract.Region__c == 'CA' || currentContract.Region__c == 'MX') queryString = 'NDA US'; docId = [Select c.Title, c.Id From ContentVersion c where c.Title=:queryString].id; nda.Nda_Link__c = 'sfc/#version?selectedDocumentId='+docId; }

 

 

 

 

 I am trying to link out to a document in Content from a VF page.  The problem is the URL when using a URL field type turns out to be this:

https://c.cs2.visual.force.com/apex/sfc/#version?selectedDocumentId=068R0000000CeNMIA0

 

but I need this:

https://cs2.salesforce.com/sfc/#version?selectedDocumentId=068R0000000CeNMIA0

 

 

Is it possible to use SOQL to query Content objects?  Specifically, I want to provide a dynamic link on a page to a document in content.

We have overidden our new and edit buttons for Cases to go to a custom visualforce page.  This was fine until now we want to utilize Record Types.  Now, regardless of the record type chosen, new cases go to the custom visualforce page instead of the page layout for the record type.  I am thinking that I need another VF page to act as a proxy to route the user to the correct page.  I have read a couple of forum posts but am unsure if they are applicable to my problem.

 

http://forums.sforce.com/sforce/board/message?board.id=Visualforce&thread.id=4875

I have 200+ outbound messages that I want to delete.  I see that I can delete them individually through the UI.  Can use APEX to get these items into list object and then delete the list?

 

 

Hi,

 

I have a custom button (Remove Contact) on my Standard Contact Object, which when clicked does a Logical deletion.

I have implemented this using VisualForce Page and a controller extension that extends standard "Contact" object.

 

So, i am overriding the "Remove Contact"  button with my visualforce page. when i click on the button it executes the business logic and displays the VF page accordingly.

 

But, my use-case also requires to prompt a "User Confirmation" like "Do you want to remove". Based on the user response then i have to carry out my business logic. I think we need to use Java script for this when i override "Remove Contact".

But how do i call my VF page after capturing the User response on the confirmation.

 

Here is my VF page:

 

<apex:page standardController="Contact"  extensions="Inactiveandmove" action="{!Move}"  >


</apex:page>

Any help on this is highy appreciated.

 

Thank You!

 

How do you create a new record on an object different from the trigger?

 

More specifically whenever I create a record in 1 object, I want to create a corresponding record in another object.

 

So far I have the following, but I get an error:

System.NullPointerException: Attempt to de-reference a null object

 

 

 

trigger UpdateLabor_After on Labor__c (after insert, after update) { String RelatedLabor = null, RelatedSchool = null, RelatedDistrict = null, temp_id = null; Labor__c[] labor = trigger.new; RelatedSchool = labor[0].Related_School__c; RelatedDistrict = labor[0].Related_District__c; if(System.Trigger.isinsert) { Student_Attendance_Labor__c [] newrecord; RelatedLabor = labor[0].Id; newrecord[0].Related_Labor__c = RelatedLabor; newrecord[0].Related_School__c = RelatedSchool; newrecord[0].Related_District__c = RelatedDistrict; insert newrecord [0]; }

 

 The error looks like its related to the line:

	Student_Attendance_Labor__c [] newrecord;

 

How do I define a record that doesn't yet exist?

 

  • February 18, 2010
  • Like
  • 0

I am building an ultra-basic VF page with what should be an ultra-basic custom controller.

 

Hereis the code:

public class AMTransfer { public Account[] EligibleAccts; public AMTransfer() { } public Account[] getEligibleAccts() { if (!EligibleAccts.isEmpty()) EligibleAccts = [SELECT id, Name FROM Account WHERE Eligible_For_Transfer__c = 'Yes' limit 1]; system.debug('EligibleAccts size is '+EligibleAccts.size()); return EligibleAccts; }

 

The VF Code:

 

<apex:page Controller="AMTransfer" sidebar="false">
    <apex:form >
       <apex:pageBlock >
            <apex:pageMessages />
            <apex:pageBlockTable value="{!EligibleAccts}" var="acc">
                <apex:column value="{!acc.name}"/>                               
            </apex:pageBlockTable>     
        </apex:pageBlock>
    </apex:form>
</apex:page>

Simple, right? Now I know that there is 1 Account that meets the criteria in the query. But when I run the page:

 

/apex/AMTransfer

 

I get an Attempt to de-reference a null object

error.  My debug logs say that the process was a success, and doesn't give the system.debug message, which implies that the getEligibleAccts method isn't running. So I don't know to which null object the error message is referring.

 

What am I missing?? I haven't done any VF in a while and am probably missing something obvious, but if someone can point it out, it may save me a great deal of frustration, except for what I'm going to get from not seeing the error in the first place.

 

Thanks

Hello I am trying to use an Apex trigger to create Sharing on a custome object with a Customer Portal User referenced on the object.  Unfortunately I can only get to the Contact ID, but I want to retrieve the Contact's Customer Portal User ID, can anyone help?  Here is my code currently:

 

trigger BusinessApexShare on Participant_ID_Request__c (before update) { if(trigger.isUpdate) { List<Participant_ID_Request__Share> pidshr = new List<Participant_ID_Request__Share>(); Participant_ID_Request__Share bshr; for(Participant_ID_Request__c pid : trigger.new) { bshr = new Participant_ID_Request__Share(); bshr.ParentId = pid.Id; bshr.UserOrGroupId = pid.Business_Approver__c; bshr.AccessLevel = 'edit'; bshr.RowCause = Schema.Participant_ID_Request__Share.RowCause.ID_REQUEST_Business_Share__c; pidshr.add(bshr); } Database.SaveResult[] lsr = Database.insert(pidshr,false); Integer i=0; for(Database.SaveResult sr : lsr){ if(!sr.isSuccess()){ Database.Error err = sr.getErrors()[0]; if(!(err.getStatusCode() == StatusCode.FIELD_INTEGRITY_EXCEPTION && err.getMessage().contains('AccessLevel'))){ trigger.newMap.get(pidshr[i].ParentId). addError('Unable to grant sharing access due to the following exception: ' + err.getMessage()); } }i++; } } }

 When I try to save the record, I get the following error: "User/Group ID: id value of incorrect type"

 

 

  • February 10, 2010
  • Like
  • 0

I want to write an if statement like

if( x==1||x==2||x==3){}

Is it possible to write it like

if(x in [1,2,3]){}

or something similar...

if yes,please let me know how....

 

Thanks,

Hi Everyone,

 

I want to populate the data table record value to inputtext field.it means dataTable is one page and input text field in another page.

 

Plz tell me the way through which concept we can achieve this.

 

Thanks ,

Manu..

  • December 11, 2009
  • Like
  • 0
Is it possible to put user's profile check in Trigger as we do in Validation rule(eg $Profile.Name ='System Administrator')

I tried searching for this simple formula but could not find anything that would work for me.

 

We have an account code that needs to be manually entered by a user. The field is 12 characters long and should not have any spaces in it. 

 

I tried

 

CONTAINS(Account_Code_c,"")

 

but it doesn't save on anything.

 

What other formula can I use?

 

Thanks in advance

  • November 24, 2009
  • Like
  • 0

When adding a new "Public Comment" to a case, the client is notified to login to their self-service portal to view the comment. Is there an email field to place into template that lists the actual comment made to the client? I do not see a field like "Last Public Case Comment", etc.

We'd like this email to look much like the email notfications that are sent directly to the case owner if someone internal places a comment on the case.

This functionality is desired so clients do not need to log in to their self service portal to view a simple update to one case.

 

Any thoughts?

Currently, I have the default Case pages overridden. I have users that fall into a few different categories that all need to be able to create or manage cases.

 

1. Internal users in role abc.

2. Internal users in role xyz.

3. 3rd party contractors. 

4. Customer Portal users. 

 

And the list keeps growing, and growing.

 

Currently, the way I deal with this is to use one page as the overriding page, and within the page have code like this:

 

<apex:include pageName="pageNameabc" rendered="{!$user.ProfileId == 'abc123'}">

 

<apex:include pageName="pageNamexyz" rendered="{!$user.ProfileId == 'xyz123'}">

 I am not a fan of this implementation. Hard coding Id's is not ideal, but I've not found a better way to achieve what I need.

 
Message Edited by ehartye on 11-24-2009 08:49 AM

We have overidden our new and edit buttons for Cases to go to a custom visualforce page.  This was fine until now we want to utilize Record Types.  Now, regardless of the record type chosen, new cases go to the custom visualforce page instead of the page layout for the record type.  I am thinking that I need another VF page to act as a proxy to route the user to the correct page.  I have read a couple of forum posts but am unsure if they are applicable to my problem.

 

http://forums.sforce.com/sforce/board/message?board.id=Visualforce&thread.id=4875

Hi,
 
I need to override the standard edit page for a custom object. If the status of the custom object record is "Approved", then I do not want users to edit the record, else I need to redirect the users to the standard edit page for this record.
 
I have the following code in VF and controller. I can see the the URL is changed to the edit page URL when I click the edit button after overiding the button with the VF page, but the standard edit page is not getting displayed. Insatead the word Hello is getting displayed.
 
VF Code:
<apex:page standardController="Fixture_Order__c" extensions="conSEditOverrideFixtureOrder" 
id="mypage">
Hello
</apex:page>

 
Controller Code:
public class conSEditOverrideFixtureOrder {
Fixture_Order__c fixordobj; 

private String vid; 


public conSEditOverrideFixtureOrder(ApexPages.StandardController controller) { 

this.vid = ApexPages.currentPage().getParameters().get('id'); 
reset();

} 

public PageReference reset() { 

if(fixordobj.Approval_Status__c=='Approved'){
 PageReference editPage = new PageReference('/'+this.vid+'/e—retURL=' + this.vid);
 editPage.setRedirect(true);
 return editPage;
}else{
PageReference errPage = new PageReference('/apex/editFixtureOrderError');
 errPage.setRedirect(true);
 return errPage;
 
}

return null; 

} 

public String getApprovalStatus(){
 return this.fixordobj.Approval_Status__c;
}

public Fixture_Order__c getFixtureOrder() { 

if(fixordobj == null) reset(); 

return fixordobj; 

} 


public void setLead(Fixture_Order__c leaddet) { 

fixordobj = leaddet; 

} }

 

Can anyone please help to understand the cause? Appreciate all your valuable feedbacks.

Thanks and regards,
Ambili
  • September 02, 2008
  • Like
  • 0