• ralph
  • NEWBIE
  • 0 Points
  • Member since 2004

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 3
    Replies

Is it possible to add an image to static resources using apex code?

 

On a detail page I want to click a button that says upload image and store that image in static resources rather than in attachments on the individual record.

 

Is the possible and if so do you have any sample code?

  • August 29, 2013
  • Like
  • 0

How do I get Xcode to use Mobile SDK 2.0?

It currently uses SDK 1.5.

I renamed the folder SalesforceMobileSDK-iOS to xSalesforceMobileSDK-iOS and then installed SDK 2.0.

- thanks.

  • July 14, 2013
  • Like
  • 0

How to replace null or empty value with 0.

I am passing 12 number fields to a Google chart.
If one of my fields is blank the chart does not render.
In my Visualforce page I what to replace the null value with 0.
Both of the following lines of code always return false even though one is ==null and the other is !=null.
['January',  {!if(Contact.Sales_01__c==null, 0, Contact.Sales_01__c}],
['January',  {!if(Contact.Sales_01__c!=null, 0, Contact.Sales_01__c}],

How do I do this in Visualforce without using a controller extension?
Another question: can I use a static Apex method and pass in the value and get back 0 if null, or the passed value not null?

Thanks.

  • August 17, 2012
  • Like
  • 0
Is it possible to use the API to create records that will appear in the HTML Email Status report?
 
If so - what object is it and what values (if any) need to be set?
 
Thanks
  • June 30, 2006
  • Like
  • 0

When I execute the following code I get an error:  Required fields are missing: [DefaultPrice]

As you can see the DeafultPrice has beend hard coded to 1000.00.

Any ideas?

Thanks

 

// get pricebook id
string _priceBookId = GetProcebookId();

//   add part
sforce.Product _product = new sforce.Product();
_product.PricebookId = _priceBookId;
_product.ProductCode = _partCode;
_product.Name = _partName;
_product.DefaultPrice = 1000.00;    // <<<<<<<<<<<<<<<<<<<<<,
_product.Description = "created by poc";

sforce.SaveResult[] sr = binding.create(new sforce.sObject[] {_product});

if ( sr.Length == 1 )
{
 if (sr[0].success)
 {
  System.Diagnostics.Trace.WriteLine("Part Created: " + sr[0].id);
  _productId = sr[0].id;
 }
 else
 {
  sforce.Error er = sr[0].errors[0];
  System.Diagnostics.Trace.WriteLine(er.message);
  v_message = "Create Part - FAILED
"+er.message;
}

 

  • April 01, 2004
  • Like
  • 0

How to replace null or empty value with 0.

I am passing 12 number fields to a Google chart.
If one of my fields is blank the chart does not render.
In my Visualforce page I what to replace the null value with 0.
Both of the following lines of code always return false even though one is ==null and the other is !=null.
['January',  {!if(Contact.Sales_01__c==null, 0, Contact.Sales_01__c}],
['January',  {!if(Contact.Sales_01__c!=null, 0, Contact.Sales_01__c}],

How do I do this in Visualforce without using a controller extension?
Another question: can I use a static Apex method and pass in the value and get back 0 if null, or the passed value not null?

Thanks.

  • August 17, 2012
  • Like
  • 0

When I execute the following code I get an error:  Required fields are missing: [DefaultPrice]

As you can see the DeafultPrice has beend hard coded to 1000.00.

Any ideas?

Thanks

 

// get pricebook id
string _priceBookId = GetProcebookId();

//   add part
sforce.Product _product = new sforce.Product();
_product.PricebookId = _priceBookId;
_product.ProductCode = _partCode;
_product.Name = _partName;
_product.DefaultPrice = 1000.00;    // <<<<<<<<<<<<<<<<<<<<<,
_product.Description = "created by poc";

sforce.SaveResult[] sr = binding.create(new sforce.sObject[] {_product});

if ( sr.Length == 1 )
{
 if (sr[0].success)
 {
  System.Diagnostics.Trace.WriteLine("Part Created: " + sr[0].id);
  _productId = sr[0].id;
 }
 else
 {
  sforce.Error er = sr[0].errors[0];
  System.Diagnostics.Trace.WriteLine(er.message);
  v_message = "Create Part - FAILED
"+er.message;
}

 

  • April 01, 2004
  • Like
  • 0