• sdavidow9
  • NEWBIE
  • 229 Points
  • Member since 2008

  • Chatter
    Feed
  • 9
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 21
    Questions
  • 40
    Replies

Hi, we are merging 2 SFDC orgs and we are trying to confirm if a Record Id is unique only within it's own org, or unique across the platform?

 

We will probably con-catinate a char to the id while loading to it to a "legacyId" field, but not sure this is necessary.  I always thought these were GUIDs to the platform, but there is some question to the trueth of that on my team.

 

thanks.

Hi, I've got a VF email template that includes a datetime field:

{!relatedto.Appointment_Scheduled_DateTime__c}

 

This displays the GMT date/time, so a prior admin created a field called Well_Formatted_Time__c, that simply sets it back 6 hours, but that only works for 1 timezone and only during Daylight Savings.

 

I tried this:

   <apex:outputText value="Your Appointment is at:
         {0,date,MMMM, d 'at' h:mm a}">
<apex:param value="{!relatedTo.Appointment_Scheduled_DateTime__c}}" />
   </apex:outputText> 

 

But again...only GMT.

 

Is there anyway to get the email template to show the local timezone of the sending user, AND can this be done without having to add in a custom controller?  If so, how do I do that?

 

Thanks...

Hi, I'm trying to create a page that my users can insert/update a record.  I want to use fieldsets so we can dynamically change the order and fields easily.

Here's my page:

<apex:pageBlockTable value="{!$ObjectType.CustomObject__c.FieldSets.fsName}" var="f" width="50%" columnsWidth="100px, 100px">
            <apex:column value="{!f.Label}" >
                <apex:facet name="header">Header Text</apex:facet>
            </apex:column> 
            <apex:column >
                <apex:inputfield value="{!a[f]} "/>
                <apex:facet name="header">Value</apex:facet>
            </apex:column> 
            
        </apex:pageBlockTable>

 Here's my controller:

 

