• Sankar
  • NEWBIE
  • 25 Points
  • Member since 2009

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 10
    Questions
  • 14
    Replies

How to build standard reports on hierarchical relationship data?

Thanks

Sankar

  • November 05, 2009
  • Like
  • 0

How to build a standard report on a customized dataset? Is it possible in sfdc?

Thanks

Sankar

  • November 05, 2009
  • Like
  • 0

I have a couple of objects(Object1 and Object2) and the relation is Object1 is Master and Object2 is Detail. 

Object2 has field1 which is a Number and will be derived from a formula. Object1 has field1Total which is Number and holds the sum of Object2.field1. Unable to use Roll-Up Summary since formula has expressions in it. 

Based on any change in field1 it should be reflected in Object1.field1Total. I have used the below trigger to update master object based on the entry in detail object. But it is not working can any one guide me.

trigger Object2Trigger on Object2__c (after delete, after insert,after update) { Object2__c[] 0bj2= Trigger.new; Double Total = 0.00; String o1Id = obj2[0].object1_Id__r.Id; for(Object__c o2:[Select b.field1__c From Object2__c b where b.object1_Id__r.Id= : o1Id]) { Total+=o2.field1__c; } List<Object1__c> toUpdate = new List<Object1__c> {}; for(Object1__c o1:[Select e.Id,e.field1Total__c From Object1__c e where e.Id = : o1Id]) { toUpdate.add(new Object1__c(Id = o1.Id, field1Total__c =Total)); } if(toUpdate.size() > 0){ update toUpdate; } }

 

 

Thanks

 Sankar

  • November 04, 2009
  • Like
  • 0

Does Roll Up Summary field supports formulas with expressions?

Thanks

Sankar

  • November 02, 2009
  • Like
  • 0

How to do the hierarchical relationship query of Oracle Select ... COnnect with .. start By under force.com reports ?

 

--sankar

Message Edited by Sankar on 10-28-2009 10:10 PM
  • October 29, 2009
  • Like
  • 0

Is it possible in sf, to generate reports if the objects are in a hierarchical structure.

 

 

Object1

   |

  Object2

     |

    Object3

      |

      Object4

 

1. Is possisble to generate a report such that it display custom fileds in the hierarchy?

2. In the above example if Object3 is choosed then a report should hold the cutom fileds of object3 and object4. Is this possible.

 

 

Thanks

Sankar 

  • October 27, 2009
  • Like
  • 0

I am using the below formula 

 

IF(ISBLANK( VALUE( Currency__c )), Amount_Spent__c, Amount_Spent__c * 50)

 

Formula return type is a number.  Currency__c is a lookup and Amount_Spent__c is a number field. For true ie if Currency__c is blank then it returns the desired value. But for an false condition it is returnin #error.

 

What is wrong with this formula can any one help me.

 

Regards

Sankar

  • October 20, 2009
  • Like
  • 0

Person.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

targetNamespace="http://www.person.org" xmlns="http://www.person.org"

elementFormDefault="qualified"> <xsd:complexType name="PersonType"> <xsd:sequence> <xsd:element name="Name" type="xsd:string"/> <xsd:element name="SSN" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema>

 

  Product.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.product.org" xmlns="http://www.product.org" elementFormDefault="qualified"> <xsd:complexType name="ProductType"> <xsd:sequence> <xsd:element name="Type" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:schema>

 

  Company.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.company.org" xmlns="http://www.company.org" xmlns:per="http://www.person.org" xmlns:pro="http://www.product.org" elementFormDefault="qualified"> <xsd:import namespace="http://www.person.org" schemaLocation="Person.xsd"/> <xsd:import namespace="http://www.product.org" schemaLocation="Product.xsd"/> <xsd:element name="Company"> <xsd:complexType> <xsd:sequence> <xsd:element name="Person" type="per:PersonType" maxOccurs="unbounded"/>

<xsd:element name="Product" type="pro:ProductType" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

 

 

In Company.xsd it imports an external schema, which is not supported in APEX.
Please let me know how to replace the following two lines:

 

<xsd:import namespace="http://www.person.org" schemaLocation="Person.xsd"/> <xsd:import namespace="http://www.product.org" schemaLocation="Product.xsd"/>

 

Thanks in advance. 

 Sankar
  • September 25, 2009
  • Like
  • 0

