• BDouglas
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 5
    Replies
  • Become a subject matter expert in the Force.com Platform, with in-depth knowledge of the schema, API calls, and debugging techniques.
  • Lead technical courses including beta versions of Force.com Platform courses and train-the-trainer sessions.
  • Participate in team development projects, utilizing peer review and project management skills to drive completion of a valuable education asset.
  • SharePoint development and maintenance.
  • Produce SQL reports.
  

I get save error: Illegal assignment from String to Decimal for the following code in a trigger using API version 18.0

 

 

trigger updateContactTotalSales on Opportunity (after insert, after update) { AggregateResult[] opportunityTotal = [SELECT SUM(Amount) FROM Opportunity]; }

 

 

 

 

 

Anyone know why? 

 

 

Hi,

 

When I add the oncomplete attribute to my command button my form loses any inputed information.

 

 

<apex:page id="marketingRequestpage" standardController="Contact" extensions="MarketingRequestController" sidebar="false" showheader="false" >

<script type="text/javascript">

function closeForm()
{
alert("Marketing Request Submitted");
// top.window.close();

}

function refreshWindow()
{
opener.location.reload();
}

</script>

<apex:form >

<apex:pageBlock title="{!RequestContact.Name}" id="pbcontact">
<table width="100%" >
<tr>
<td width="25%"><b><apex:outputLabel value="Care Of" for="CareOf"/></b></td>
<td ><apex:inputText id="CareOf" value="{!CareOf}" style="width:200px;height:20px;"/></td>
</tr>
<tr>
<td width="25%"><b><apex:outputLabel value="Street" for="MailingStreet"/></b></td>
<td ><apex:inputTextArea id="MailingStreet" value="{!MailingStreet}" style="width:200px;height:50px;"/></td>
</tr>
<tr>
<td width="25%"><b><apex:outputLabel value="City" for="MailingCity"/></b></td>
<td ><apex:inputText id="MailingCity" value="{!MailingCity}" style="width:200px;height:20px;"/></td>
</tr>
<tr>
<td width="25%"><b><apex:outputLabel value="State" for="MailingState"/></b></td>
<td ><apex:inputText id="MailingState" value="{!MailingState}" style="width:200px;height:20px;"/></td>
</tr>
<tr>
<td width="25%"><b><apex:outputLabel value="Postal Code" for="MailingPostalCode"/></b></td>
<td ><apex:inputText id="MailingPostalCode" value="{!MailingPostalCode}" style="width:200px;height:20px;"/></td>
</tr>
<tr>
<td width="25%"><b><apex:outputLabel value="Country" for="MailingCountry"/></b></td>
<td ><apex:inputText id="MailingCountry" value="{!MailingCountry}" style="width:200px;height:20px;"/></td>
</tr>

<apex:actionRegion >
<tr>
<td width="25%"><b><apex:outputLabel value="Request Type" for="RequestType"/></b></td>
<td> <div class="requiredInput"><div class="requiredBlock"></div>
<apex:selectList id="RequestTypes" value="{!selectrequesttype}" multiselect="false" size="1">
<apex:selectOption itemLabel="-None-"/>
<apex:selectOptions value="{!itemsrequesttype}"/>
<apex:actionSupport event="onchange" action="{!queryMaterials}" rerender="ShippingOption,theTabPanel" />
</apex:selectList></div>
</td>
</tr>

<tr>
<td width="25%"><b><apex:outputLabel value="Shipping Option" for="ShipOption"/></b></td>
<td> <div class="requiredInput"><div class="requiredBlock"></div>
<apex:selectList id="ShippingOption" title="Shipping Option" value="{!SelectShippingOption}" multiselect="false" size="1">
<apex:selectOption itemLabel="-None-"/>
<apex:selectOptions value="{!itemsShippingOption}"/>
<apex:actionSupport event="onchange" action="{!queryMaterials}" rerender="theTabPanel, Notes" />
</apex:selectList> </div>
</td>
</tr>
</apex:actionRegion>
<tr>
<td width="25%"><b><apex:outputLabel value="Ship Date" for="ShipDate"/></b></td>
<td ><div class="requiredInput"><div class="requiredBlock"></div>
<apex:inputField id="ShipDate" value="{!proxyObject.Ship_Date__c}" >
</div>
</apex:inputField>
</td>
</tr>

