• bzain9
  • NEWBIE
  • 60 Points
  • Member since 2017

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 5
    Replies
I am new when it comes to visualforce and creating custom controllers. 

I have a problem to solve where each Account needs the ability to quickly add an Invoice with only 1 Invoice line item. The ask is to be able to click a button on the Account and be prompted to enter the quantity prior to creating the invoice. 
The result should be after the quantity is entered, an Invoice record is created with 1 Invoice line item showing the fields price and quantity.

Help with how the code should be written would help a lot.

 
Validation Rule: Length Must be 9 Digits, and 9 Digits only, (it is a text field). AND the value should also be able to save (not fire error message) if there is no value in the field (NULL). I have tried several attempts, and while testing the validation rule, I have not been able to get the Null Value part to work. Validation error message is firing for 9 Digits only, and be restricted to 9 digits only, but not null... Any help would be awesome!

OR(
     NOT(
         ISNUMBER(
                  Employer_ID_No_EIN__c
                 )
        ),
    AND(
        NOT(
            ISBLANK(
                     Employer_ID_No_EIN__c
                   )
           ),   
       
        
        ISNUMBER(Employer_ID_No_EIN__c), 
        LEN(Employer_ID_No_EIN__c) <>9
          
       )
)
  • August 09, 2018
  • Like
  • 0
I have created a visualforce page to redirect users who click the "New" Button on the Account tab back to home page giving an error at the top of the screen that they are not allowed to make a new Account. When I implemented and tested, this held true but now I face the challenge of allowing certain user profiles that should be allowed to make the new account using the button, and the others that shouldn't be able to make a new account using a button.What would I add/change in the visualforce page to let this happen?

Here is the code:

<apex:page standardcontroller="Account" showHeader="true" tabStyle="Account" > 
<p style="color:white;font-size:6px;"> 
<apex:form > 
<apex:pageBlock > 
<apex:pageMessage summary="Please create new accounts via the lead conversion process." severity="info" strength="3" /> 
<apex:pageMessages /> 

</apex:pageBlock> 
</apex:form> 
<apex:sectionheader title="Accounts" subtitle="Home"></apex:sectionHeader> 
</p> 

<!-- <apex:ListViews type="Account" /> --> 
<apex:enhancedList type="Account" height="730" rowsPerPage="25"/> 
</apex:page>
 
I am looking to create a VF page exactly same of the Account List page just without the "New Button". How would I go about creating this? Sample code would be great!

Here is my first try at it!

<apex:page standardController="Account">
    <apex:form >
        <apex:pageBlock title="Account Details">
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockSection >
                <apex:inputField value="{!Account.Name}"/>
                <apex:inputField value="{!Account.AccountNumber}"/>
                <apex:inputField value="{!Account.Type}"/>
                <apex:inputField value="{!Account.NumberOfEmployees}"/>
                <apex:inputField value="{!Account.Industry}"/>
                <apex:inputField value="{!Account.Phone}"/>
            </apex:pageBlockSection>
        </apex:pageBlock>
    </apex:form>
    
</apex:page> 
I need to create a validation rule when users create an opportunity from quotes and the selected quotes have different currencies. How would I go about adding a Currency validation rule when creating an opportunity from quotes? Sample code would be great!
How would I go about creating a new VF page to execute when "New Account" is clicked on the Account Tab. Just the generic look. Sample code would be great!
The requirement is that I am able to see the Opportunity Amount populated with the roll-up amount from Opportunity Line Items and the original Estimated Amount value cannot be modified when a quote exists so that I can manage my pipeline. My question is how would I create a Opportunity validation rule with related quote? An example would be great!
How would I create an apex trigger - Estimated Amount Roll Up (No Quote)? Sample code would be great!
How would I create a gross margin % trigger? Sample code would be great!
How would I go forth and create an Opportunity Validation Rule with Related Quote? A sample example would be great!
I am new when it comes to visualforce and creating custom controllers. 

I have a problem to solve where each Account needs the ability to quickly add an Invoice with only 1 Invoice line item. The ask is to be able to click a button on the Account and be prompted to enter the quantity prior to creating the invoice. 
The result should be after the quantity is entered, an Invoice record is created with 1 Invoice line item showing the fields price and quantity.

Help with how the code should be written would help a lot.

 
Validation Rule: Length Must be 9 Digits, and 9 Digits only, (it is a text field). AND the value should also be able to save (not fire error message) if there is no value in the field (NULL). I have tried several attempts, and while testing the validation rule, I have not been able to get the Null Value part to work. Validation error message is firing for 9 Digits only, and be restricted to 9 digits only, but not null... Any help would be awesome!

OR(
     NOT(
         ISNUMBER(
                  Employer_ID_No_EIN__c
                 )
        ),
    AND(
        NOT(
            ISBLANK(
                     Employer_ID_No_EIN__c
                   )
           ),   
       
        
        ISNUMBER(Employer_ID_No_EIN__c), 
        LEN(Employer_ID_No_EIN__c) <>9
          
       )
)
  • August 09, 2018
  • Like
  • 0
How would I create a gross margin % trigger? Sample code would be great!