• Vinit Jogani
  • NEWBIE
  • 115 Points
  • Member since 2016

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 15
    Replies
Looking for the best way to build an automated process so when an opportunity is pushed to Closed Won, this automatically changes the account type to Customer. So far, we have the below:

User-added imageUser-added image

Any feedback/help would be greatly appreciated. 
Looking for the best way to build an automated process so when an opportunity is pushed to Closed Won, this automatically changes the account type to Customer. So far, we have the below:

User-added imageUser-added image

Any feedback/help would be greatly appreciated. 

hi there

have a piece of code

how to create csv file and name it?

 

public static void sheets (List<Opportunity> oppo){

        List<Opportunity > opps = [SELECT Id, Name, Description, CreatedDate, LastModifiedDate FROM Opportunity limit 10];
        string header = '"Record Id","Name","Description","Created Date","LastModifiedDate" \n';
        string finalstr = header ;
        for(Opportunity o: opps){
            
            string recordString = '"'+o.id+'","'+o.Name+'","'+o.Description+'","'+o.CreatedDate +'","'+o.LastModifiedDate+'"\n';
            
            finalstr = finalstr +recordString;
            
        }


        HttpRequest req = new HttpRequest();
        req.setMethod('POST');
        req.setEndpoint('callout:Googel_Sheets/upload/drive/v3/files');
        req.setHeader('Content-Type', 'multipart/mixed'); 
        req.setHeader('Content-length', String.valueOf(finalstr.length())); //required!!!!
        req.setTimeout(120000);
        req.setBody(finalstr);
        Http http = new Http();
        HTTPResponse res = http.send(req);
        System.debug('RESPONSE   --->   '+res.getStatus());  System.debug('RESPONSE   --->   '+res.getBody());
        System.debug('req   --->   '+req);
        
        
    }

when i send it, in google i recive untitled file with unknown type
User-added image

may be any solutions without JSON???
thx
global class SyncOppLineItem{
   @InvocableMethod
   public static void getSyncItems(List<String> woId) {
    Workorder workO = [select Id,Opportunity_Number__c FROM workorder where id =: woId[0]];
    
    if(workO != null){
        list<workorderlineitem> k= [select id from workorderlineitem where workorderid =: workO.Id];
            list<workorderlineitem> l = new list<workorderlineitem>();
            delete k;
            list<opportunitylineitem> j = [select pricebookentryid from opportunitylineitem where OpportunityId=: workO.Opportunity_Number__c ];
            system.debug('opportunitylineitem' + j);
        if(j.size()>0){
            for(opportunitylineitem n : j){
                l.add(new WorkOrderLineItem(
                    WorkOrderId = woid[0],
                    PricebookEntryId = n.PricebookEntryId
                ));
                
            }
            
            insert l;
    }
        
}




   }
}
I've added a date field to an object, which is populated with a simple formula of "NOW()". 
The problem is that this inserts the date as UTC. What I actually need to happen is that the value is inserted using the date/time of the user submitting the item for approval.
For example, it's currently 7am on the 29th June here in the UK. If I log in via a computer in Pacific time where the local time is still the day before (28th) and submit approval, the date is still populated as the 29th. 
How can I get this to be filled in with the date value of the user requesting approval?
Hi all,

I have two objects Account and Sales. Account has fields created date, location, down payment received. Sales has fields date, location, total revenue.

What i am trying to do is to compare sum(down payment received) group by created date and location with total revenue from sales object.

I have made couple of queries wriiten below. I want to use these queries for wrapper class. My main concern now is somehow I want to link both these queries together, so I can view it as table on vf page. 
 
From Account: 
select sum(down_payment_received__c) from account where created_date__c > 2018-03-12T00:00:00Z and created_date__c < 2018-03-13T00:00:00Z and Location__c in ('Location A', 'Location B', 'Location C', 'Location D') group by Location__c


This query will give me result for Mar 12 and for all Locations. 

Similarly, For Sales object:
1select Date__c, Location__c, Total_Revenue_End_of_the_day__c from sales__c where Date__c = 2018-03-12

This query will give results for sales object. 

But, what I wanted is use a single query to get results from both objects.

I would like a data such as following (layout could be little different)

