• rodrigoBF
  • NEWBIE
  • 25 Points
  • Member since 2013

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

Hi All,

 

I have written a trigger and need to test some code snippets. I got to know that System.Debug() would help me on this. So I add that where I needed and with what I needed to debug. But I can't find the results of this debug. In forums got that they are in "Monitoring > Debug Logs". But there are lot and can't find my reslut is in which Log. Please guide me.

 

Thanks,

Madhura

Hi,

I Have 4 Objects Ob1 is master from Ob2 and Ob2 Is Master from Ob3 and Ob3 is Master from 4.

There is any way to create a button in Ob1 to clone it and all the details ?

I'm Starter in SalesForce so, examples will be great.

Thank You

  • September 02, 2013
  • Like
  • 0

When CRD Record is created following fields should be update d on the order

Fields on CRD screen

Beginning CRD = formula field we discussed today morning

Ending CRD should be entered by User and stored in ORDER_Change_REQUESTS__C.Request_DATE__C

SFDC Request ID should be a auto number field which should generate new ID every time a new record Is generated.

Create a Status Picklist field (SFDC_REQUEST_STATUS__C ) in CRD change object with Value ‘Pending’ ,’Approved’ and ‘Rescheduled’ – New record should have status Pending.

 

hi i am gettng below error can anyone help me out on this .

ErrorError: crdchangebutton1 Compile Error: Constructor not defined: [crdchangebutton1.wrap].<Constructor>(SOBJECT:ORDER_Change_REQUESTS__c, Boolean, Integer) at line 52 column 49

 

 

 

<apex:page Controller="crdchangebutton1" sidebar="false">
<apex:form id="f1">
<apex:pageBlock >
<apex:pageBlockTable value="{!Orderchange}" var="r" id="lstupdt">
<apex:column headerValue="Change">
<apex:outputLabel value="{!r.sno}" />
</apex:column>

<apex:column headerValue="Beginning CRD">
<apex:outputText value="{0,date,M/dd/yyyy}">
<apex:param value="{!r.emp.Current_Requested_Date__c}" />
</apex:outputText>
</apex:column>

<apex:column headerValue="Enging CRD" id="c4">
<apex:outputLabel value="{!rec.propRequest Date}" rendered="{!NOT(rec.propEditable)}" id="opLbl4"/>
<apex:inputText value="{!rec.propREQUEST_DATE__c}" rendered="{!rec.propEditable}" style="background-color:#EBFFAE" id="inTxt4"/>
</apex:column>


<apex:column headerValue="Status">
<apex:outputText style="font-style:Regular" value=" {0}">
<apex:param value="{!r.emp.Status__c}"/>
</apex:outputText>
</apex:column>

<!-- <apex:inlineEditSupport showOnEdit="lstupdt"
hideOnEdit="editButton" event="ondblclick"
changedStyleClass="myBoldClass" resetFunction="resetInlineEdit"/> -->

</apex:pageBlockTable>
<apex:pageBlockButtons >
<apex:commandButton action="{!SaveLast}" value="Save" reRender="pB" rendered="{!rec.propEditable}" id="cBtn">
<apex:param name="prmId" value="javascript&colon;document.getElementById('{$Component.inTxt4}').value;" assignTo="{!propChange}"/>
</apex:commandButton>
</apex:pageBlockButtons>

</apex:pageBlock>


</apex:form>
</apex:page>

 

 

classs

-------------

 

public with sharing class crdchangebutton1
{
public String rec { get; set; }
public String propChange { get; set; }
public Boolean propEditable { get; private set; }
public date lastupdate { get; set; }

public String getEmp() {
return null;
}


public PageReference save()
{
return null;
}


List<Wrap> Orderchange {get;set;}
public Pagereference SaveLast()
{
System.Debug('---> ' + propChange);
return null;
}


public ApexPages.StandardSetController controller
{
get
{
if(controller==null)
{
controller = new ApexPages.StandardSetController([Select Id, Current_Requested_Date__c,Status__c FROM ORDER_Change_REQUESTS__c]);

}

return(controller);
}
set;
}


public list<wrap> getOrderchange()

{
Orderchange =new list<wrap>();

integer sno=1;

for(ORDER_Change_REQUESTS__c em:(list<ORDER_Change_REQUESTS__c>)controller.getRecords())
{
Orderchange.add(new wrap(em,sno++));
Orderchange.add(sno++);
sno++;

}
return Orderchange;
}

public class wrap
{
public integer sno{get;set;}
public Boolean propEditable { get; private set; }
public ORDER_Change_REQUESTS__c emp{get;set;}

public wrap( ORDER_Change_REQUESTS__c e,integer sn,Boolean xEdt)
{
emp=e;
sno=sn;
propEditable = xEdt;
}


}
}

 

Hi All,

 

I have written a trigger and need to test some code snippets. I got to know that System.Debug() would help me on this. So I add that where I needed and with what I needed to debug. But I can't find the results of this debug. In forums got that they are in "Monitoring > Debug Logs". But there are lot and can't find my reslut is in which Log. Please guide me.

 

Thanks,

Madhura

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 All,

 

   I wrote a Java program to chunk and join files to overcome the 3MB limit of file transfer in Salesforce.

 

   Now the problem is .. how to run in the Sandbox env.

 

    Basically, I want to attach a file to contacts..but if the file is more than 3MB, I want to chunk it and attach 2 files...and while I download the file ....I will join it using the Java program on the server side.

 

   Please, post the code snippets if you have.

Thanks

Sanjeev