• Masahiro Kawata
  • NEWBIE
  • 10 Points
  • Member since 2015

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 4
    Questions
  • 3
    Replies
I have an outputField that will take in solid, unbroken lines of characters that cannot be modified. I want to display them on my page, but they can be very long - this messes up the page formatting. Is there some way of getting the outputField to render only the first 50 or so characters but still store the rest?

The datatype is 'Text Area (long)'.

Thank you.
I have a problem where a date field can be disabled by a checkbox, and this doesn't cause problems - unless it has a date value entered into it when the checkbox is clicked. If it is saved with a date in it, then any attempt to modify the page gives:

Error:
<apex:inputText> element value must resolve to a String type!

If the field is left blank, then disabled, this problem does not occur.
How do I disable 'Next_Intake__c' without causing this problem?
Here is the code:
<apex:pageBlockSectionItem >
            <apex:outputLabel value="Next Intake" for="Next_Intake"/>
            <apex:outputPanel id="panel2">
            <apex:inputField value="{!Grant__c.Next_Intake__c}"  rendered="{!Grant__c.On_going__c == false && Grant__c.Not_Accepting_Applications__c == false}"  id="Next_Intake"/><!--required-->
            <apex:inputText value="{!Grant__c.Next_Intake__c}" disabled="true" rendered="{!Grant__c.On_going__c == true || Grant__c.Not_Accepting_Applications__c == true}" />
            </apex:outputPanel>
            </apex:pageBlockSectionItem>

Thanks for your help.

 
Hi, I'm pretty new to Salesforce (had this job about 3 weeks) and I'm trying to set up a validation rule that prevents one particular user from creating an event anywhere but in opportunities.
Here's the logic on the validation rule:

CreatedBy.Id = "00530000002EKrz" 
&& 
NOT(LEFT(WhatId,3) = "006")

Now, when I try to create an event while logged in as this user, I get the following error message:

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Event_AfterInsert caused an unexpected exception, contact your administrator:
Event_AfterInsert: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0 with id 00UV0000001jJghMAE; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, This event must be associated with an opportunity.: []: Trigger.Event_AfterInsert: line 12, column 1

So it's having some kind of problem with 'Event_AfterInsert'. That's this:
 
trigger Event_AfterInsert on Event (after insert)
{
	For (Event e : trigger.new)
    {
        For (Account a : [Select Id, Region__c from Account where Id = :e.AccountId])
	    {
	        // Update the event record
			Event[] ev = [select id, Region__c from Event where id = :e.Id];
			ev[0].Region__c = a.Region__c;
			update ev[0];
	    }
    }
}

But I have no idea where to go from here.  The 'This event must be associated with an opportunity' part of the error message is exactly what I put as my validation rule's error message, which is also confusing me.

Any help would be greatly appreciated.
Thank you!
Hello,
I'm having a strange issue where, on the grants page, we cannot save any data. There's no error message, but when you click 'Save' and refresh, any changes you've made are not kept, and the Last Modified Date doesn't change. Other pages seem to be saving normally.
This has happened for Lead Gen and Dev accounts.
Any help or pointers are greatly appreciated.
Thank you
I have an outputField that will take in solid, unbroken lines of characters that cannot be modified. I want to display them on my page, but they can be very long - this messes up the page formatting. Is there some way of getting the outputField to render only the first 50 or so characters but still store the rest?

The datatype is 'Text Area (long)'.

Thank you.
Hi, I'm pretty new to Salesforce (had this job about 3 weeks) and I'm trying to set up a validation rule that prevents one particular user from creating an event anywhere but in opportunities.
Here's the logic on the validation rule:

CreatedBy.Id = "00530000002EKrz" 
&& 
NOT(LEFT(WhatId,3) = "006")

Now, when I try to create an event while logged in as this user, I get the following error message:

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger Event_AfterInsert caused an unexpected exception, contact your administrator:
Event_AfterInsert: execution of AfterInsert caused by: System.DmlException: Update failed. First exception on row 0 with id 00UV0000001jJghMAE; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, This event must be associated with an opportunity.: []: Trigger.Event_AfterInsert: line 12, column 1

So it's having some kind of problem with 'Event_AfterInsert'. That's this:
 
trigger Event_AfterInsert on Event (after insert)
{
	For (Event e : trigger.new)
    {
        For (Account a : [Select Id, Region__c from Account where Id = :e.AccountId])
	    {
	        // Update the event record
			Event[] ev = [select id, Region__c from Event where id = :e.Id];
			ev[0].Region__c = a.Region__c;
			update ev[0];
	    }
    }
}

But I have no idea where to go from here.  The 'This event must be associated with an opportunity' part of the error message is exactly what I put as my validation rule's error message, which is also confusing me.

Any help would be greatly appreciated.
Thank you!
Hello,
I'm having a strange issue where, on the grants page, we cannot save any data. There's no error message, but when you click 'Save' and refresh, any changes you've made are not kept, and the Last Modified Date doesn't change. Other pages seem to be saving normally.
This has happened for Lead Gen and Dev accounts.
Any help or pointers are greatly appreciated.
Thank you