I am a trial user and my environment is JDK 1.5,JRE 1.5.0 and eclipse 3.4 with force plugins.

 

I am getting the following exception in while creating custom Object in Force IDE:

 

Plug-in "com.salesforce.ide.ui" was unable to instantiate class "com.salesforce.ide.ui.wizards.components.object.CustomObjectWizard".
Error creating bean with name 'customObjectMetadata' defined in class path resource [config/components.xml]: Cannot create inner bean 'util:constant#1754daa' of type [org.springframework.beans.factory.config.FieldRetrievingFactoryBean] while setting bean property 'sharingModel'; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'util:constant#1754daa#3': Post-processing of the FactoryBean's object failed; nested exception is java.lang.StackOverflowError

 

Kinldy guide me.

 

Thanks

 

  • September 04, 2009
  • Like
  • 0

I'm a new developer with apex. I am the getting the error when i tried to create an apex class and trigger. Could any one can help me?

 

Apex Trigger:

 

trigger ExpenseTrigger on Expense__c (before insert, before update) {

ExpenseUtil.areExpensesAllowed(Trigger.new);

}

 

Apex Class:

 

public with sharing class ExpenseUtil {

static final Double MAX_EXPENSE_PER_DAY = 1000000.00;

public static void areExpensesAllowed(Expense__c[] expenses) {

Double totalExpenses = 0;

String createdbyId = UserInfo.getUserId();

 

/* Adds the expenses created in previous requests for today */

for(Expense__c eq:[SELECT ExpenseInRs__c FROM Expense__c

WHERE Date__c = TODAY

 AND Expense__c.createdById = :createdbyId AND ExpenseInRs__c != null]) {

totalExpenses += eq.ExpenseInRs__c;

}

/* Totals the expenses in the request */

 for (Expense__c e:expenses) {

totalExpenses += e.ExpenseInRs__c;

if(totalExpenses > MAX_EXPENSE_PER_DAY)e.addError('Expense request exceeds daily limit: ' + MAX_EXPENSE_PER_DAY);

}

}

 

static testMethod void areExpensesAllowed() {System.assert('Expense' == 'Expense');

}

}

 

 

Even tried with some comments displayed in the community but not working. Thanks in advance :smileyhappy:

  • September 03, 2009
  • Like
  • 0

Is there any convention to save non salesforce users records or data when they are accessing a application through sites.

 

Thanks

Nithya

  • December 22, 2009
  • Like
  • 0

How to build a standard report on a customized dataset? Is it possible in sfdc?

Thanks

Sankar

  • November 05, 2009
  • Like
  • 0

How to do the hierarchical relationship query of Oracle Select ... COnnect with .. start By under force.com reports ?

 

--sankar

Message Edited by Sankar on 10-28-2009 10:10 PM
  • October 29, 2009
  • Like
  • 0

Is it possible in sf, to generate reports if the objects are in a hierarchical structure.

 

 

Object1

   |

  Object2

     |

    Object3

      |

      Object4

 

1. Is possisble to generate a report such that it display custom fileds in the hierarchy?

2. In the above example if Object3 is choosed then a report should hold the cutom fileds of object3 and object4. Is this possible.

 

 

Thanks

Sankar 

  • October 27, 2009
  • Like
  • 0

I am using the below formula 

 

IF(ISBLANK( VALUE( Currency__c )), Amount_Spent__c, Amount_Spent__c * 50)

 

Formula return type is a number.  Currency__c is a lookup and Amount_Spent__c is a number field. For true ie if Currency__c is blank then it returns the desired value. But for an false condition it is returnin #error.

 

What is wrong with this formula can any one help me.

 

Regards

Sankar

  • October 20, 2009
  • Like
  • 0

Person.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema"

targetNamespace="http://www.person.org" xmlns="http://www.person.org"

elementFormDefault="qualified"> <xsd:complexType name="PersonType"> <xsd:sequence> <xsd:element name="Name" type="xsd:string"/> <xsd:element name="SSN" type="xsd:string"/> </xsd:sequence> </xsd:complexType> </xsd:schema>

 

  Product.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.product.org" xmlns="http://www.product.org" elementFormDefault="qualified"> <xsd:complexType name="ProductType"> <xsd:sequence> <xsd:element name="Type" type="xsd:string" minOccurs="1" maxOccurs="1"/> </xsd:sequence> </xsd:complexType> </xsd:schema>

 

  Company.xsd

 