Date                     Location            Down Payment            Total Revenue             Total Revenue - Down Payment
2018-03-18           Location A                 100                              100                                           0
2018-03-18           Location B                 150                              100                                          50


Please, let me know how this could be possible. 
Hi there,

I set related list field in Account's Mini Layout (@figure 1),
but it is not shown in hover view (@figure 2).

In what case, related list field will be show?

figure1:
User-added image

figure2:
User-added image

Thanks and Regards,
LinThaw
Hi All,

I have a visualforce code written like this.
 
<apex:outputText escape="False" value="{!cr.Message__c}" rendered="{!(cr.Message__c)!= ''}"/>

I have tried all the possible methods and ways to resolve but In checkmarx report it is not getting eliminated.
Kindly provide me solution for this.

Thanks,
Anuj
Hi there,

I am hoping you can help I am new to writing Triggers and I could really do with a hand. I have created a custom object called Campaign Team Member (Campaign_Team_Member__c) with a Master detail to Campaigns (Campaign__c) and a Lookup to Users (User__c). I have also added a text field to Campaigns called CampaignTeamIDs (CampaignTeamIDs__c).

What I am trying to do is on insert or update on Campaign Team Member check the values of CampaginTeamIDs__c add the Id in User__c to CampaignTeam_IDs__c if they do not exist and return an error if they do. On delete of the Campaign_Team_Member__c record I want to find the Campaign and remove the User Id from the CampaignTeamIDs__c field.

I then have a formula field that returns a true checkbox if the CampaignTeamIDs__c field contains the current user id, then I can use a list view to return My Team's Campaigns.

This is my code at the moment but I am unsure how to do a check on duplicate values in the CampaignTeamIDs__c before Insert
 
trigger UpdateCampaignTeamMembers on Campaign_Team_Member__c (after insert, after update, after delete, after undelete) {
   
	//If the event is insert or undelete, this list takes New Values or else it takes old values
	List<Campaign_Team_Member__c> CampaignTeamList = (Trigger.isInsert|| Trigger.isUnDelete) ? Trigger.new : Trigger.old;

    //set of Campaign Id's - lists can contain dupilcates.
    set<id> CampaignTeamIds = new set<id>();

    //Loop through the Campaign Team Member object Records to store the Campaign Team Member Id values
    for (Campaign_Team_Member__c Cam_team : CampaignTeamList) {
    	CampaignTeamIds.add(Cam_team.Campaign__c);
    }

	List<Campaign> CampaignList = [select id, (select Campaign__c, User__c from Campaign_Team_Members__r)
								from Campaign where id in :CampaignTeamIds];


	for (Campaign Camp : CampaignList) {

		if(Camp.Campaign_Team_Members__r.size() > 0){
  			Camp.CampaignTeamIDs__c = '';

  			for(integer i=0;i < Camp.Campaign_Team_Members__r.size();i++){
   				Camp.CampaignTeamIDs__c += string.valueOf(Camp.Campaign_Team_Members__r[i].User__c)+ '; ';
  			}
		}else Camp.CampaignTeamIDs__c = null;
    }
	//update the Campaign List
	update CampaignList;
}

 
Hello Experts,
I have big object, and I am inserting data from the batch class into big object. When I run test it give me error :
"Internal Salesforce Error: 1347441463-30 (-83575418) (-83575418)"
When I insert data from anonymous console than it inserted successfully, but test is failed.
So, how to deal with this problem.
 
My issue may be tied to creating the Global Action and the appearance of a recod type field.
When I take the challenge, I get the following error:
"Challenge Not yet complete... here's what's wrong: 
Could not find an Opportunity Quick Action with the Label 'New Offer' and the action type of 'Create a Record'."

User-added image

It would seem I did everything right, but I also see a Record Type field with 3 options, Products, Serivces, or Master. I set it to 'Master'. 
User-added image
I then set the Predefined Field value to Stage: 'Qualification'
User-added image
User-added image

Then set the Publisher layout.
User-added image

Am I missing something?

Thanks to anyone who can help. It would seemt the system can't find my Quick Action.
Dear all,
I am facing one issue in static resource.
I am referencing a static resouce in Lightning component.
I have updated a css file in the static resource, but still the old css is loading in lightning application.
I have tried clearing browser cache, but still the old one is coming.
Kindly help me in solving this.
Thanks in advance