<tr>
<td width="25%"><b><apex:outputLabel value="Notes" for="Notes"/></b></td>
<td ><apex:inputText id="Notes" value="{!proxyObject.Shipping_Notes__c}" style="width:400px;height:50px;" /></td>
</tr>
<tr>
<td colspan="2"><apex:outputPanel id="pageMessage" rendered="{!showPageMessage}">
<apex:pageMessage title="{!pageMessageTitle}" detail="{!pageMessageDetail}" severity="{!pageMessageSeverity}" strength="{!pageMessageStrength}" escape="false"/>
</apex:outputPanel>
</td>
</tr>

</table>

</apex:pageBlock>

<apex:pageBlock title="Marketing Request Items" id="Items">

<apex:pageBlockButtons >
<apex:commandButton value="Submit" action="{!validateRequest}" oncomplete="closeForm();" rerender="pageMessage"/>
<apex:commandButton value="Clear" action="{!ClearQuantity}" rerender="theTabPanel" />
<apex:commandButton value="Close" onComplete="closeForm();" />
<apex:actionFunction name="SAVEITEMS" action="{!save}" />
</apex:pageBlockButtons>

<apex:tabPanel switchType="client" selectedTab="name2" id="theTabPanel" tabClass="activeTab" inactiveTabClass="inactiveTab">
<style>.activeTab {
background-color: Darkslateblue;

font-weight:bold;
background-image:none
}



.inactiveTab {background-color: lightgrey;
color:black;
background-image:none}

</style>

<apex:tab label="Standard ({!signedTotalQuantity})" name="standardTab" id="tabOne" >
<apex:pageBlockTable value="{!SignedItemsList}" var="signedMaterial" id="StandardItemsTable">
<apex:column headerValue="Project" value="{!signedMaterial.Project__c}" footerValue="Total: {!TotalQuantity}" width="30%"/>
<apex:column headerValue="Quantity" footerValue="Sub Total: {!signedTotalQuantity}" >
<apex:inputField id="qtySigned" value="{!signedMaterial.Quantity__c}" style="width:25px" >
<apex:actionSupport event="onchange" rerender="theTabPanel" />
</apex:inputField>
<script>document.getElementById('{!$Component.qtySigned}').disabled = {!disableInput}; </script>

</apex:column>
<apex:column headerValue="Materials" value="{!signedMaterial.Marketing_Material__c}" />


</apex:pageBlockTable>
</apex:tab>
<apex:tab label="Pre-Odrer ({!preOrderTotalQuantity})" name="preOrderTab" id="tabTwo" >
<apex:pageBlockTable value="{!PreOrderItemsList}" var="preOrderMaterial" id="PreOrderItemsTable">
<apex:column headerValue="Project" value="{!preOrderMaterial.Project__c}" footerValue="Total: {!TotalQuantity}" width="30%"/>
<apex:column headerValue="Quantity" footerValue="Sub Total: {!preOrderTotalQuantity}" >
<apex:inputField id="qtySigned" value="{!preOrderMaterial.Quantity__c}" style="width:25px" >
<apex:actionSupport event="onchange" rerender="theTabPanel" />
</apex:inputField>
<script>document.getElementById('{!$Component.qtySigned}').disabled = {!disableInput}; </script>
</apex:column>
<apex:column headerValue="Materials" value="{!preOrderMaterial.Marketing_Material__c}" width="35%"/>
</apex:pageBlockTable>
</apex:tab>
</apex:tabPanel>


</apex:pageBlock>

<apex:pageBlock title="Signed Offerings" id="SignedOfferings">
<apex:pageBlockTable value="{!SignedOfferings}" var="items" id="ItemsTable">
<apex:column headerValue="" value="{!items.Project_Pursuit__c}" width="35%"/>
</apex:pageBlockTable>
</apex:pageBlock>
<apex:pageBlock title="Pending Offerings" id="PendingOfferings">
<apex:pageBlockTable value="{!PendingOfferings}" var="items" id="ItemsTable">
<apex:column headerValue="" value="{!items.Project_Pursuit__c}" width="35%"/>
</apex:pageBlockTable>
</apex:pageBlock>


