• Raymond Airey
  • NEWBIE
  • 30 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 8
    Questions
  • 7
    Replies
Hi All,

I am very new to Apex coding and I am trying to learn how to add a custom picklist field to a Visualforce page.

I am trying to work with the below:
  • A customer field called "Type_of_Sales__c" within the standard OpportunityLineItem object
  • The custom field contains the following items
    • Sample
    • Normal Sales
    • Inspection Copy
    • Schools Direct
Using the below code, I'm able to display the Heading but not the list:
<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Type_of_Sales__c.Label}">
</apex:column>
I have tried using the following code, which again shows the heading but no list:
<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Type_of_Sales__C.Label}">
<apex:inputField value="{!OpportunityLineItem.Fields.Type_of_Sales__C}"
</apex:column>
All I'm am trying to do is display to customer picklist as you would normally see it on a page.

Any help would be great!
 

Hi All,

I currently have a situation where we have account billing/delivery details updated from an External system. Those delivery address details are then used to process orders through Salesforce. We then have a workflow rule that will automatically populate the address details from the account across to the order.

The issue I have is the fields for the delivery details are 'TEXT' fields (Account.BillingState) and one of the fields in the Opportunity is a Drop-Down and I am having trouble creating a workflow that will take the Text and update the Drop-Down. The other issue I have is that there is a lot of Apex code in the background so I am restricted to what I can do.

Any help would be appreicated.

Thanks,
 

Raymond

HI All,

We have decided to include a 'Postage and Handling' fee for all opportunities that are created under $100.

By that I want any opportunity that is created and saved under $100 to automatically added an opportunity product of 'POSTAGEHANDLING' with a price of $9.95.

Currently I have a process in place that automatically adds the freight Product into every opportunity but I need to create an APEX trigger that will delete the same product once the opportunity is greater than $100.

I havent had much experience in Apex so any help would be greatly appreciated.

Ray
HI All,

We have decided to include a 'Postage and Handling' fee for all opportunities that are created under $100.

By that I want any opportunity that is created and saved under $100 to automatically added an opportunity product of 'POSTAGEHANDLING' with a price of $9.95.

What (if any) would be the easiest way to achieve this? I have tried using a workflow but couldnt achieve the correct outcome.

Any ideas would be greatly appreicated.

Ray
Hi All,

I am trying to write a validation rule to make sure a phone number is entered in the correct format every time.

A phone number should be entered in the following format:
For Australian Customers - 00 1111 2222
For New Zealand Customers - 00 111 2222

I have been trying to recycle the below code to use with this rule, trying to use the REGEX function but I dont think that works.
OR( 
AND( 
OR( 
ShippingCountry = "VIC", 
ShippingCountry = "NSW", 
ShippingCountry = "ACT", 
ShippingCountry = "QLD", 
ShippingCountry = "SA", 
ShippingCountry = "WA", 
ShippingCountry = "TAS", 
ShippingCountry = "NT", 
ShippingCountry = "Australia" 
), 
NOT(ISPICKVAL(CurrencyIsoCode, "AUD")) 
), 
AND( 
ShippingCountry = "NEW ZEALAND", 
NOT(ISPICKVAL(CurrencyIsoCode, "NZD")) 
) 
)

Raymond
Hi All,

We currently use the classic version of Salesforce but are looking into moving to the Lighting platform. One of the things that is holding us back in that we currently have a javascript button on the Opportunities page which when clicked, creates an EDI file in the background that is sent for processing in an external system.

Below is the code currently used in the Javascript button:
{!REQUIRESCRIPT("/soap/ajax/10.0/connection.js")} 
{!REQUIRESCRIPT("/soap/ajax/10.0/apex.js")} 
var result = sforce.apex.execute("orderOutput","generate", {genericId:"{!Opportunity.Id}"}); 
window.alert(result ); 
window.location.reload(true);
Does anyone have any ideas what or how I could convert this into something compatible with Lightning?

Appreciate any help or guidance,

Raymond
Hi All,

We have run into a few issues lately where users of our salesforce instance are creating opporunities against accounts accounts that are 'Closed' are do not belong to us. I wont go into the reasons behind this as its quite complicated.

Bascially I'm trying to write a validation rule that will stop opportunities being created against Account numbers starting with '4' and/or accounts that are closed. These fields are currently not on the opportunity screen but do exist on the account screen.

Does anyone have any guidance as to how I can write the validation rule?
My scenario is we have a field on an Opportunity which stops an opportunity being put against the wrong sale type 'Bookseller_Order__C'. We have discussed that a certain group of users need to be exempt from the validation rule that has been setup. I have tried a few different variations, the last one I had working and the profile needing exemption could change the oppotunity back and forth but other profiles has issues trying to delete products.
OR(
                AND(
                                ISPICKVAL(Bookseller_Order__c, "Yes"),
                                Non_Bookseller_Products__c <> 0
                ),
                
                AND(
                                ISPICKVAL(Bookseller_Order__c, "No"),
                                Bookseller_Products__c <> 0
                )
)

TL:DR - I need to exempt a profile from the above validation rule. Can anyone help?
Hi All,

I am very new to Apex coding and I am trying to learn how to add a custom picklist field to a Visualforce page.

I am trying to work with the below:
  • A customer field called "Type_of_Sales__c" within the standard OpportunityLineItem object
  • The custom field contains the following items
    • Sample
    • Normal Sales
    • Inspection Copy
    • Schools Direct
Using the below code, I'm able to display the Heading but not the list:
<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Type_of_Sales__c.Label}">
</apex:column>
I have tried using the following code, which again shows the heading but no list:
<apex:column headerValue="{!$ObjectType.OpportunityLineItem.Fields.Type_of_Sales__C.Label}">
<apex:inputField value="{!OpportunityLineItem.Fields.Type_of_Sales__C}"
</apex:column>
All I'm am trying to do is display to customer picklist as you would normally see it on a page.

Any help would be great!
 
HI All,

We have decided to include a 'Postage and Handling' fee for all opportunities that are created under $100.

By that I want any opportunity that is created and saved under $100 to automatically added an opportunity product of 'POSTAGEHANDLING' with a price of $9.95.

Currently I have a process in place that automatically adds the freight Product into every opportunity but I need to create an APEX trigger that will delete the same product once the opportunity is greater than $100.

I havent had much experience in Apex so any help would be greatly appreciated.

Ray
HI All,

We have decided to include a 'Postage and Handling' fee for all opportunities that are created under $100.

By that I want any opportunity that is created and saved under $100 to automatically added an opportunity product of 'POSTAGEHANDLING' with a price of $9.95.

What (if any) would be the easiest way to achieve this? I have tried using a workflow but couldnt achieve the correct outcome.

Any ideas would be greatly appreicated.

Ray
Hi All,

We have run into a few issues lately where users of our salesforce instance are creating opporunities against accounts accounts that are 'Closed' are do not belong to us. I wont go into the reasons behind this as its quite complicated.

Bascially I'm trying to write a validation rule that will stop opportunities being created against Account numbers starting with '4' and/or accounts that are closed. These fields are currently not on the opportunity screen but do exist on the account screen.

Does anyone have any guidance as to how I can write the validation rule?