<?xml version="1.0"?> <xsd:schema xmlns:xsd="http://www.w3.org/2001/XMLSchema" targetNamespace="http://www.company.org" xmlns="http://www.company.org" xmlns:per="http://www.person.org" xmlns:pro="http://www.product.org" elementFormDefault="qualified"> <xsd:import namespace="http://www.person.org" schemaLocation="Person.xsd"/> <xsd:import namespace="http://www.product.org" schemaLocation="Product.xsd"/> <xsd:element name="Company"> <xsd:complexType> <xsd:sequence> <xsd:element name="Person" type="per:PersonType" maxOccurs="unbounded"/>

<xsd:element name="Product" type="pro:ProductType" maxOccurs="unbounded"/> </xsd:sequence> </xsd:complexType> </xsd:element> </xsd:schema>

 

 

In Company.xsd it imports an external schema, which is not supported in APEX.
Please let me know how to replace the following two lines:

 

<xsd:import namespace="http://www.person.org" schemaLocation="Person.xsd"/> <xsd:import namespace="http://www.product.org" schemaLocation="Product.xsd"/>

 

Thanks in advance. 

 Sankar
  • September 25, 2009
  • Like
  • 0

I'm a new developer with apex. I am the getting the error when i tried to create an apex class and trigger. Could any one can help me?

 

Apex Trigger:

 

trigger ExpenseTrigger on Expense__c (before insert, before update) {

ExpenseUtil.areExpensesAllowed(Trigger.new);

}

 

Apex Class:

 

public with sharing class ExpenseUtil {

static final Double MAX_EXPENSE_PER_DAY = 1000000.00;

public static void areExpensesAllowed(Expense__c[] expenses) {

Double totalExpenses = 0;

String createdbyId = UserInfo.getUserId();

 

/* Adds the expenses created in previous requests for today */

for(Expense__c eq:[SELECT ExpenseInRs__c FROM Expense__c

WHERE Date__c = TODAY

 AND Expense__c.createdById = :createdbyId AND ExpenseInRs__c != null]) {

totalExpenses += eq.ExpenseInRs__c;

}

/* Totals the expenses in the request */

 for (Expense__c e:expenses) {

totalExpenses += e.ExpenseInRs__c;

if(totalExpenses > MAX_EXPENSE_PER_DAY)e.addError('Expense request exceeds daily limit: ' + MAX_EXPENSE_PER_DAY);

}

}

 

static testMethod void areExpensesAllowed() {System.assert('Expense' == 'Expense');

}

}

 

 

Even tried with some comments displayed in the community but not working. Thanks in advance :smileyhappy:

  • September 03, 2009
  • Like
  • 0

Hi.

 

I'm new on Salesforce and i searching for a tutorial or similar how to develop Java PlugIns for salesforce. But i cant find any.

Hi,
I have developed a simple apex class with a sebservice in it.I want to invoke that web service using a soap client.I was able to geenrate the enterpriseWSDL and got a bunch of java classes using wsdl2java tool.Now can you plz explain how to write a clint or a standalone program to invoke that web service.if possible some code snippet.

Simple apex class
global class MyWebService {
 webservice static void SayHello(String name){
System.debug('hello '+name);
        }
}

I had created a bunch of java files by using the utility of axis WSDL2java.It created almost 11 classes

1) InvalidFieldFault
2) InvalidIdFault
3) InvalidNewPasswordFault
4) InvalidQueryLocatorFault
5) InvalidSObjectFault
6) LoginFault
7) MalformedQueryFault
8) MalformedSearchFault
9) SforceServiceCallbackHandler
10) SforceServiceStub
11) UnexpectedErrorFault.

After creating all the java clsses,I had put them on eclipse and  ensure that they will compile.Now i need to write a soap client to call the webservice Mywebservice and get the response.can anyone plz help me on this.thanks in advance

Hello Everyone,

I am very new to Salesforce.com, I need to read and write a CSV file using Apex code.

Functionality wants to implement : Read some records using query and write into a excel file and
read a CSV file and insert records into database.
this should be using apex code.

Please help me :)

Thanks