• Premanath
  • SMARTIE
  • 712 Points
  • Member since 2012
  • Infosys

  • Chatter
    Feed
  • 28
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 19
    Questions
  • 273
    Replies
Hi,
 
I need small favor from you, help me on below issue please.
 
Requirement à In Approval Process quote(Object) records gets Locked Automatically, when the user approves . We want to unlock the record using Trigger.
 
Salesforce newly implemented method called unlock(recordsToUnlock), but it’s not  working as expected.
Ref: https://releasenotes.docs.salesforce.com/en-us/winter16/release-notes/rn_apex_approval_locks_unlocks.htm
 
  1.       I am updating the status field in Quote when user approves, from approval Process.
  2.       In debug logs it’s coming into the trigger, I guess record is locking after the trigger fires.
  3.       May be the problem with Order of execution.
 
Could you please help me, Is there any way to resolve this issue.
 
Thanks
Prem
 


Date text field should Accept only dd/mm/yyyy

String RE_date= '(0?[1-9]|[12][0-9]|3[01])/(0?[1-9]|1[012])/((19|20)\\d\\d)';
  Pattern MyPattern = Pattern.compile(RE_date);
Matcher MyMatcher = MyPattern.matcher(myDate);

The above code is working 

if we enter 5/6/1988 also it is Accepting... so i need it should accept only dd/mm/yyyy (05/06/1988)... other wise it should give error..
how can i achive this.

I am trying to create a trigger that would add a new value to a related list if a value is adeded to a field.

The field is called Reason of Contact (ROC) and when ever a new reason of contact is added or the field is populated it brings the new value to the related list in the Case. This is working correctly but when ever the first reason of contact is added to the case this value is entered twice. But after that everything works fine. So can someone see what is wrong with the code so that it would not create a duplicate value if the list for Reason Of Contacts (ROCs) is empty.

//


trigger createROCchildonCaseUpdate on Case (after update) {

// Create an empty list of String
List<Reasons_of_Contact__c> ROCs = new List<Reasons_of_Contact__c>();

    //For each case processed by the trigger, add a new  

    //ROC record for the specified case.  

    //Note that Trigger.New is a list of all the new positions  

    //that are being created.  

    for (Case newCase : Trigger.new) {
    Case oldCase = Trigger.oldMap.get(newCase.Id);
    if (oldCase.Request_3__c != newCase.Request_3__c | oldCase.Request_3__c != NULL) {

         //Create the new ROC in the related list with the following values
               ROCs.add(new Reasons_of_Contact__c(
                        ProgramCaseLink__c = newCase.Id,
                        Type__c = newCase.Request_3__c,
                        ProgramCommentLookup__c = newCase.Program__c));
        }
    }
    insert ROCs;
}

I have an output panel inside my apex:repeat tag.

My requirement is to conditionally display it.

So for one element in apex:repeat this panel might be rendered ..for some not. Rendering condition is,i need to check whether line item occurs in another controller set variable.

I find it difficult because of following reasons;

1)I understand you cannot check whether a set variable contains this element on visualforce page .or is this possible

2) i can see you cannot pass arguments in your rendered attribute.else i could have specify a boolean value for rendered attribute and set the value based on lineitem passed from front end

3)as the set variable is totally unrelated to line item.i cannot simply specify as below

<apex:repeat value="{!Proposals}" var="item">
<apex:outputPanel rendered="{!item.LineCount > 0}">
<li>
<a href="{!$Page.aa_rg_jm_proposal}?id={!item.Proposal.ID}">{!item.Proposal.Name}</a>
<span class="ui-li-count">{!item.LineCount}</span>
</li>
</apex:outputPanel>
</apex:repeat>

 

<apex:page standardController="Account">
  <apex:pageBlock title="Hello{!$User.FirstName} {!$User.LastName}">
  </apex:pageBlock>
   <apex:PageBlock title="Contacts">
       <apex:pageBlockTable value="{!account.Contacts}" var="con">
       <apex:column value="{!con.name}"/>
       <apex:column value="{!con.LastName}"/>
       <apex:column value="{!con.Phone}"/>
       <apex:column value="{!con.Title}"/>
       </apex:pageBlockTable>
   </apex:PageBlock>
