• Rakesh A
  • NEWBIE
  • 40 Points
  • Member since 2015
  • Lead Salesforce Developer
  • Maersk Line UK Ltd

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 1
    Questions
  • 22
    Replies
Hi everyone!!!!!!

Common Name (Alias)" + "Registration type" + " Full Country Name"


Alias Name is Sree+ Common+England


My requirment is Sree on England----> This is result


But In registration type Last two letters has to display and also it is picklist field.

How can I do this?

Thank you!
  • October 10, 2016
  • Like
  • 0
We have created a process builder to create a new case when customer replies to Closed case, which is working fine.

Then after if customer replies to the closed case again, we are expexting that Email should come under new Case.
How can we accomplish this task?
I have a requirement where I have to copy the pdf in Notes and Attachments of Parent object to Files in Child object when it is created. It gets created when the status of the parent object changes to InApproval. My code is

trigger CopyAttachmentsToPIN on Attachment (after insert) {
      Set<Id> bcIds = new Set<Id>();
      for(Attachment file : Trigger.new) 
      {
            // only collect those that are for the InvoiceScan object (others can be ignored)
            if(file.ParentId.getSObjectType() == CTPISA__BookingCapture__c.getSObjectType()) 
            {
                bcIds.add(file.ParentId);
                system.debug(bcIds);
            }
       }
    
    if(!bcIds.isEmpty()) 
    {
                Map<Id,c2g__codaPurchaseInvoice__c> ruMap = new Map<Id,c2g__codaPurchaseInvoice__c>();
                List<Attachment> attachments = new List<Attachment>();
                for(c2g__codaPurchaseInvoice__c obj : [select Id, CTPISA__BookingCapture__c from c2g__codaPurchaseInvoice__c where CTPISA__BookingCapture__c in : bcIds])
                {
                    ruMap.put(obj.CTPISA__BookingCapture__c, obj);
                }
                for(Attachment file : Trigger.new)
                {
                        if(ruMap.containsKey(file.ParentId))
                        {
                            Attachment newFile = file.clone(false);
                            newFile.ParentId = ruMap.get(file.ParentId).Id;
                            attachments.add(newFile);
                        }
                }
        // finally, insert the cloned attachments
        insert attachments;   

    }


}

I need to insert the attachments as Files now it's getting attached as Attachments in Child Object. Any idea?
trigger

 

Hi There,
We have a requirement to delete all data in a custom object daily and load it from external data source.

We have a APEX class as per below:

@RestResource(urlMapping='/DeleteRecords/*')
global with sharing class DeleteRecords 
{
@HttpDelete 
    global static void doDelete()
     {
       List<MTDYTD_Trend_Data__c> customObj = [select Id FROM CustomObject LIMIT 10000];
       if(!customObj.isEmpty())
         delete customObj;
     }
}

As we are calling this class from external source and the records are above 10 K it fails. How can we tweak the above to run it in a loop till the entire records in the object is cleared out?

Please advise.

Thank you.

Hi, I'm new to validation rules. I'm wondering if there was a way to compare if any of the 4 fields have the same value. These 4 fields are user object fields. If not, would workflow be better for this?
I have a requirement wherein there is a multi select picklist test__c which has 6 values a,b,c,d,e,f.

If I select "a", I cannot select any combination with "a" i.e ab,ac,ad,ae,af. How can I achive this with validation rule.
I have a validation rule on master object(Opportunity).I have rollup summary field on parent Object. I am checking in the validation that if no records is there in the child object then fire this validation rule. But i am facing issue while deleting the last child object record which is in the related list of parent as the validation rule fire first and does not allow me to delete the last child record. 
Please let me know how do i update my validation ruleso that it allows me to delete all the child records and should fire when when insert or update the parent record. Below is my validation rule:(Total_Resource_Badge__c is a rollup summary field)

