• suneel.patchipulusu@gmail.com
  • NEWBIE
  • 50 Points
  • Member since 2013

  • Chatter
    Feed
  • 2
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 18
    Questions
  • 19
    Replies

Hello all

 

 

I want to compare the 'Active' and 'Draft' pricebooks through Reports??

 

While creating a reports I want to see the differences of both pricebooks, how to do this??

 

I already made a filter on 'Active' and 'Draft' Pricebooks.

 

>For suppose If I add any new PriceBookEntry in the Draft pricebook or If I change any Prices for the previous product, It has to show in the reports. how to do this.

 

Thanks in advance

Hello all

 

 

I want to compare the 'Active' and 'Draft' pricebooks??

 

While creating a reports I want to see the differences of both pricebooks, how to do this??

 

>For suppose If I add any new PriceBookEntry in the Draft pricebook, It has to show in the reports. how to do this.

 

Thanks in advance

 

Hello all

 

 

Is force.com uses the two-tier architecture or 3-tier architecture???

 

Because it uses the MODEL-VIEW-CONTROLLER rchitecture

 

But some websites saying that it is a 2-teir architecture

 

Which one is correct??

 

If anyone ssks what shouls I say??

Could anyone provide any link for this issue??

Thanks in advance

public with sharing class SharedConstants {
	private static final String STD_CUSTOMER_ACC_RECORDTYPE = 'Standard_Customer';
		
	public static ID STD_CUSTOMER_ACC_RECORDTYPE_ID {
		get {
			if( /*do this*/ LIMIT 1].Id;
			}
			return STD_CUSTOMER_ACC_RECORDTYPE_ID;
		}
	}

 

I have a class called 'Shared Constants' and it has an string attribute, here I have a question

Can I say  the below one is a method.and which returns an ID?? Is it correct

 

public static ID STD_CUSTOMER_ACC_RECORDTYPE_ID

+STD_CUSTOMER_ACC_RECORDTYPE_ID():ID can I specify llike this in a class diagram in the method section??????

