• Awesome User11
  • NEWBIE
  • 10 Points
  • Member since 2016

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 5
    Questions
  • 15
    Replies
I have a formula text field contains three fields.  One a currency field, a % field, and a date field.
The % and Data field are fine.  The issue is with the Currency field.  I have been able to add in the "$" sign and comma - leaving out the decimals.
But I need to include the parathesis for negatives and not a "-" negative sign.  How can I do this without "re-creating" my formula????
FYI - It has to be a formula text field....
IF(Amount__c < 0, "(","") & "$" & 
CASE(LEN(TEXT(Amount__c)), 
1, TEXT(Amount__c), 
2, TEXT(Amount__c), 
3, TEXT(Amount__c), 
4, LEFT(TEXT(Amount__c), 1) & "," & RIGHT(TEXT(Amount__c), 3), 
5, LEFT(TEXT(Amount__c), 2) & "," & RIGHT(TEXT(Amount__c), 3), 
6, LEFT(TEXT(Amount__c), 3) & "," & RIGHT(TEXT(Amount__c), 3), 
7, LEFT(TEXT(Amount__c), 1) & "," & MID(TEXT(Amount__c), 2,3) & "," & RIGHT(TEXT(Amount__c), 3), 
8, LEFT(TEXT(Amount__c), 2) & "," & MID(TEXT(Amount__c), 3,3) & "," & RIGHT(TEXT(Amount__c), 3), 
9, LEFT(TEXT(Amount__c), 3) & "," & MID(TEXT(Amount__c), 4,3) & "," & RIGHT(TEXT(Amount__c), 3), 
10, LEFT(TEXT(Amount__c), 1) & "," & MID(TEXT(Amount__c), 2,3) & "," & MID(TEXT(Amount__c), 5,3) & "," & RIGHT(TEXT(Amount__c), 3), 
11, LEFT(TEXT(Amount__c), 2) & "," & MID(TEXT(Amount__c), 3,3) & "," & MID(TEXT(Amount__c), 6,3) & "," & RIGHT(TEXT(Amount__c), 3), 
12, LEFT(TEXT(Amount__c), 3) & "," & MID(TEXT(Amount__c), 4,3) & "," & MID(TEXT(Amount__c), 7,3) & "," & RIGHT(TEXT(Amount__c), 3), null) & 
IF(Amount__c < 0, ")","") &

 
I am having a major issue with the embedded VF page on my Opportunity Object layouts. I am using the Lightning Experience.
1) In Create New or Edit Mode - the record if not touched jumps down to the embedded VF Page.
2) If on the Details tab, the record, jumps down to the embedded VF page (even if there is data present).
Can this be disabled? Can the VF not show up in Edit/Create mode in Lightning?
 
<apex:page standardController="Opportunity" showHeader="false"   docType="html-4.01-strict">
   <CRMC_PP:Grid ObjectName="Custom_Object__c" FKName="Opportunity__c" FKValue="{!Opportunity.Id}"  DelayLoad="false"  ViewID="a0aP0000003IJC4IAO" 
    EnableNewButton="false"  EnableNewInline="false"  EnableEdit="false"  EnableActions="false"  EnableFieldChooser="false" 
    EnableStickyViews="false"  EnableToolbar="false"  EnableViews="false"  EnableFormatting="false"  EnableReadingPane="false" />
    <CRMC_PP:DrillUp />
    </apex:page>

 
Hello,
I am trying to build out a SOQL Query to filter conditionally on a custom object where each records has an Global Enterprise Account and a HQ Account.
The Global Enterprise is the Account where the HQ and Subsidiaries are umbrellaed under so I would need to see all of the accounts that are specifically associated with the Global Enterprise to be represented in all available opportunities in query.
 
The data is pulled together in a custom object that houses the opportunities that is affiliated, the attached account, and also it’s HQ and/or Global Enterprise.
Example Fields:
Opportunity_Name__c
HQ_Account_Name__c
Global_Enterprise_Name__c
Product_List__c
Owner_Account__c
 