</apex:form>


</apex:page>

 

 

public void validateRequest(){
showPageMessage = true;
pageMessageTitle ='Required fields needed.';
pageMessageSeverity ='error';
pageMessageStrength = 2;
pageMessageDetail = '';

if (SelectedRequestType == null ){
pageMessageDetail = pageMessageDetail + 'Request Type ';
showPageMessage = true;
}
if (SelectedShippingOption == null){
pageMessageDetail = pageMessageDetail + '<br> Shipping Option ';
showPageMessage = true;
}
if (mr.Ship_Date__c == null){
pageMessageDetail = pageMessageDetail + '<br> Ship Date ';
showPageMessage = true;
}
if (Totalquantity == 0){
pageMessageDetail = pageMessageDetail + '<br> Quantity Requested ';
showPageMessage = true;
}
if (pageMessageDetail == ''){
save();
showPageMessage = false;
}

}

public PageReference save(){

//Create Signed Request
Marketing__c signedMarketingRequest = marketingRequest;

if (this.signedTotalQuantity > 0){
List<Marketing_Request_Item__c> signedFinalList = new List<Marketing_Request_Item__c>();
insert signedMarketingRequest;
for(Marketing_Request_Item__c item:SignedItemsList) {
if(item.Quantity__c != 0){
item.Marketing_Request__c = signedMarketingRequest.Id;
signedFinalList.add(item);
}
}
insert signedFinalList;
}
//Create Pre-Order Request
if (this.preOrderTotalQuantity > 0){
List<Marketing_Request_Item__c> preOrderFinalList = new List<Marketing_Request_Item__c>();
insert preOrderMarketingRequest;
for(Marketing_Request_Item__c item:PreOrderItemsList) {
if(item.Quantity__c != 0){
item.Marketing_Request__c = preOrderMarketingRequest.Id;
preOrderFinalList.add(item);
}
}

insert preOrderFinalList;
}


return null;

/*

 

 

Hi Friends ,

 

I am displaying list of products in which the user can edit the quantity of each product , and i need to calc the total price dynamically.

 

Currently I am able to display the products using PageBlockTable and have used text boxes to enter the quantity number,for the onblur  event of which i am calling a script function.

 

 

My problem is that, all the text boxes share the same id, I got stuck on this . 

 

Please help me out and let me know  how to proceed on this  :

 

 

 

 

 

Message Edited by yvk431 on 01-08-2010 05:28 AM
  • January 08, 2010
  • Like
  • 0
  • Become a subject matter expert in the Force.com Platform, with in-depth knowledge of the schema, API calls, and debugging techniques.
  • Lead technical courses including beta versions of Force.com Platform courses and train-the-trainer sessions.
  • Participate in team development projects, utilizing peer review and project management skills to drive completion of a valuable education asset.
  • SharePoint development and maintenance.
  • Produce SQL reports.
  

I've written my own Apex web service and downloaded the WSDL file from the site.  My C# app logs into Sf successfully and I have a web reference to my nwely created web service.

 

Seems like I have everything I need,but,  I have no idea how to call the method I wrote.  I've included a Using stsement at the top of my class,  but,  I just can't see the method or how I'm supposed to associate my current session with the new web service (is that right?)

 

Basically,  I'm in all kinds of trouble here and would like a little help please!

  • November 19, 2009
  • Like
  • 0
Hi,
 
I have  scenario where i want to disable the inputField onload.
 
<apex:inputField id="sdate"   value="{!inputStartDate.Date__c}">

 
The value for input field is date.  Is there a way to do this?
 
Thanx
 
S
  • July 09, 2008
  • Like
  • 0
Hi,
 
I am trying to create an Apex class from WSDL. It parses the WSDL fine.
I got the following error message when I tried to generate the apex class,
 
Apex generation failed,
Error: ShipServiceWS
 
Error: Script too large: //Generated by wsdl2apex
 
Does that mean the WSDL file (193 KB) is too large in size?
How do I generate the class?
 
thanks
Sk
 
 
 
 
  • July 02, 2008
  • Like
  • 0