• KarthikThotaSFDC
  • NEWBIE
  • 25 Points
  • Member since 2013

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

<entry key="process.useEuropeanDates" value="true"/>
<entry key="sfdc.timeZone" value="India Standard Time (Asia/Calcutta)"/>

 

Even i included the above two points in Process-config.xml, date is decreasing by minus one when the record is inserting in Salesforce.

 

Please suggest, how to insert correct date while command line interface is using.

 

Thanks in Advance,

Karthik.

Hi,

 

can you tell me, how to disable the standard CreatePDF button on quote view page based on status picklist value.

 

CreatePDF button should be enable only when that status is  "Approved " or "Accepted"

 

Thanks in Advance

Karthik

Hi,

 

trigger QuoteSubmitForApproval on QuoteLineItem (after insert,after update)
{
List<QuoteLineItem> qLineItem =new List<QuoteLineItem>();
qLineItem=[select id,quoteId,quote.status,PricebookEntryId,PricebookEntry.Pricebook2Id,Discount,PricebookEntry.Product2Id,PricebookEntry.Product2.name,PricebookEntry.Product2.UAE_Discount__c from QuoteLineItem where id=:Trigger.newMap.keySet()];
//User u = [select id,ManagerId from User where Id =: Userinfo.getUserId()];
Set<String> quoteIds=new Set<String>();
for(Integer i = 0;i<qLineItem.Size();i++)
{
System.debug('----i-----'+i);
System.debug('-----QlineItem Discount----'+qLineItem[i].Discount);
System.debug('------Product Discount------'+qLineItem[i].PricebookEntry.Product2.UAE_Discount__c);
if((qLineItem[i].Discount > qLineItem[i].PricebookEntry.Product2.UAE_Discount__c) && (qLineItem[i].quote.status <> 'Approved') && (qLineItem[i].quote.status <> 'Accepted') /*&& (u.ManagerId!=null)*/ )
{
if(!(quoteIds.contains(qLineItem[i].QuoteId)))
{
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setComments('Submitted for Approval. Please Review');
req.setNextApproverIds(new Id[] {UserInfo.getUserId()});
req.setObjectId(qLineItem[i].QuoteId);
Approval.ProcessResult result = Approval.Process(req);
System.debug('Submitted for approval successfully: '+result.isSuccess());
quoteIds.add(qLineItem[i].QuoteId);
}
}
else
{
System.debug('No Manager for this User');
}
}
}

 

 

 

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger QuoteSubmitForApproval caused an unexpected exception, contact your administrator: QuoteSubmitForApproval: execution of AfterInsert caused by: System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process found.: []: Trigger.QuoteSubmitForApproval: line 20, column 1

 

.......When i am trying to create a quote, i was throwing the above exception.

 

Anyone please suggest, how to overcome on this ...

 

 

 

 

 

<entry key="process.useEuropeanDates" value="true"/>
<entry key="sfdc.timeZone" value="India Standard Time (Asia/Calcutta)"/>

 

Even i included the above two points in Process-config.xml, date is decreasing by minus one when the record is inserting in Salesforce.

 

Please suggest, how to insert correct date while command line interface is using.

 

Thanks in Advance,

Karthik.

Hi,

 

trigger QuoteSubmitForApproval on QuoteLineItem (after insert,after update)
{
List<QuoteLineItem> qLineItem =new List<QuoteLineItem>();
qLineItem=[select id,quoteId,quote.status,PricebookEntryId,PricebookEntry.Pricebook2Id,Discount,PricebookEntry.Product2Id,PricebookEntry.Product2.name,PricebookEntry.Product2.UAE_Discount__c from QuoteLineItem where id=:Trigger.newMap.keySet()];
//User u = [select id,ManagerId from User where Id =: Userinfo.getUserId()];
Set<String> quoteIds=new Set<String>();
for(Integer i = 0;i<qLineItem.Size();i++)
{
System.debug('----i-----'+i);
System.debug('-----QlineItem Discount----'+qLineItem[i].Discount);
System.debug('------Product Discount------'+qLineItem[i].PricebookEntry.Product2.UAE_Discount__c);
if((qLineItem[i].Discount > qLineItem[i].PricebookEntry.Product2.UAE_Discount__c) && (qLineItem[i].quote.status <> 'Approved') && (qLineItem[i].quote.status <> 'Accepted') /*&& (u.ManagerId!=null)*/ )
{
if(!(quoteIds.contains(qLineItem[i].QuoteId)))
{
Approval.ProcessSubmitRequest req = new Approval.ProcessSubmitRequest();
req.setComments('Submitted for Approval. Please Review');
req.setNextApproverIds(new Id[] {UserInfo.getUserId()});
req.setObjectId(qLineItem[i].QuoteId);
Approval.ProcessResult result = Approval.Process(req);
System.debug('Submitted for approval successfully: '+result.isSuccess());
quoteIds.add(qLineItem[i].QuoteId);
}
}
else
{
System.debug('No Manager for this User');
}
}
}

 

 

 

Error: Invalid Data. 
Review all error messages below to correct your data.
Apex trigger QuoteSubmitForApproval caused an unexpected exception, contact your administrator: QuoteSubmitForApproval: execution of AfterInsert caused by: System.DmlException: Process failed. First exception on row 0; first error: NO_APPLICABLE_PROCESS, No applicable approval process found.: []: Trigger.QuoteSubmitForApproval: line 20, column 1

 

.......When i am trying to create a quote, i was throwing the above exception.

 

Anyone please suggest, how to overcome on this ...

 

 

 

 

 

Hi

    we have a  requirement of

 How to restrict  Pricebook selection based on  opportunity  picklist of country.

 

Decp:When we  Select a picklist value as India in opportunity, we have to access india price book only.

 

How to achieve this requirment ? 

 

Thanks in Advance 

  • February 20, 2013
  • Like
  • 0