In my query, I need to pulls a listing of all of the Oppportunity_Name__c records where Account A and all of the Opportunity_Name__c records for any opportunity where the Globlal Enterprise Account = Account B.  Also, if there is no Global Account, it pulls only the opportunities for the accounts that have the same HQ Account.
Please help
 
I am looking to create a trigger off of a custom object (ObjA - Looks up to Accounts and Opportunities) that will create a record in custom object (ObjB) based on fields from ObjA and some related fields from Accounts/Opportunities.
I receive errors that my related fields do not exist. Can anyone provide insight?
 
trigger OpptyHierarchy on Additional_Account__c (after insert) {
	List<Opportunity_Hierarchy__c> recordsToInsert = new List<Opportunity_Hierarchy__c>();
	for (Additional_Account__c l : Trigger.new) {
		if (l.IsInsert) {
			Opportunity_Hierarchy__c la = new Opportunity_Hierarchy__c();
			V.Account__r.Name = O.Account_Name__c;
			v.Name = o.Account__c;
			v.Account__r.Enterprise_Account__r.Name = o.Enterprise_Account__c;
			v.Account__r.Billing_Location__r.Name = o.Main_Account__c;
			v.Opportunity__c = o.Opportunity__c;

	
			recordsToInsert.add(la);
		}
	}
	insert recordsToInsert;
}

 
I am putting together code for an update to a custom object (opportunity hierarchy) based on set fields (IDs) being provided in the opportunity object.
I am getting an error that my field Account_Name__c is not a variable the exists.  Any ideas?
 
trigger OpptyHierarchy on Opportunity_Hierarchy__c (before insert, before update) {
    Set<string> OpportunityID = new set<string>();
    for (Opportunity_Hierarchy__c tc : trigger.new) {
        if (tc.Account_Name__c != NULL) {OpportunityID.add(tc.Account_Name__c);
        }
    }
    Map<string, Opportunity> Opportunity = new Map <string, Opportunity>();
    for (Opportunity obj : [SELECT ID, AccountID, Main_Account__c, Enterprise_Account__c
                            from Opportunity
                            Where OpportunityID in: Opportunity]) {Opportunity.put(obj.Account_Name__c,obj);
    }
    for (Opportunity_Hierarchy__c t: trigger.new) {
        if (Opportunity.containsKey(tc.Account_Name__c)) tc.Account_Name__c = Opportunity.get(tc.Account_Name__c).ID;
        tc.Main_Account__c = Opportunity.get(tc.Account_Name__c).Main_Account__c;
        tc.Enterprise_Account__c = Opportunity.get(tc.Account_Name__c).Enterprise_Account__c;
    }
}

 
I have a formula text field contains three fields.  One a currency field, a % field, and a date field.
The % and Data field are fine.  The issue is with the Currency field.  I have been able to add in the "$" sign and comma - leaving out the decimals.
But I need to include the parathesis for negatives and not a "-" negative sign.  How can I do this without "re-creating" my formula????
FYI - It has to be a formula text field....
IF(Amount__c < 0, "(","") & "$" & 
CASE(LEN(TEXT(Amount__c)), 
1, TEXT(Amount__c), 
2, TEXT(Amount__c), 
3, TEXT(Amount__c), 
4, LEFT(TEXT(Amount__c), 1) & "," & RIGHT(TEXT(Amount__c), 3), 
5, LEFT(TEXT(Amount__c), 2) & "," & RIGHT(TEXT(Amount__c), 3), 
6, LEFT(TEXT(Amount__c), 3) & "," & RIGHT(TEXT(Amount__c), 3), 
7, LEFT(TEXT(Amount__c), 1) & "," & MID(TEXT(Amount__c), 2,3) & "," & RIGHT(TEXT(Amount__c), 3), 
8, LEFT(TEXT(Amount__c), 2) & "," & MID(TEXT(Amount__c), 3,3) & "," & RIGHT(TEXT(Amount__c), 3), 
9, LEFT(TEXT(Amount__c), 3) & "," & MID(TEXT(Amount__c), 4,3) & "," & RIGHT(TEXT(Amount__c), 3), 
10, LEFT(TEXT(Amount__c), 1) & "," & MID(TEXT(Amount__c), 2,3) & "," & MID(TEXT(Amount__c), 5,3) & "," & RIGHT(TEXT(Amount__c), 3), 
11, LEFT(TEXT(Amount__c), 2) & "," & MID(TEXT(Amount__c), 3,3) & "," & MID(TEXT(Amount__c), 6,3) & "," & RIGHT(TEXT(Amount__c), 3), 
12, LEFT(TEXT(Amount__c), 3) & "," & MID(TEXT(Amount__c), 4,3) & "," & MID(TEXT(Amount__c), 7,3) & "," & RIGHT(TEXT(Amount__c), 3), null) & 
IF(Amount__c < 0, ")","") &

 
I am having a major issue with the embedded VF page on my Opportunity Object layouts. I am using the Lightning Experience.
1) In Create New or Edit Mode - the record if not touched jumps down to the embedded VF Page.
2) If on the Details tab, the record, jumps down to the embedded VF page (even if there is data present).
Can this be disabled? Can the VF not show up in Edit/Create mode in Lightning?
 