AND(OR( 
ISPICKVAL(StageName, '3. Solutioning'), 
ISPICKVAL(StageName, '4. End-Game'), 
ISPICKVAL(StageName, '5. Negotiation'), 
ISPICKVAL(StageName, 'Won') 
), 
INCLUDES(Delivery_Construct__c , "Involves rebadging of resources") ,
Total_Resource_Badge__c=0)
IF((MOD(DATEVALUE(Calculating_Date__c)-DATE(1996,01,01), 7) < 5),

 (IF((NOW() > Calculating_Date__c),
 ((ROUND(12*(
(5*FLOOR((TODAY()-DATE(1996,01,01))/7) +
MIN(5, 
    MOD(TODAY()-DATE(1996,01,01), 7) +
    MIN(1, 24/12*(MOD(NOW()-DATETIMEVALUE('1996-01-01 12:00:00'), 1)))
))
-
(5*FLOOR((DATEVALUE(Calculating_Date__c)-DATE(1996,01,01))/7) +
MIN(5, 
    MOD(DATEVALUE(Calculating_Date__c )-DATE(1996,01,01), 7) +
    MIN(1, 24/12*(MOD(Calculating_Date__c -DATETIMEVALUE('1996-01-01 12:00:00'), 1)))
))
), 0))
+
IF( (21 > (VALUE(MID(RIGHT((TEXT(NOW() + 0.2291)),9),0,2)))) || (9 < (VALUE(MID(RIGHT((TEXT(  NOW() + 0.2291)),9),0,2)))) , 
 (VALUE(MID(RIGHT((TEXT(NOW() + 0.2291)),9),0,2)) - 9),0 )),
((ROUND(12*(
(5*FLOOR((TODAY()-DATE(1996,01,01))/7) +
MIN(5, 
    MOD(TODAY()-DATE(1996,01,01), 7) +
    MIN(1, 24/12*(MOD(NOW()-DATETIMEVALUE('1996-01-01 12:00:00'), 1)))
))
-
(5*FLOOR((DATEVALUE(Calculating_Date__c )-DATE(1996,01,01))/7) +
MIN(5, 
    MOD(DATEVALUE(Calculating_Date__c )-DATE(1996,01,01), 7) +
    MIN(1, 24/12*(MOD(Calculating_Date__c -DATETIMEVALUE('1996-01-01 12:00:00'), 1)))
))
), 0))
-
IF( (21 > (VALUE(MID(RIGHT((TEXT(NOW() + 0.2291)),9),0,2)))) || (9 < (VALUE(MID(RIGHT((TEXT(NOW() + 0.2291)),9),0,2)))) , 
 (VALUE(MID(RIGHT((TEXT(NOW() + 0.2291)),9),0,2)) - 9), 0)))),

IF((NOW() >  Calculating_Date__c ),
(((
 (NOW() -  Calculating_Date__c ) * 5 -
 (MOD(DATEVALUE(Calculating_Date__c) - DATE(1970,1,4),7) - MOD(TODAY() - DATE(1970,1,4),7)) * 2
) / 7 -
IF(MOD(TODAY() - DATE(1970,1,4),7) = 6,1,0) -
IF(MOD( DATEVALUE(Calculating_Date__c) - DATE(1970,1,4),7) = 0,1,0))*12
+
(VALUE(MID(RIGHT((TEXT(NOW() + 0.2291)),9),0,2)) - 9)),
((
 (NOW() -  Calculating_Date__c ) * 5 -
 (MOD(DATEVALUE(Calculating_Date__c) - DATE(1970,1,4),7) - MOD(TODAY() - DATE(1970,1,4),7)) * 2
) / 7 -
IF(MOD(TODAY() - DATE(1970,1,4),7) = 6,1,0) -
IF(MOD( DATEVALUE(Calculating_Date__c) - DATE(1970,1,4),7) = 0,1,0))*12
-
(VALUE(MID(RIGHT((TEXT(  NOW() + 0.2291)),9),0,2)) - 9)))
here It's provide the wrong answer in the value to taking in the Calculating Date to the NOW()  here I show the example to be provide the understand clearly, To select the Calculating Date is 10/17/2016 4.27PM and the value of NOW() is 10/18/2016 4.28 PM then the output comes by the formula is 19 hours but in practically the calculating Date is to be started to be a time to measured from the given input time so here the actual time is 4.27  only  so the output is only12 hours only .
Here the problem means if selected to the any date to the NOW() value it's to be only added the value of the current hour(NOW() values hour only) it's doesn't start to calculate the hour from the Calculating Date time it's considered thus value in 12 hours constant.So I don't know to how change the value and to be calculated from the Calculating Date given values time.
So that's why I am confusing here  to rectify that time considered problem.
So please help me to solve this issue in here .For answer's thanks in advance.  Thanks Mohan
 