Public class MyController {
public CustomObject__c a {get; private set;}

public MyController () {
                a = new CustomObject__c();                                                                                      
}


 This was to create a new record and simply insert it, but I then changed to this:

 

public class MyController {
public customobject__c a {get; private set;}
public string theId {get {return ApexPages.currentPage().getParameters().get('aid');}}
public MyController() {
	
	 a = [select firstname__c, lastname__c
						phone__c,email__c from customobject__c
						where id = :theId 						
						limit 1];
	
	
}

public pagereference mySave(){
	
	PageReference pageRef = ApexPages.currentPage();
	update a;
	system.debug('### calling pageref...--'+pageRef);
	return pageRef;
}


}

 The fields in my field set are contained in the soql select statement...Not sure if I can dynamically create this one...or if I use the standardcontroller with an extention would it not require me to specify all the fields in the field set?

 

Anyway...

Neither is working...It sort of seems that the input fields are not actually bound to the sobject fields.  I don't think I should have to do any setters or getters...but I've been wrong once or twice before.

 

Anyone...anyone?

Thanks.

I had an issue doing deployment (sandbox to sandbox as a test):

 

Doing an Eclipse IDE deploy (as well as an ANT deploy) to a Developer Sandbox, getting the following error:

# Deploy Results:

   File Name:    objects/Account.object

   Full Name:  Account

   Action:  NO ACTION

   Result:  FAILED

   Problem: Custom Field Definition ID: bad value for restricted picklist field: RecordType

 

Tried deploying Objects on their own and tried disabling an Account filtered lookup I had (did not help).

Using Change sets gave different errors:

“Entity 'EmailMessage' not found.”

 

I DID NOT get this error via ANT/Eclipse...

 

I enabled the email to case service and change set deployed.

 

I can now also validate the eclipse migration.

 

I thought it would be helpful to anyone hitting the same/similar issue.  I've not used change sets besides 1 or 2 tests as I've seen an issue before, so have been reluctant, but may start.  I will use them to our test instance and if QA signs off on functionality, I will probably start.  They are sort of a pain, but probably can't be worse then getting ANT setup.

I've got a page that was originally designed for listing/selecting records from a datatable...

I'm using a custom controller to query the "Payment" object I want and then I stick those in a wrapper so I can select the ones I want to process.

 

Client came back and said they'd like inlineediting, so I stuck it in, but can't figure out how to update the data once it's been changed.

 

I think the problem is that when I edit a piece of data, it's never "set" back in the list, but I'm stumped on doing that...might just be a long day.  Anyone have a thought? 

 

I'm sure I just need to stick a {set;} somewhere, but I just don't know where...

Thanks.

 

here's the vf page code:

 

<apex:pageblocksection title="Request Refunds" 
	columns="1" 
	collapsible="FALSE"	
	>

<apex:dataTable value="{!payments}" var="p" width="100%">

    <apex:column >        
        <apex:inputCheckbox value="{!p.selected}" id="checkedone" disabled="{!p.pay.Refund_Requested__c}">
            <apex:actionSupport event="onclick" action="{!GetSelected}" rerender="totalsection"/>
        </apex:inputCheckbox>
    </apex:column>
    
    <apex:column headervalue="Reference Nbr" value="{!p.pay.Name}" />       
    <apex:column headervalue="Payment Date" value="{!p.pay.Payment_Date__c}" />
    <apex:column headervalue="Payment Type" value="{!p.pay.Payment_Type__c}" />
    <apex:column headervalue="Status" value="{!p.pay.Payment_Status__c}" />
    <apex:column headervalue="Amount" value="{!p.pay.Payment_Amount__c}" />
    <apex:column headervalue="Refund Requested" value="{!p.pay.Refund_Requested__c}" />
    <apex:column headervalue="Type" value="{!p.pay.RecordType.Name} - {!p.pay.Refund_for_Payment__r.Name}"/> 
<apex:inlineEditSupport event="ondblClick" 
                        showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
</apex:dataTable>
        
</apex:pageblocksection>

 I tried to give the simplified version...okay, the controller:

public with sharing class ctrl_Refund {
List<paymentwrapper> PaymentList  = new List<paymentwrapper>();
List<CCPayment__c> SelectedPayments = new List<CCPayment__c>();

public ctrl_Refund() {
	             //get thelist of payments Payments
                list<CCPayment__c> plist = [select p.id,p.name,p.payment_status__c, p.payment_date__c, 
                                            p.payment_amount__c, p.payment_type__c, p.refund_requested__c, 
                                            p.opportunity__c,p.Refund_for_Payment__r.Name,
                                            p.RecordType.Name
                                            from CCPayment__c p 
                                            where 
											p.opportunity__c = :id];                                    
                for(CCPayment__c p : plist){
                        PaymentList.add(new paymentwrapper(p));
                }
                system.debug('### Out of for loop - PaymentList: ' + PaymentList);
                
if(PaymentList.size()>0){
		HasCollectedPayments = True;
	}
	else {HasCollectedPayments = False;}
}

public PageReference getSelected()
    {
                SelectedPayments.clear();
                for(paymentwrapper paywrapper : PaymentList){
                        if(paywrapper.selected == true && paywrapper.pay.Refund_Requested__c == false) {
                                selectedPayments.add(paywrapper.pay);
                        }
                }
                return null;
    }
	
public class paymentwrapper
            {
                public CCPayment__c pay {get; set;}
                public Boolean selected {get; set;}
                public paymentwrapper(CCPayment__c p)
                {
                    pay = p;
                    selected = false;
                }
            }	
}

 

 

 

 

Hi, trying to load documents (some could be 5MB+) to Google Docs instead of SFDC, but using Sites so I can link the doc back to a record.

 

I'm trying to follow the toolkit code sampes:

http://wiki.developerforce.com/index.php/Google_Documents_API

 

But, even the simple example:

 

string doctitle = 'upload sample.csv';
string csvBody = 'name,city,state' + '\n' + 'bill,new york,new york';
GoogleData sheet = service.uploadDocument(
csvBody,
doctitle,
'text/csv');

 sheet.dump();

 Doesn't work for me....I've authenticated (I think), but get a:

 

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

 

I know I'll have more questions...like actually uploading the doc using sites in order to parse it, but I'm not even there yet.  anyone done this?

I'm stumped.  I have 2 sandboxes and I'm getting errors in only 1 with THE SAME code in both.

 

Everything was working fine in both systems until today.  I have no idea what has changed, and I've gone as far as replacing the VF and Controller code from the working SB to the one giving the errors.

 

The VF and Contoller are each about 1k lines, so I'm not sure it's worth sticking in here, but has anyone else "suddenly" run into this?  

 

One odd thing, I have a method that returns a date and I put that in a Hidden field.  I started  by making that hidden field to an outputfield to see if my value is being returned.  I tried output, input, apex:outputfield, apex:input...every variation and it's not getting populated.

The strange thing is that on my controller I am referencing that value in order to find a future date and that value IS being returned to my page.  I have debugs everywhere and the value is querying and being returned...

 

Again, the thing that is crazy is that it was working YESTERDAY and it STILL works in a different sandbox...?

 

Anyone?  Anyone?

Wondering if anyone has run into a similar issue...I'll try to be brief with my explanation.

We are integrating 2 systems (SFDC and SAP) using custom ws and callouts - not outbound messaging.

 

When an "Order" (custom object) goes to a certain status, a process runs to send the Ordre to SAP.  First thing we do is create a SAP Order Id (another custom field).  We don't create the Id until the order is about to be sent to SAP because there is a limited # of Ids we can use (it's a range, so we don't want to loose ids for cancelled orders or orders that wont be integrated with SAP).

 

My code figures out what the next SAP Order Id should be and then sets it and does an "Update" on the List I'm holding the data in.

 

AFTER the update statement I make a callout to SAP where the order is created in SAP.

 

When SAP creates the Order, there is some backend processes on their side that run which in turn UPDATES the Order.  These updates are sent back to SFDC. We don't get stuck in a loop because UPDATES in SFDC are NOT sent to SAP.

 

Since Orders can be created in SAP, when SAP sends an Order or Order Update to SFDC, we use the SAP Order Id to match to an existing order.  If there isn't one, we assume it's new and create it.

 

This is where the problem comes in...it appears that my process that sets the SAP Order Id AND sends the Callout does not COMMIT the update to the SAP Ordre Id field until AFTER the Callout receives some sort of response from SAP. 

 

The problem is that it seems SAP sends an UPDATE to SFDC  BEFORE SFDC is finished processing the callout, so we are getting duplicate orders in SFDC - basically, SFDC decides that the SAP Order Id should be "XYZ", even though I say "UPDATE my Order" it waits until it hears a callout response.  In the mean time SAP has received the create call, done it's magic and sent an update BACK to SFDC  saying "there's an update to order XYZ" all before SFDC FINALLY updates the Order with the SAP Order Id.

 

I hope that all makes sense.

 

Basically, I need my SAP Order Id to be committed BEFORE a callout is made, but don't know how to do that since it's happening in the same class/call.  The reason I believe it's a timing thing is because the SAP Order Id that's showing in the duplicate Order is the one sent to SAP - SAP would create it's own order with a different range.

 

Any thoughts?

 

Hi, I've been trying to sort out the ANT Migration toolkit and I'm having an issue with Custom Labels.

 

I'm getting:

  Entity type 'CustomLabels' is not available in this api versionpackage.xml

 

My Package File:

 

<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>CustomLabels</name> </types> <version>18.0</version> </Package>

 

 Any ideas?

 

Per the Developers guide:

 

title

The text displayed next to the output field, in addition to the field's label.

 

This attribute doesn't show up in my VF page.  

 

<apex:outputField value="{!myObject.myfield__c}" label="Hey, where does htis go?"/>

 

I want to add additional info to the label for this VF page, but not sure how to get it to show up where I want OR replace the label I have on the field.  Any ideas?

 

 

 

Hi, so we have a series of pricebooks set up.  We want our PRM customers to create Orders (using a custom object, not opportunities) that get prices and available products from 1 of these Pricebooks.  We have them select which one to use from a picklist on a custom VF page.

 

We've set up sharing rules to share PB1 with 1 Parnter User record.  In PRM, if we expose Opportunities tab and look at Opportunty Products, only the PB shared is available.  If we go to our custom VF page that asks the User what PB they want to use, all PB are available.

 

We've set the Org Wide Defaults for Pricebooks to "No Access" and we've set the VF page controller to "public with sharing" which should inherit the SFDC sharing settings, but it seems to be overridden.

 

Anyone have any ideas?

I've seen the messages about too many callouts: 11, and too many callouts: 2 (in batch), but I'm getting too many callouts: 1 with batch.

 

I have a process that will collect all "Orders" that need to be sent to SAP (through XI using custom callouts).  I ran into the 10 callout governor limit right away, so I am passing those Orders or setting them up in batches of 1 and trying to make 1 callout, but get this error.

 

Anyone?  Anyone?  Going to log a ticket, but figured I'd see if anyone came accross it.

Has anyone successfully written callouts to SAP/XI?

I have tried all sorts of combinations, but running into issues:

All my research points that I am doing this correct.  We have tried both self-signed certs and basic username/password authentication.

Setting my stub values:
Stub.inputHttpHeaders_x.put('Authorization','BASIC dnJldmF....W1wcGFzczAx');
--OR--
Blob headerValue = Blob.valueOf(username + ':' + password);//username/password set above String authorizationHeader = 'BASIC '+ EncodingUtil.base64Encode(headerValue);
stub.inputHttpHeaders_x.put('Authorization', authorizationHeader);

We have also tried (separately):
stub.clientCert_x = 'MIIG...';//Where this is the bas64 encoding of the pkc12 version of the cert
stub.clientCertPasswd_x = 'xxxxx';

Nothing seems to get past the security layer.  Has anyone successfully written the outbound message?

 

 

 

 

Okay, so in another post I've stated that my log files and debug window aren't working.  I can't figure out why I can't get my save call to acutally update my custom object.  My page has Orders__c and Order_line_items__c.   All I'm trying to do for now is SAVE orders__c (I'm sure once I get that to work, I'll ask about saving the child records...but first thing's first).  I've tried all sorts of stuff and finally resorted to creating a simple page that has none of the child stuff on it and it is updating properly.  I created it in the same fashion 

 