Thanks in Advance
public static void handleDIOpportunities (List<Opportunity> opportunities) 
	{
		for (Opportunity opp: opportunities)
		{
			computeState(opp);
		}

List<Opportunity> opportunities ia an argument for the handleDIOpportunities

 

What exactly for loop does??

All list opportunities assign to Opp 

 

Here what is ComputeState????

 

Thanks in advance

public with sharing class AccountChangeDistriOwnerTriggerHandler implements Triggers.Handler 
{
	public void handle()
	{
		//filter accounts
		List<Account> stdAccs = new List<Account>();
		Map<Id,Id> accountToOwner = new Map<Id,Id>();
		for (SObject obj: Trigger.new)
		{
			Account a = (Account)obj;
                }
 
                if (!stdAccs.isEmpty())
		{
                }
}



 

What I am trying to do is draw a class diagram for the above code:

 

 

<<ClassName>>
AccountChangeDistriOwnerTriggerHandler

 

The above class implements  Triggers.Handler

 

Here triggers is class name and Handler is an interface, So interface and Enum depends on class name Triggers.(Is it correct)

 

 

<<ClassName>>Triggers

 

+manage():void

+bind(Evt event, Handler eh):Triggers

 

Those two are methods in Triggers class.If I am corect there is no attributes in the above class'

AccountChangeDistriOwnerTriggerHandler

And I connect the above class to interface because it implements Triggers.Handler and Handler is in Interface.

Technically: source inherits the target .

 

<<Interface>>

Interface Handler

+handle(): void

 

In inerface we have the method which return void and no attributes .

 

<<Enumeration>>

Enum Evt

 

beforeinsert

beforeupdate

In Enum we have these two attributes no methods.

 

What I want  is: IS List and Map should we consider as attributes or????? Please correct me in the view of class digram

Please correct me if iam in the wrong path

 

Thanks in advance

 

Hello all


Could any one tell us what are the attributes and what are the Operations or methods in the belo mention code, I am trying to draw an Class UML diagram???


public with sharing class SharedConstants { private static final String STD_OPP_RECORDTYPE = 'Standard_Opportunity'; //use Singleton to query the RecordType only if really needed public static ID STD_OPP_RECORDTYPE_ID { get { if(STD_OPP_RECORDTYPE_ID == null) { STD_OPP_RECORDTYPE_ID = [SELECT Id FROM RecordType WHERE DeveloperName = :STD_OPP_RECORDTYPE AND SobjectType = 'Opportunity' LIMIT 1].Id; } return STD_OPP_RECORDTYPE_ID; } } }

 Thanks in advance

 

Hello all

 

 

Could any one explain this part of code, I am unable to understand 

	// Internal mapping of handlers
	Map<String, List<Handler>> eventHandlerMapping = new Map<String, List<Handler>>();

	/**
	 * Core API to bind handlers with events
	 */
	public Triggers bind(Evt event, Handler eh) 
	{
		List<Handler> handlers = eventHandlerMapping.get(event.name());
		if (handlers == null) 
		{
			handlers = new List<Handler>();
			eventHandlerMapping.put(event.name(), handlers);
		}
		handlers.add(eh);
		return this;
	}

 The above code belongs to the standard trigger template

 

 

Thanks in advance 

Suneel

Could anyone tell me how to draw a class diagram for this Triggers class??????????


public class Triggers { /** * Enum representing each of before/after CRUD events on Sobjects */ public enum Evt { afterdelete, afterinsert, afterundelete, afterupdate, beforedelete, beforeinsert, beforeupdate } /** * Simplistic handler to implement on any of the event. It doesn't requires or enforces any patter except the * method name to be "handle()", a developer is free to use any Trigger context variable or reuse any other * apex class here. */ public interface Handler { void handle(); } // Internal mapping of handlers Map<String, List<Handler>> eventHandlerMapping = new Map<String, List<Handler>>(); /** * Core API to bind handlers with events */ public Triggers bind(Evt event, Handler eh) { List<Handler> handlers = eventHandlerMapping.get(event.name()); if (handlers == null) { handlers = new List<Handler>(); eventHandlerMapping.put(event.name(), handlers); } handlers.add(eh); return this; } /** * Invokes correct handlers as per the context of trigger and available registered handlers */ public void manage() { Evt ev = null; if(Trigger.isInsert && Trigger.isBefore) { ev = Evt.beforeinsert; } else if(Trigger.isInsert && Trigger.isAfter) { ev = Evt.afterinsert; } else if(Trigger.isUpdate && Trigger.isBefore) { ev = Evt.beforeupdate; } else if(Trigger.isUpdate && Trigger.isAfter) { ev = Evt.afterupdate; } else if(Trigger.isDelete && Trigger.isBefore) { ev = Evt.beforedelete; } else if(Trigger.isDelete && Trigger.isAfter) { ev = Evt.afterdelete; } else if(Trigger.isundelete) { ev = Evt.afterundelete; } List<Handler> handlers = eventHandlerMapping.get(ev.name()); if (handlers != null && !handlers.isEmpty()) { for (Handler h : handlers) { h.handle(); } } } }

 Thanks in advance

Hello all

 

Couls any one tell me what the SObject  obj does??    

According to my understanding:

NOrmally  SObject is an generic object and Account,Pricebook,Product,customObject__c are concrete objects

Trigger.New is used for to chnage the field values in that particular Object.

Below event I didnt undertstood what the flow is??? Could any one can explian??

 

This event fires beforeinsert

  for (SObject obj: Trigger.new)
        {
            Account a = (Account)obj;
            if (// condition)
            {
                // code
            }

 

 

Thanks in advance

Scenario: Concatenating four custom fields into one custom field, all fields belongs to the same custom Object called 'Claim__c'   

1.Claim_Invoice_Number__c

2.Claim_Invoice_Position__c

3.Claim_Document_Line_Item_Number__c

4. Claim_Line_Item__c  these four shoul be concatenate and putting into 'Invoice_Con__c'.I am getting an error in the below mentioned code

 

   Error Message: Illegal assignment from SObject:Claim__c to String

   This error message is giving in if{---}

    		Map<String,Claim__c> clmap = new Map<String,Claim__c>();  
    		for(Claim__c Invclm :[select ID,Claim_Invoice_Number__c,Claim_Invoice_Position__c
                        ,Claim_Document_Line_Item_Number__c,Claim_Line_Item__c from Claim__c ])
            {
            	clmap.put(Invclm.Claim_Invoice_Number__c+''+Invclm.Claim_Invoice_Position__c+''+
                         Invclm.Claim_Document_Line_Item_Number__c +''+ Invclm.Claim_Line_Item__c,Invclm);
            	System.debug('step 6:'+ Invclm.Claim_Invoice_Number__c+''+Invclm.Claim_Invoice_Position__c+''+
                         Invclm.Claim_Document_Line_Item_Number__c +''+ Invclm.Claim_Line_Item__c);
            } 
            
            for(SObject obj: Trigger.new)
            {
            	Claim__c cl = (Claim__c)obj;
            	if(clmap.containsKey(cl.Claim_Invoice_Number__c+''+cl.Claim_Invoice_Position__c+''+
                         cl.Claim_Document_Line_Item_Number__c +''+ cl.Claim_Line_Item__c))
            	{
            		cl.Invoice_Con__c=clmap.get(cl.Claim_Invoice_Number__c+''+cl.Claim_Invoice_Position__c+''+
                         cl.Claim_Document_Line_Item_Number__c +''+ cl.Claim_Line_Item__c);
            	}
            }  
               

 

 

Thanks in advance

          


Hello all

 

Scenario: I need to check the Invoice number in an Custom Object and if it is not unique it displays an error. But I am getting an error during in an execution. Could any one help on this??

 

 

Map<String, Claim__c> sclmap = new Map<String, Claim__c>();
//////////////////////////////////
//4 Unique Invoice number/////////
//////////////////////////////////
for(SObject obj: Trigger.new)
{
Claim__c cl =(Claim__c)obj;

cl.Unique__c=cl.Claim_Invoice_Number__c+cl.Claim_Invoice_Position__c
+cl.Claim_Document_Line_Item_Number__c+cl.Claim_Line_Item__c;



//////////////////////////////////////////////////
//Make sure we don't treat an Unique__c that isn't
//changing during an update as a duplicate////////
//////////////////////////////////////////////////
if( (System.Trigger.isInsert ||
(cl.Unique__c != System.Trigger.oldMap.get(cl.id).Unique__c)))

{
if (sclMap.containsKey(cl.Unique__c))
{
cl.InvoiceMessage__c = 'already Invoice is present';
}
else{
sclMap.put(cl.Unique__c, cl);
cl.InvoiceMessage__c = NULL;
}
}
}
//////////////////////////////////////////////////////////////////////////
//Using a single database query, find all Invoice nos in the claim table
//that have the same number as any of other claims being inserted or updated
////////////////////////////////////////////////////////////////////////////
for(Claim__c c : [select Unique__c from Claim__c
where Unique__c IN : sclMap.KeySet()] )
{
Claim__c newscl = sclMap.get(c.Unique__c);
//newscl.Error__c.addError('already Invoice is present');
newscl.InvoiceMessage__c = 'Invoice is already present';
}

 

 

 

I am getting this error 'Field expression not allowed for generic Sobject'

Scenario: I am comparing the dates from different Objects

Quote__c.CreatedDate =: clm.Claim_Invoice_Date__c (if these both dates are equla I will do some thing)

 

 

So,Here Quote__c is the custom object  and CreatedDate is the standard field (Normally it is created by) when we access this iin Apex we will get this CreatedDate--------------------   21.02.2013 15:35  here I need to get only Date, I dont ned the time and this date  I am comparing with Claim_Invoice_Date__c( It is an 'Date' datatype)

 

 

PLease could any one give some suggesstions for this

 

Thanks in advance

 

 

 

Scenario: I am comparing 2  custom fields in an Object. for this I created one formula field and I wrote like this but its giving syntax error

 

IF ((PB_List_Price__c != List_Price__c),
IMAGE("/img/samples/flag_red.gif","Red", 20, 20),
IMAGE("/img/samples/flag_green.gif","Green", 20, 20)
)

 

Thanks in advance

 

 

List<LQPricebook__c> lqp = new list<LQPricebook__c>();
//////////////////////////////////////////////////////
///6 PriceBook Check////////////////
//////////////////////////////////////////////////////
lqp = [SELECT ID, Name, ValidForm__c
FROM LQPricebook__c WHERE clm.Claim_Invoice_Date__c >= LQPricebook__c.ValidForm__c
                                                                    and (clm.Claim_Invoice_Date__c <= LQPricebook__c.ValidForm__c + ((365/12)* 3))
                                                            ]; 

if (lqp.size() != 0){

System.debug( 'exists' +lqp[0].ID);
clm.Pricebookno__c = lqp[0].ID ;
}else {

clm.Pricebookno__c = NULL;
}

 

 

In tthe above code I am getting an eror in SOQL statement. Could anyone can tell me whats the wrong in that??

 

I am getting an error like 'Unexpected token: LQPricebook__c.ValidFrom__c'

 

Thanks in advance

 

Hello All

 

Scenario: I have an Invoicenumber field (its an text data type).So, every user enters his data and save the record. After saving the record it will display the red or green flag

 

red-- indicates invoicenumber already exists,

Green--- indicates not exists the invoicenumber so no problem.

 

I dont want to use Unique check box. Through trigger I like to check whether this Invoicenumber already exists in custom Object or not

 

Could any one have any idea???

Please share ur suggestions?

 

Thankyou

Hello all

 

I have a scenario like

 

I dont want to change the field value or name for an existing record. I dont want to use the Record lock option. 

 

How to do this?? Couls any one give some suggesttions.

 

Eg: I have a field called SalesName in custom Object.

 

      There are some records existing in the custom object.

      I have a role of System Administrator. If I change the value of the existing record it should not be chabged, but I need here to show an error if the value changes. Could any one give some suggesttion?? 

 

 

Thanks in advance

 

 

 

 

 

 

 

 

1.  Id    =:   decAccount.id  

 

    Question: What '=:' represents?? what does it mean???

 

 

2. decAccount = [Select Id, Distributor__c FROM Account WHERE Id =:decAccount.id];

 

   Question : what will insert in to the decAccount ??

 

I understood llike we are selecting the id, custom object from account then..????

Hello all


Could any one tell us what are the attributes and what are the Operations or methods in the belo mention code, I am trying to draw an Class UML diagram???


public with sharing class SharedConstants { private static final String STD_OPP_RECORDTYPE = 'Standard_Opportunity'; //use Singleton to query the RecordType only if really needed public static ID STD_OPP_RECORDTYPE_ID { get { if(STD_OPP_RECORDTYPE_ID == null) { STD_OPP_RECORDTYPE_ID = [SELECT Id FROM RecordType WHERE DeveloperName = :STD_OPP_RECORDTYPE AND SobjectType = 'Opportunity' LIMIT 1].Id; } return STD_OPP_RECORDTYPE_ID; } } }

 Thanks in advance

 

Hello all

 

 

Could any one explain this part of code, I am unable to understand 

	// Internal mapping of handlers
	Map<String, List<Handler>> eventHandlerMapping = new Map<String, List<Handler>>();

	/**
	 * Core API to bind handlers with events
	 */
	public Triggers bind(Evt event, Handler eh) 
	{
		List<Handler> handlers = eventHandlerMapping.get(event.name());
		if (handlers == null) 
		{
			handlers = new List<Handler>();
			eventHandlerMapping.put(event.name(), handlers);
		}
		handlers.add(eh);
		return this;
	}

 The above code belongs to the standard trigger template

 

 

Thanks in advance 

Suneel

Could anyone tell me how to draw a class diagram for this Triggers class??????????


public class Triggers { /** * Enum representing each of before/after CRUD events on Sobjects */ public enum Evt { afterdelete, afterinsert, afterundelete, afterupdate, beforedelete, beforeinsert, beforeupdate } /** * Simplistic handler to implement on any of the event. It doesn't requires or enforces any patter except the * method name to be "handle()", a developer is free to use any Trigger context variable or reuse any other * apex class here. */ public interface Handler { void handle(); } // Internal mapping of handlers Map<String, List<Handler>> eventHandlerMapping = new Map<String, List<Handler>>(); /** * Core API to bind handlers with events */ public Triggers bind(Evt event, Handler eh) { List<Handler> handlers = eventHandlerMapping.get(event.name()); if (handlers == null) { handlers = new List<Handler>(); eventHandlerMapping.put(event.name(), handlers); } handlers.add(eh); return this; } /** * Invokes correct handlers as per the context of trigger and available registered handlers */ public void manage() { Evt ev = null; if(Trigger.isInsert && Trigger.isBefore) { ev = Evt.beforeinsert; } else if(Trigger.isInsert && Trigger.isAfter) { ev = Evt.afterinsert; } else if(Trigger.isUpdate && Trigger.isBefore) { ev = Evt.beforeupdate; } else if(Trigger.isUpdate && Trigger.isAfter) { ev = Evt.afterupdate; } else if(Trigger.isDelete && Trigger.isBefore) { ev = Evt.beforedelete; } else if(Trigger.isDelete && Trigger.isAfter) { ev = Evt.afterdelete; } else if(Trigger.isundelete) { ev = Evt.afterundelete; } List<Handler> handlers = eventHandlerMapping.get(ev.name()); if (handlers != null && !handlers.isEmpty()) { for (Handler h : handlers) { h.handle(); } } } }

 Thanks in advance

Scenario: Concatenating four custom fields into one custom field, all fields belongs to the same custom Object called 'Claim__c'   

1.Claim_Invoice_Number__c

2.Claim_Invoice_Position__c

3.Claim_Document_Line_Item_Number__c

4. Claim_Line_Item__c  these four shoul be concatenate and putting into 'Invoice_Con__c'.I am getting an error in the below mentioned code

 

   Error Message: Illegal assignment from SObject:Claim__c to String

   This error message is giving in if{---}

    		Map<String,Claim__c> clmap = new Map<String,Claim__c>();  
    		for(Claim__c Invclm :[select ID,Claim_Invoice_Number__c,Claim_Invoice_Position__c
                        ,Claim_Document_Line_Item_Number__c,Claim_Line_Item__c from Claim__c ])
            {
            	clmap.put(Invclm.Claim_Invoice_Number__c+''+Invclm.Claim_Invoice_Position__c+''+
                         Invclm.Claim_Document_Line_Item_Number__c +''+ Invclm.Claim_Line_Item__c,Invclm);
            	System.debug('step 6:'+ Invclm.Claim_Invoice_Number__c+''+Invclm.Claim_Invoice_Position__c+''+
                         Invclm.Claim_Document_Line_Item_Number__c +''+ Invclm.Claim_Line_Item__c);
            } 
            
            for(SObject obj: Trigger.new)
            {
            	Claim__c cl = (Claim__c)obj;
            	if(clmap.containsKey(cl.Claim_Invoice_Number__c+''+cl.Claim_Invoice_Position__c+''+
                         cl.Claim_Document_Line_Item_Number__c +''+ cl.Claim_Line_Item__c))
            	{
            		cl.Invoice_Con__c=clmap.get(cl.Claim_Invoice_Number__c+''+cl.Claim_Invoice_Position__c+''+
                         cl.Claim_Document_Line_Item_Number__c +''+ cl.Claim_Line_Item__c);
            	}
            }  
               

 

 

Thanks in advance

          

Scenario: I am comparing 2  custom fields in an Object. for this I created one formula field and I wrote like this but its giving syntax error

 

IF ((PB_List_Price__c != List_Price__c),
IMAGE("/img/samples/flag_red.gif","Red", 20, 20),
IMAGE("/img/samples/flag_green.gif","Green", 20, 20)
)

 

Thanks in advance

 

 

List<LQPricebook__c> lqp = new list<LQPricebook__c>();
//////////////////////////////////////////////////////
///6 PriceBook Check////////////////
//////////////////////////////////////////////////////
lqp = [SELECT ID, Name, ValidForm__c
FROM LQPricebook__c WHERE clm.Claim_Invoice_Date__c >= LQPricebook__c.ValidForm__c
                                                                    and (clm.Claim_Invoice_Date__c <= LQPricebook__c.ValidForm__c + ((365/12)* 3))
                                                            ]; 

if (lqp.size() != 0){

System.debug( 'exists' +lqp[0].ID);
clm.Pricebookno__c = lqp[0].ID ;
}else {

clm.Pricebookno__c = NULL;
}

 

 

In tthe above code I am getting an eror in SOQL statement. Could anyone can tell me whats the wrong in that??

 

I am getting an error like 'Unexpected token: LQPricebook__c.ValidFrom__c'

 

Thanks in advance

 

Hello All

 

Scenario: I have an Invoicenumber field (its an text data type).So, every user enters his data and save the record. After saving the record it will display the red or green flag

 

red-- indicates invoicenumber already exists,

Green--- indicates not exists the invoicenumber so no problem.

 

I dont want to use Unique check box. Through trigger I like to check whether this Invoicenumber already exists in custom Object or not

 

Could any one have any idea???

Please share ur suggestions?

 

Thankyou

Hello all

 

I have a scenario like

 

I dont want to change the field value or name for an existing record. I dont want to use the Record lock option. 

 

How to do this?? Couls any one give some suggesttions.

 

Eg: I have a field called SalesName in custom Object.

 

      There are some records existing in the custom object.

      I have a role of System Administrator. If I change the value of the existing record it should not be chabged, but I need here to show an error if the value changes. Could any one give some suggesttion?? 

 

 

Thanks in advance

 

 

 

 

 

 

 

 

1.  Id    =:   decAccount.id  

 

    Question: What '=:' represents?? what does it mean???

 

 

2. decAccount = [Select Id, Distributor__c FROM Account WHERE Id =:decAccount.id];

 

   Question : what will insert in to the decAccount ??

 

I understood llike we are selecting the id, custom object from account then..????