<apex:page standardController="Opportunity" showHeader="false"   docType="html-4.01-strict">
   <CRMC_PP:Grid ObjectName="Custom_Object__c" FKName="Opportunity__c" FKValue="{!Opportunity.Id}"  DelayLoad="false"  ViewID="a0aP0000003IJC4IAO" 
    EnableNewButton="false"  EnableNewInline="false"  EnableEdit="false"  EnableActions="false"  EnableFieldChooser="false" 
    EnableStickyViews="false"  EnableToolbar="false"  EnableViews="false"  EnableFormatting="false"  EnableReadingPane="false" />
    <CRMC_PP:DrillUp />
    </apex:page>

 
I am looking to create a trigger off of a custom object (ObjA - Looks up to Accounts and Opportunities) that will create a record in custom object (ObjB) based on fields from ObjA and some related fields from Accounts/Opportunities.
I receive errors that my related fields do not exist. Can anyone provide insight?
 
trigger OpptyHierarchy on Additional_Account__c (after insert) {
	List<Opportunity_Hierarchy__c> recordsToInsert = new List<Opportunity_Hierarchy__c>();
	for (Additional_Account__c l : Trigger.new) {
		if (l.IsInsert) {
			Opportunity_Hierarchy__c la = new Opportunity_Hierarchy__c();
			V.Account__r.Name = O.Account_Name__c;
			v.Name = o.Account__c;
			v.Account__r.Enterprise_Account__r.Name = o.Enterprise_Account__c;
			v.Account__r.Billing_Location__r.Name = o.Main_Account__c;
			v.Opportunity__c = o.Opportunity__c;

	
			recordsToInsert.add(la);
		}
	}
	insert recordsToInsert;
}

 
I am putting together code for an update to a custom object (opportunity hierarchy) based on set fields (IDs) being provided in the opportunity object.
I am getting an error that my field Account_Name__c is not a variable the exists.  Any ideas?
 
trigger OpptyHierarchy on Opportunity_Hierarchy__c (before insert, before update) {
    Set<string> OpportunityID = new set<string>();
    for (Opportunity_Hierarchy__c tc : trigger.new) {
        if (tc.Account_Name__c != NULL) {OpportunityID.add(tc.Account_Name__c);
        }
    }
    Map<string, Opportunity> Opportunity = new Map <string, Opportunity>();
    for (Opportunity obj : [SELECT ID, AccountID, Main_Account__c, Enterprise_Account__c
                            from Opportunity
                            Where OpportunityID in: Opportunity]) {Opportunity.put(obj.Account_Name__c,obj);
    }
    for (Opportunity_Hierarchy__c t: trigger.new) {
        if (Opportunity.containsKey(tc.Account_Name__c)) tc.Account_Name__c = Opportunity.get(tc.Account_Name__c).ID;
        tc.Main_Account__c = Opportunity.get(tc.Account_Name__c).Main_Account__c;
        tc.Enterprise_Account__c = Opportunity.get(tc.Account_Name__c).Enterprise_Account__c;
    }
}