So I created a very simple VF page and controller (extension) that would focus on 1 object, and really 1 field.  It works just fine.  As a matter of fact, if I take that simple VF page and use the controller extension from the larger VF page, it works just fine...so that leads me to believe that my controller extension is just fine and the problem lies somewhere in the page...anyone care to take a look?  I have a boat load of style and .js I'm referencing (which I've pulled out below).  That isn't effecting it either as I've tried leaving it out and still no dice.

Thanks in advance for any help...I'm all sorts of confused.

 

 Pardon the comments and mess:

 

<apex:page standardcontroller="Orders__c" extensions="ppOrderProduct_ctrl" showheader="false" sidebar="false" id="thePage"> <apex:form id="theForm"> <apex:pageBlock title="Beer Order for Distributor {!$User.FirstName}" id="theHeaderPageBlock"> <table class="tblHeader"> <tr> <td class="classHeadCol"><b>Distributor:</b></td><td class="classDataCol">{!shipto.parent.name}</td> <td class="classHeadCol"> <b>Requested Date:</b></td><td class="classDataCol"> <apex:inputField id="RequestedDate" value="{!order.Requested_Delivery_Date__c}" onchange="validateLeadTime();" /> <!-- Make below hidden...made input for troubleshooting Next Pull Date: --> <apex:inputhidden value="{!nextPull.Scheduled_Pull_Date__c}" id="nextPullDate"/> </td> </tr> <tr> <td class="classHeadCol"><b>Ship to: </b></td> <td class="classDataCol"> <apex:outputtext value="{!shipto.name}"/> <!--Ship to is read only on this view... <select> <option value={!shipto.name}>{!shipto.name}</option> </select> --> </td> <td class="classHeadCol"><b>Delivery Type:</b></td><td class="classDataCol"> <apex:outputtext id="delivery_type" value="{!order.container__r.name}" /> </td> </tr> <tr> <td class="classHeadCol"><b>PO Number: </b></td><td class="classDataCol"> <apex:outputtext id="PONumber" value="{!order.P_O_Number__c}"/></td> <td class="classHeadCol"><b>Pic/Del - Location: </b></td> <!-- Below will need to be if statement based on pickup or delivery --> <td class="classDataCol"><apex:inputField id="Location" value="{!shipto.shippingstreet}"/></td> </tr> <tr> <td class="classHeadCol"></td><td></td> <td class="classHeadCol"><b>Equipment Type:</b></td><td class="classDataCol"> <apex:outputtext id="Container" value="{!order.container__r.name}" /> <apex:inputhidden id="containerPalletCap" value="{!order.container__r.Pallet_Capacity__c}"/> </td> </tr> </table> </apex:pageBlock> <apex:pageBlock title="Product List for Order" id="theBlock"> <apex:outputPanel id="thePanel"> <div id="ProductTable"> <apex:inputHidden value="{!order_Line_Items.size}" id="numberofLines"/> <apex:dataTable value="{!order_line_items}" var="oli" id="theTable" rowClasses="odd,even" columnClasses="classSKU, classDESC,classOrderUnit,classOrderQty,classUnitPrice,classPallets,classTotalPrice" styleClass="tableClass"> <!-- <apex:facet name="caption">table caption</apex:facet> --> <!-- <apex:facet name="header">table header</apex:facet> --> <apex:facet name="footer"> <apex:inputField id="Container" value="{!order.container__r.name}" /> Equipment: {!order.container__r.name} ({!order.container__r.Pallet_Capacity__c} Pallets) <br/> Capacity: <input size="3" disabled="true" value="" id="TotalPallets1" Class="palletfieldClass"/> (<input size="3" value="" disabled="true" id="percentFull" Class="palletPercentfieldClass"/>) <input size="3" value="" disabled="true" id="PalletsUntilFull" Class="palletfieldClass"/> until full </apex:facet> <apex:column > <apex:facet name="header">{!$Label.omsSKU}</apex:facet> <apex:facet name="footer">Total</apex:facet> <apex:outputText value="{!oli.ship_to_product__r.SKU_Number__c}"/> <!-- Make below hidden...using for troubleshooting --> <apex:inputhidden value="{!oli.ship_to_product__r.Lead_Time__c}" id="leadTime"/> </apex:column> <apex:column > <apex:facet name="header">{!$Label.omsDescription}</apex:facet> <apex:facet name="footer"></apex:facet> <apex:outputText value="{!oli.Product__r.Description}"/> <p class="specialMessage"><apex:outputText value="{!oli.product__r.Special_Message__c}"/></p> </apex:column> <apex:column > <apex:facet name="header">{!$Label.omsOrderUnit}</apex:facet> <apex:facet name="footer"></apex:facet> <apex:outputText value="{!oli.ship_to_product__r.Order_Unit__c}"/> </apex:column> <apex:column id="oq"> <apex:facet name="header">{!$Label.omsOrderQuantity}</apex:facet> <apex:facet name="footer"></apex:facet> <apex:inputField styleClass="oqInputField" value="{!oli.Quantity__c}" onchange="updatePrice(getLineIndex('{!$Component.linequantity}'),1);" id="linequantity"/> <!-- orig below <apex:inputField styleClass="oqInputField" value="{!oli.Quantity__c}" onchange="updatePrice('{!$Component.linequantity}','{!$Component.ePricefield}','{!$Component.kcPrice}', '{!$Component.base_unit_pallet__c}','{!$Component.uompPallet}','{!$Component.totalBaseUnits}', '{!$Component.totalLinePallets}');" id="linequantity"/> --> </apex:column> <apex:column > <apex:facet name="header">{!$Label.omsKegCasePrice}</apex:facet> <apex:facet name="footer"></apex:facet> <!-- <apex:outputText value="{!oli.Price__c}" id="kcPrice"/> --> <!-- <apex:inputField styleClass="oqInputField" value="{!oli.Price__c}" id="kcPrice"/>--> <apex:inputText styleClass="ReadOnlyFieldClass" disabled="true" value="{!oli.Price__c}" id="kcPrice"/> </apex:column> <apex:column > <apex:facet name="header">{!$Label.omsKegCasePallet}</apex:facet> <apex:facet name="footer"></apex:facet> <apex:inputtext styleClass="ReadOnlyFieldClass" disabled="true" id="uompPallet" value="{!oli.ship_to_product__r.Base_Unit_Order_Unit__c}"/> </apex:column> <apex:column > <apex:facet name="header">{!$Label.omsPallets}</apex:facet> <apex:facet name="footer"><input size="3" value="" disabled="true" id="TotalPallets" Class="ReadOnlyPriceFieldClass"/></apex:facet> <apex:inputtext styleClass="ReadOnlyPriceFieldClass" disabled="true" size="3" value="{!calculatedValue}" id="totalLinePallets" /> </apex:column> <apex:column > <apex:facet name="header">{!$Label.omsPrice}</apex:facet> <apex:facet name="footer"><apex:inputtext styleClass="ReadOnlyPriceFieldClass" disabled="true" value="{!order.Amount__c}" id="OrderTotalPrice"/></apex:facet> <!-- <apex:outputText value="{!oli.Extended_Price__c}" id="ePrice"/> styleClass="epfieldClass"--> <!--<apex:inputField value="{!oli.Extended_Price_OMS__c}" id="ePricefield" styleClass="epfieldClass" onchange="epricechange('{!$Component.linequantity}','{!$Component.ePricefield}','{!$Component.kcPrice}');"/> --> <apex:inputText disabled="true" value="{!oli.Extended_Price__c}" id="ePricefield" styleClass="ReadOnlyPriceFieldClass"/> <!-- Base Unit/Pallet --> <apex:inputhidden value="{!oli.ship_to_product__r.Base_Unit_Pallet__c}" id="base_unit_pallet__c" /> <!-- Total Base Units (calculated) --> <apex:inputhidden value="{!totalBaseUnits}" id="totalBaseUnits" /> </apex:column> <!-- Remove below, for troubleshooting calculations <apex:column > <apex:facet name="header">Base Unit/Pallet</apex:facet> <apex:facet name="footer"></apex:facet> </apex:column> <apex:column > <apex:facet name="header">Total Base Units (calculated)</apex:facet> <apex:facet name="footer"></apex:facet> </apex:column> --> </apex:dataTable> </div> </apex:outputPanel> <apex:commandButton value="Save" action="{!mysave}"/> <!-- <apex:pageBlockButtons location="bottom"> </apex:pageBlockButtons> --> </apex:pageBlock> </apex:form> </apex:page>

 Controller:

public with sharing class ppOrderProduct_ctrl { Account distributor; Account shipto; Orders__c order {get; set;} List<Order_Line_Item__c> oli; string size; public String getSize() { return size; } public void setSize (String s) { size = s; } public string totalBaseUnits {get; set;} public string calculatedValue {get; set;} public date calcDate;// {set;} pull_order_schedule__c nextPull; /* Using calculatedValue for place holder when needing a calculated input box */ public date getCalcDate() { //order.Requested_Delivery_Date__c+10; //validateDate(); return calcDate; } public void setCalcDate() { //this.calcDate=calcDate; } public ppOrderProduct_ctrl(ApexPages.StandardController stdController) { system.debug('###ctrl message...'); order = [select id, orders__c.P_O_Number__c, container__r.name,container__r.pallet_capacity__c, orders__c.amount__c, requested_delivery_date__c, distributor__c, supplier__c from Orders__c where id =:ApexPages.currentPage().getParameters().get('id')]; shipto=[select a.name,a.shippingcity, a.shippingstreet, a.shippingstate, a.parent.name from account a where id = :order.Distributor__c]; //distributor=[select name from account where id = :ApexPages.currentPage().getParameters().get('id')]; nextPull=[select np.Scheduled_Pull_Date__c from pull_order_schedule__c np where np.supplier__c=:order.Supplier__c and np.status__c='Active' ORDER BY np.scheduled_pull_date__c ASC limit 1 ]; } public Account getShipto() { if(shipto == null) distributor = new Account(); return shipto; } public Orders__c getOrder() { //if(order == null) order = new Orders__c(); return order; } public pull_order_schedule__c getnextPull() { if(nextPull == null) nextPull = new pull_order_schedule__c(); return nextPull; } public List<Order_line_Item__c> getOrder_Line_Items(){ oli=[select ol.Product__r.Description,ol.product__r.special_message__c, ol.quantity__c, ol.extended_price_OMS__c, ol.id, ol.price__c, ol.ship_to_product__r.sku_number__c, ol.ship_to_product__r.base_unit_order_unit__c, ol.ship_to_product__r.order_unit__c, ol.ship_to_product__r.base_unit_pallet__c, ol.extended_price__c, ol.ship_to_product__r.lead_time__c from Order_Line_Item__c ol where Order__c=:ApexPages.currentPage().getParameters().get('id')]; return oli; } public PageReference mysave() { system.debug('###Save method invoked...'); update order; return null; } }

 

Anyone know why my system log and debug logs aren't working for me?  Another developer in our sandbox isn't having a problem and I can see his logs being created, but mine aren't. 

They've worked in the past.  

I have system.debug statement in my code.

I'm not even getting logs generated when I save ecliplse files (which I belive is making an API call).

 

Anyone run into this and how to fix?

Hi, I have a couple of issues, but will start with the 2 basic ones and try to be brief:

Setup:  My page will display an Account name and then populate a picklist with all child accounts.

When the user selects a child account (from the picklist) a portion of the page should rerender with additional details about that child...there's more to it, and it's not the basic SFDC details page, but not important. 

 

First:  My picklist seems to be rerendering, but the function doesn't seem to be called.  I stuck in a simple "counter" to see if it's being called, and doesn't look like it.

 

2nd:  My debug logs don't seem to be doing anything.  I don't see either the system log window doing anything, or when I set up the debug log monitoring.  I have several system.debug("...") calls that don't show up.

 

Thanks in advance for any help.

 

I've put my vf page and controller below:

 

 Controller:

public with sharing class z_ppBOStartCtrl { private final Account distributor; private List<Account> shiptos; String[] shiptoselected = new String[]{}; List<SelectOption> options = new List<SelectOption>(); String poNumber; String[] pickupType = new String[]{}; List<SelectOption> pickupOptions = new List<SelectOption>(); public Id ShiptoID {get; set;} public Account shiptoselected1;// {get; set;} Integer count = 0; public Integer getCount() { return count; } public Account getshiptoselected1() { return shiptoselected1; } public String getPoNumber() { return poNumber; } public void setPoNumber(String s) { poNumber = s; } public Account getDistributor() { return distributor; } public PageReference save() { update distributor; return null; } public List<SelectOption> getoptions(){ return options; } public String[] getShiptoselected() { return Shiptoselected; } public void setShiptoselected(String[] shiptoselected) { this.shiptoselected = shiptoselected; } public List<SelectOption> getPickupOptions(){ return pickupOptions; } public String[] getPickupType() { return pickupType; } public void setPickupType(String[] pickupType) { this.pickupType = pickupType; } public z_ppBOStartCtrl() { try{ //don't worry about some of this logic as I'm not using it yet... //Use URL ContactId to find a usable contact for the queries for testing if(ApexPages.currentPage().getParameters().get('id')!=NULL){ Contact conAcctid=[select c.account.id,c.account.parent.id from contact c where c.id =:ApexPages.currentPage().getParameters().get('id')]; //Populate my picklist below //If the Account is a Parent if(conAcctid.account.parent.id==NULL) { distributor = [select id, name, parentid from Account where id = :conAcctid.account.id]; shiptos = [select a.id, a.name, a.pickup__c from Account a where a.parent.id = :conAcctid.account.id ]; options.add(new SelectOption('','--Select Below---')); for (Account a : shiptos) { options.add(new SelectOption(a.id,a.name)); }//end for }//end if //Otherwise, it's a child else { distributor = [select id, name, parentid from Account where id = :conAcctid.account.parent.id]; //The ship to will be the same account shiptos = [select id, name, parentid, pickup__c from Account where id = :conAcctid.account.id]; options.add(new SelectOption('000','--Select Below---')); for (Account a : shiptos) { options.add(new SelectOption(a.id,a.name)); } //end for }//end else } else { User currentUser = [Select ContactId, Contact.AccountId from User Where Id = : UserInfo.getUserId() Limit 1]; id conAcctid=currentUser.Contact.AccountId; distributor = [select id, name, parentid from Account where id = :conAcctid]; } } public pageReference xShipto() { system.debug('#### child selected...' + System.currentPageReference().getParameters().get('selected')); shiptoselected1 = [select a.id, a.name from Account a where a.id=:System.currentPageReference().getParameters().get('selected') limit 1]; //I've tried hardcoding a known id above, that didn't work either... count++; system.debug('#### child selected...' + shiptoselected1); return null; } }

Page:

<apex:page controller="z_ppBOStartCtrl" showheader="false" sidebar="false" id="OrderCreatePage"> <style> .ReadOnlyFieldClass { width:250px; border:0px; background-color:#F3F3EC; color:black; } </style> <apex:form > <apex:pageblock > <table width="600"> <apex:actionregion > <!-- <apex:pageBlocksection title="Beer Order for Distributor {!$User.FirstName}" columns="1"> --> <tr> <td><apex:outputText value="{!$Label.omsDistributor}" style="font-weight:bold;" /></td> <td><apex:outputtext value="{!distributor.name}" id="org" styleClass="ReadOnlyFieldClass"/></td> </tr> <tr> <td>Ship to:</td> <td> <apex:selectList value="{!shiptoselected}" size="1" id="selected" > <apex:selectOptions value="{!options}" /> <!-- <apex:param name="shiptoselected1" value="001T000000ArhA8"/> --> <apex:actionSupport event="onchange" action="{!xShipto}" rerender="shiptospecific" status="status"/> <apex:actionStatus id="status" startText="loading..."/> </apex:selectList> </td> </tr> <!-- </apex:pageBlocksection> --> </apex:actionregion> </table> <apex:outputpanel id="shiptospecific"> <apex:pageBlocksection id="xshiptospecific" rendered="true"><!-- rendered="NOT({!shiptoselected}='0')" --> xxx{!count}xxxxxx PO Number: <apex:inputtext id="poNumber" value="{!poNumber}"/> <apex:inputtext id="shiptoidnumber" value="{!shiptoselected1.id}" /> <!-- <apex:inputtext id="poNumberx" value="{!shiptoselected}"/> --> Delivery Type: <apex:selectList value="{!pickupType}" id="idx" size="1" ><!-- rendered="{!shiptos.pickup__c}" --> <apex:selectOptions value="{!pickupOptions}"/> </apex:selectList> </apex:pageBlocksection> </apex:outputpanel> </apex:pageBlock> </apex:form> </apex:page>

 



Hi, I'm an independent SFDC consultatn. I have over 10 years CRM experience, 5 of which has been with SFDC.  I'm located in Denver and looking for projects to assist companies in implementing, improving or just help with best practices to more effectively use Salesforce.com.

 

I have worked for some of the larger consulting partners, but independently I can offer the same expertise at a much lower rate.

 

Please contact me if you'd like to discuss further.

Hi, I'm following an example I found:

http://sfdc.arrowpointe.com/2009/01/08/invoke-apex-from-a-custom-button-using-a-visualforce-page/

 

To invoke apex from a button on a page.  What I'm doing is a deep clone of a custom object (cloning related lists as well).  The cloning is working, but I can't seem to get the system to return the user to the NEWLY cloned record.  I get the error here:

 

           theClonedId = IC_util.DeepCloneClass(c);

Okay, so the quick code is that on my vf page I have a loop (I've taken out comments and debug log calls to shorten this):

 

        for (SFDC_CLass__c c:[select id, name from SFDC_Class__c where id =:theId]) {
            theClonedId = IC_util.DeepCloneClass(c);
         }

All I want to do here is call my IC_util.DeepCloneClass routine.  That's actually working.  It SHOULD return a string:

public static string DeepCloneClass(Class__c c) {
       try {

            List<Attendance__c> attendList = [select id, contact__c from Attendance__c where class__c = :c.id];//'a0A60000002d5Ip'
            Class__c newClass = new Class__c(name=c.Name + ' - clone');
              insert newClass;

            for(Attendance__c a :attendList) {
                insert new Attendance__c[]{new Attendance__c(contact__c=a.contact__c, class__c=newClass.Id)};

            }//end for

return newClass.Id;

   } //end try 

 

Any help would be great.

We have a VisualForce page that does a query/look up based on the phone number fields.  This is in a call center, so speed is somewhat important.  We are querying 1.6M records and the query time is longer than we'd like.  Is it possible to create an index on a standard field?  How about on a custom field?  If we set it as an External ID, must it then be unique? 

Thanks,
--Seth
Hi, I'm running eclipse and I'm not getting my classes or pages for my dev orgs.  I have them for sandbox and production systems, but for my dev orgs I don't even get the folder for those 2 objects.  What's my problem...anyone...anyone?

Hi, we are merging 2 SFDC orgs and we are trying to confirm if a Record Id is unique only within it's own org, or unique across the platform?

 

We will probably con-catinate a char to the id while loading to it to a "legacyId" field, but not sure this is necessary.  I always thought these were GUIDs to the platform, but there is some question to the trueth of that on my team.

 

thanks.

I'm fairly new to Apex (and I'm not a developer by trade) and I'm stumped on a SOQL query for a trigger that I'm writing.

Background info: I'm attempting to set up a process by which we can add Contacts to a custom object called Notification Groups. These Notification Groups can then be associated with Cases, and when a Comment is left on a Case and marked as Public, I want to email the Contacts within the associated Notification Groups. In order to make the necessary many-to-many relationships possible (Contacts can be a part of more than one group, groups can be associated with more than one case), I've created two junction objects: ContactGroupJoiner__c and GroupCaseJoiner__c. They both have Master-Detail relationships with the objects they're joining. Here is a quick graphic to show the relationship:

 

The trigger fires on CaseCommentI'm able to get the Notification Groups that are associated with the case from the following SOQL query:

List<GroupCaseJoiner__c> notificationGroups = [SELECT Notification_Group__r.Id FROM GroupCaseJoiner__c WHERE Case__c = :caseId];

I'm stuck on the next step, though, which would be to look at each item in the notificationGroups list, grab its related Contacts' email addresses, and add them to a list called toSendEmails (declared earlier in the Class). Here is what I tried:

//Create new list that will hold ContactGroupJoiner records associated with the records in notificationGroups.
      List<ContactGroupJoiner__c> contactsInGroups = new List <ContactGroupJoiner__c>();
      
      //For each Group in the notificationGroups list, grab the associated Contact records and store them in contactsInGroups.
      for(Integer i=0; i<notificationGroups.size(); i++)
      {
        contactsInGroups.add( [SELECT Id, Notification_Group__c, Contact__c FROM ContactGroupJoiner__c WHERE Notification_Group__c = :notificationGroups[i].Id] );
      }
           
      //Create placeholder list for Contacts to Mail
      List<Contact> contactsToMail = new List <Contact>();
      
      //For each contact associated with a group, grab that contact's ID and email address.
      for(Integer i=0; i<contactsInGroups.size(); i++)
      {        
        contactsToMail.add( [SELECT Id, Email FROM Contact WHERE Id = :contactsInGroups[i].Id] );
      }
      system.debug('contactsToMail Size = ' + contactsToMail.size());
      
      //For each contact's email address, 
      for(Integer i=0; i<contactsToMail.size(); i++)
      {
        toSendEmails.add(contactsToMail[i].Email);
      }

Some of that seems inefficient to me, and probably should be combined. But anyway, the result of this code, when I test it on a case in my sandbox, is that the public comment will be sent to the Contact on the Case (handled earlier in the class), as well as only one contact (of two) associated to one Notification Group (of two) associated with the Case.

 

I think I've included all the necessary details, but if I haven't please let me know what else would help. Thanks in advance to anyone that reads this far! :)

Hi, I'm trying to create a page that my users can insert/update a record.  I want to use fieldsets so we can dynamically change the order and fields easily.

Here's my page:

<apex:pageBlockTable value="{!$ObjectType.CustomObject__c.FieldSets.fsName}" var="f" width="50%" columnsWidth="100px, 100px">
            <apex:column value="{!f.Label}" >
                <apex:facet name="header">Header Text</apex:facet>
            </apex:column> 
            <apex:column >
                <apex:inputfield value="{!a[f]} "/>
                <apex:facet name="header">Value</apex:facet>
            </apex:column> 
            
        </apex:pageBlockTable>

 Here's my controller:

 

Public class MyController {
public CustomObject__c a {get; private set;}

public MyController () {
                a = new CustomObject__c();                                                                                      
}


 This was to create a new record and simply insert it, but I then changed to this:

 

public class MyController {
public customobject__c a {get; private set;}
public string theId {get {return ApexPages.currentPage().getParameters().get('aid');}}
public MyController() {
	
	 a = [select firstname__c, lastname__c
						phone__c,email__c from customobject__c
						where id = :theId 						
						limit 1];
	
	
}

public pagereference mySave(){
	
	PageReference pageRef = ApexPages.currentPage();
	update a;
	system.debug('### calling pageref...--'+pageRef);
	return pageRef;
}


}

 The fields in my field set are contained in the soql select statement...Not sure if I can dynamically create this one...or if I use the standardcontroller with an extention would it not require me to specify all the fields in the field set?

 

Anyway...

Neither is working...It sort of seems that the input fields are not actually bound to the sobject fields.  I don't think I should have to do any setters or getters...but I've been wrong once or twice before.

 

Anyone...anyone?

Thanks.

I had an issue doing deployment (sandbox to sandbox as a test):

 

Doing an Eclipse IDE deploy (as well as an ANT deploy) to a Developer Sandbox, getting the following error:

# Deploy Results:

   File Name:    objects/Account.object

   Full Name:  Account

   Action:  NO ACTION

   Result:  FAILED

   Problem: Custom Field Definition ID: bad value for restricted picklist field: RecordType

 

Tried deploying Objects on their own and tried disabling an Account filtered lookup I had (did not help).

Using Change sets gave different errors:

“Entity 'EmailMessage' not found.”

 

I DID NOT get this error via ANT/Eclipse...

 

I enabled the email to case service and change set deployed.

 

I can now also validate the eclipse migration.

 

I thought it would be helpful to anyone hitting the same/similar issue.  I've not used change sets besides 1 or 2 tests as I've seen an issue before, so have been reluctant, but may start.  I will use them to our test instance and if QA signs off on functionality, I will probably start.  They are sort of a pain, but probably can't be worse then getting ANT setup.

I've got a page that was originally designed for listing/selecting records from a datatable...

I'm using a custom controller to query the "Payment" object I want and then I stick those in a wrapper so I can select the ones I want to process.

 

Client came back and said they'd like inlineediting, so I stuck it in, but can't figure out how to update the data once it's been changed.

 

I think the problem is that when I edit a piece of data, it's never "set" back in the list, but I'm stumped on doing that...might just be a long day.  Anyone have a thought? 

 

I'm sure I just need to stick a {set;} somewhere, but I just don't know where...

Thanks.

 

here's the vf page code:

 

<apex:pageblocksection title="Request Refunds" 
	columns="1" 
	collapsible="FALSE"	
	>

<apex:dataTable value="{!payments}" var="p" width="100%">

    <apex:column >        
        <apex:inputCheckbox value="{!p.selected}" id="checkedone" disabled="{!p.pay.Refund_Requested__c}">
            <apex:actionSupport event="onclick" action="{!GetSelected}" rerender="totalsection"/>
        </apex:inputCheckbox>
    </apex:column>
    
    <apex:column headervalue="Reference Nbr" value="{!p.pay.Name}" />       
    <apex:column headervalue="Payment Date" value="{!p.pay.Payment_Date__c}" />
    <apex:column headervalue="Payment Type" value="{!p.pay.Payment_Type__c}" />
    <apex:column headervalue="Status" value="{!p.pay.Payment_Status__c}" />
    <apex:column headervalue="Amount" value="{!p.pay.Payment_Amount__c}" />
    <apex:column headervalue="Refund Requested" value="{!p.pay.Refund_Requested__c}" />
    <apex:column headervalue="Type" value="{!p.pay.RecordType.Name} - {!p.pay.Refund_for_Payment__r.Name}"/> 
<apex:inlineEditSupport event="ondblClick" 
                        showOnEdit="saveButton,cancelButton" hideOnEdit="editButton" />
</apex:dataTable>
        
</apex:pageblocksection>

 I tried to give the simplified version...okay, the controller:

public with sharing class ctrl_Refund {
List<paymentwrapper> PaymentList  = new List<paymentwrapper>();
List<CCPayment__c> SelectedPayments = new List<CCPayment__c>();

public ctrl_Refund() {
	             //get thelist of payments Payments
                list<CCPayment__c> plist = [select p.id,p.name,p.payment_status__c, p.payment_date__c, 
                                            p.payment_amount__c, p.payment_type__c, p.refund_requested__c, 
                                            p.opportunity__c,p.Refund_for_Payment__r.Name,
                                            p.RecordType.Name
                                            from CCPayment__c p 
                                            where 
											p.opportunity__c = :id];                                    
                for(CCPayment__c p : plist){
                        PaymentList.add(new paymentwrapper(p));
                }
                system.debug('### Out of for loop - PaymentList: ' + PaymentList);
                
if(PaymentList.size()>0){
		HasCollectedPayments = True;
	}
	else {HasCollectedPayments = False;}
}

public PageReference getSelected()
    {
                SelectedPayments.clear();
                for(paymentwrapper paywrapper : PaymentList){
                        if(paywrapper.selected == true && paywrapper.pay.Refund_Requested__c == false) {
                                selectedPayments.add(paywrapper.pay);
                        }
                }
                return null;
    }
	
public class paymentwrapper
            {
                public CCPayment__c pay {get; set;}
                public Boolean selected {get; set;}
                public paymentwrapper(CCPayment__c p)
                {
                    pay = p;
                    selected = false;
                }
            }	
}

 

 

 

 

I'm stumped.  I have 2 sandboxes and I'm getting errors in only 1 with THE SAME code in both.

 

Everything was working fine in both systems until today.  I have no idea what has changed, and I've gone as far as replacing the VF and Controller code from the working SB to the one giving the errors.

 

The VF and Contoller are each about 1k lines, so I'm not sure it's worth sticking in here, but has anyone else "suddenly" run into this?  

 

One odd thing, I have a method that returns a date and I put that in a Hidden field.  I started  by making that hidden field to an outputfield to see if my value is being returned.  I tried output, input, apex:outputfield, apex:input...every variation and it's not getting populated.

The strange thing is that on my controller I am referencing that value in order to find a future date and that value IS being returned to my page.  I have debugs everywhere and the value is querying and being returned...

 

Again, the thing that is crazy is that it was working YESTERDAY and it STILL works in a different sandbox...?

 

Anyone?  Anyone?

Wondering if anyone has run into a similar issue...I'll try to be brief with my explanation.

We are integrating 2 systems (SFDC and SAP) using custom ws and callouts - not outbound messaging.

 

When an "Order" (custom object) goes to a certain status, a process runs to send the Ordre to SAP.  First thing we do is create a SAP Order Id (another custom field).  We don't create the Id until the order is about to be sent to SAP because there is a limited # of Ids we can use (it's a range, so we don't want to loose ids for cancelled orders or orders that wont be integrated with SAP).

 

My code figures out what the next SAP Order Id should be and then sets it and does an "Update" on the List I'm holding the data in.

 

AFTER the update statement I make a callout to SAP where the order is created in SAP.

 

When SAP creates the Order, there is some backend processes on their side that run which in turn UPDATES the Order.  These updates are sent back to SFDC. We don't get stuck in a loop because UPDATES in SFDC are NOT sent to SAP.

 

Since Orders can be created in SAP, when SAP sends an Order or Order Update to SFDC, we use the SAP Order Id to match to an existing order.  If there isn't one, we assume it's new and create it.

 

This is where the problem comes in...it appears that my process that sets the SAP Order Id AND sends the Callout does not COMMIT the update to the SAP Ordre Id field until AFTER the Callout receives some sort of response from SAP. 

 

The problem is that it seems SAP sends an UPDATE to SFDC  BEFORE SFDC is finished processing the callout, so we are getting duplicate orders in SFDC - basically, SFDC decides that the SAP Order Id should be "XYZ", even though I say "UPDATE my Order" it waits until it hears a callout response.  In the mean time SAP has received the create call, done it's magic and sent an update BACK to SFDC  saying "there's an update to order XYZ" all before SFDC FINALLY updates the Order with the SAP Order Id.

 

I hope that all makes sense.

 

Basically, I need my SAP Order Id to be committed BEFORE a callout is made, but don't know how to do that since it's happening in the same class/call.  The reason I believe it's a timing thing is because the SAP Order Id that's showing in the duplicate Order is the one sent to SAP - SAP would create it's own order with a different range.

 

Any thoughts?

 

Hi, I've been trying to sort out the ANT Migration toolkit and I'm having an issue with Custom Labels.

 

I'm getting:

  Entity type 'CustomLabels' is not available in this api versionpackage.xml

 

My Package File:

 

<?xml version="1.0" encoding="UTF-8"?> <Package xmlns="http://soap.sforce.com/2006/04/metadata"> <types> <members>*</members> <name>CustomLabels</name> </types> <version>18.0</version> </Package>

 

 Any ideas?

 

Per the Developers guide:

 

title

The text displayed next to the output field, in addition to the field's label.

 

This attribute doesn't show up in my VF page.  

 

<apex:outputField value="{!myObject.myfield__c}" label="Hey, where does htis go?"/>

 

I want to add additional info to the label for this VF page, but not sure how to get it to show up where I want OR replace the label I have on the field.  Any ideas?

 

 

 

Hi, so we have a series of pricebooks set up.  We want our PRM customers to create Orders (using a custom object, not opportunities) that get prices and available products from 1 of these Pricebooks.  We have them select which one to use from a picklist on a custom VF page.

 

We've set up sharing rules to share PB1 with 1 Parnter User record.  In PRM, if we expose Opportunities tab and look at Opportunty Products, only the PB shared is available.  If we go to our custom VF page that asks the User what PB they want to use, all PB are available.

 

We've set the Org Wide Defaults for Pricebooks to "No Access" and we've set the VF page controller to "public with sharing" which should inherit the SFDC sharing settings, but it seems to be overridden.

 

Anyone have any ideas?

Has anyone successfully written callouts to SAP/XI?

I have tried all sorts of combinations, but running into issues:

All my research points that I am doing this correct.  We have tried both self-signed certs and basic username/password authentication.

Setting my stub values:
Stub.inputHttpHeaders_x.put('Authorization','BASIC dnJldmF....W1wcGFzczAx');
--OR--
Blob headerValue = Blob.valueOf(username + ':' + password);//username/password set above String authorizationHeader = 'BASIC '+ EncodingUtil.base64Encode(headerValue);
stub.inputHttpHeaders_x.put('Authorization', authorizationHeader);

We have also tried (separately):
stub.clientCert_x = 'MIIG...';//Where this is the bas64 encoding of the pkc12 version of the cert
stub.clientCertPasswd_x = 'xxxxx';

Nothing seems to get past the security layer.  Has anyone successfully written the outbound message?

 

 

 

 

Hi,
in the Winter'09 release notes it says "Custom labels are custom text values, up to 1,000 characters in length, that can be accessed from Apex classes or Visualforce pages".
I could easily find how to access these labels from a visualforce page, but nowhere I can find how to access them from an apex class.
I need this because I have a class that dynamically generates labels for a certain table in a vf page. But I want to use Custom Labels (and the translation workbench) to get these translated in various languages.
Is there an object, something like Label with a static function like 'getLabel(String)'? Or is this not released in Winter '09?
  • September 30, 2008
  • Like
  • 0
I have a trigger on the Opportunity Object that calls a class. That class then calls another class that makes an HTTP GET request to a Web Service.
 
However I get the error:
 
Callout from triggers are currently not supported.
 
How can I send data to an external Web Service using Apex code? I have read (or am reading) chapter 12 of the reference manual, but obviously missing something.
 
Help please.
 
_t