</apex:page>

 

want 2 create a table but i am unable 2 see the fields name,LastName,phone,Title and their data pls help me what is the error

Hi Guys,

 

 I want to create a pdf of my vf page ,

 

 we can create like this way

 

pdfPage = page.product_delivery;//new PageReference('/apex/product_delivery1');
pdfPage.getParameters().put('id',oppid);
pdfPage.setRedirect(false);
Blob b=pdfPage.getContentAsPDF();

 

In my vf i am displaying some records with checkbox. When i click on Selected Button , It is displaying Selected Records.

 

I want to Create PDF for Selected Records only.

 

But it is Generating PDF for my intial VF page.. 

 

 

please suggest me..

 

 

 

prem

When the page loads there will be an output text that is generated into an input field. I want that value to be submitted into salesforce. The content loads into the boxes, but it won't submit to the lead record. 

 

<body onload="XYZ()"> 
 </body>   
    <apex:form > 
    <br/><br/> 
    <apex:actionFunction name="lg" action="{!iTEST}" rerender="jsvalues">
    <apex:param name="lt" value="" assignTo="{!valueLt}"/>
    </apex:actionFunction>
        <apex:outputPanel id="jsvalues">
        <apex:outputText value="Value lt:{!valueLt}" /><br/>
         <input type="text" name="{!Lead.Lt__c}" value="{!valueLt}"/>
    </apex:outputPanel>
    </apex:form>
  </apex:define> 
  <html>
<body>

I have to query from a custom object.

In the apex class i have to pass two lists as given below:

 

Select  field1__c,field2__c ,  ,field3__c,field4__c,field5__c,field6__c,field7__c
From Object_custom__c where
field1__c in : List1 AND 
field6__c in : List6

 

When I run the following query in developer console but it gives 'Unknown error parsing query'.

 

Select  field1__c,field2__c ,  ,field3__c,field4__c,field5__c,field6__c,field7__c
From Object_custom__c where
field1__c in : ['Field1_value1,' Field1_value2'] AND 
field6__c in : ['Field6_value1,' Field6_value2']

 

 

Hello Folks,

 

What is the sequence while deployment from sandbox to Production?

 

Lets say, I've  Custom Objects /Roles / Profiles/VF Pages/Classes/Triggers.Which one to be moved first to Production? -

 

What is the Sequence of it.

 

Appreciate your help.

How to remove trailing zero with decimal format for <apex:inputField>  and <apex:outputField>

Field Definition - Decimal - (10,5) - Five Decimal precision

Example :

Value : 5.01 - SFDC stores and displayed as 5.01000. I need to remove the trailing zeros. Actual value should be 5.01

I have a after insert, after update trigger that calls a class with @future annotation.

 

When i insert a record, a field in the record gets populated with a value based on existing records in the data base.

 

My trigger is working well but after i insert a record, I have to do do F5 (i.e refresh) to see the field value.

 

 

I don't have to do F5 on update, it's only on insert.

 

Is there any way to refresh the page after the (after insert) trigger is fired ?

 

I don't have any VFP. It's a standard page.

 

It's strange that sometimes the field is updated immediately after insert, without having to refresh.

 

i read a post with similar issue http://boards.developerforce.com/t5/Apex-Code-Development/Refresh-a-page-after-insert/td-p/504945 which doesn't resolve my problem.

 

Thanks.

 

 

 

 

 

Hi,

 

I have two picklist fields.

 

I am able to apply style for controlling field but the style is not getting applied to dependent picklist.

 

Does anyone know how to apply style to dependent picklist.

 

Even I put javascript for onchange event of controlling picklist field to apply style for dependent picklist.

But it is not working.

 

It will be great help if some one have any idea to do it.

 

Thanks!