Hi - how to fix this formula?   If record type is Cake, then make it 0.  Then proceed to add up the Amounts 1-3.

IF( 
RecordType.Name = "Cake",0,
(Amount_1__c + 
Amount_2__c +
Amount_3__c)
I have a Workflow Rule with time-based actions, set to evaluate when the record is edited to become true.  The aim is to have it trigger when a checkbox field is checked by another WRF,  The immediate action is to untick the Checkbox.  Thereafter, the second set of criteria should control whether the actions may still run as scheduled.

With the following nested criteria, the WFR fails to trigger at all.   In theory it should work, but in practice it doesn't.  


OR( 
Membership_Renewal_Reminder_Trigger__c = True, 
AND( 
Agreement_Completion_Date__c >= Today(), 
ISPICKVAL(Status__c,"Active"), 
Includes(Relationship__c,"Member")))


Any help would be appreciated.

Rick
 
We have created a process builder to create a new case when customer replies to Closed case, which is working fine.

Then after if customer replies to the closed case again, we are expexting that Email should come under new Case.
How can we accomplish this task?
Hi guys,

I want to devlop a vf page where i can create records in Account, opportunity and Contact. Opportunity and contact records must be associated with the Account.

Thanks in advance.
Hi everyone!!!!!!

Common Name (Alias)" + "Registration type" + " Full Country Name"


Alias Name is Sree+ Common+England


My requirment is Sree on England----> This is result


But In registration type Last two letters has to display and also it is picklist field.

How can I do this?

Thank you!
  • October 10, 2016
  • Like
  • 0
Earned 7 Badges and 10125 Points, how to claim for limited edition sweatshirt ? please email me @ prabhu.c@mphasis.com

Hi I am using a java script method from visual force to make sure only one check box is selected in pageblocktable at a time.

 

Here is the script;

 

<script>
var selectedChkbox;
function deSelectOthers(chkBox) {

if (chkBox.checked) {
if ((chkBox != selectedChkbox) && (selectedChkbox != null)) {
selectedChkbox.checked = false;
}
selectedChkbox = chkBox;
}
}
</script>

 

part of page code that calls this function is;

 

<apex:inputCheckBox value="{!obj.isChecked}"
onclick="deSelectOthers(this)">.. This works perfectly fine...

 

Now I have a button which by default is disabled. I need to enable this button only when a check box is selected..can somebody tel me how we can accomplish this..Thanks in advance.

 

 

 

  • March 16, 2012
  • Like
  • 0

Hello,

 

I have this simple VisualForce page:

 

 

<apex:page showHeader="false">
<input type='button' onclick="alert('close');window.close();" value='Close' />
</apex:page>

 

which is opened from another page using window.open(url...).

 

When I click the Close button, the onclick script does run (the alert shows up), but the popup isn't closed. Doing the same without the VisualForce APEX:PAGE tag works as expected.

 

Is there something in the markup added by VisualForce to the page that prevents it from closing? how can it be disabled?

 

Thanks,

YS

  • September 24, 2009
  • Like
  • 0