• *werewolf*
  • SMARTIE
  • 1683 Points
  • Member since 2010

  • Chatter
    Feed
  • 66
    Best Answers
  • 1
    Likes Received
  • 0
    Likes Given
  • 2
    Questions
  • 484
    Replies

I have an existing stand-alone web application. I want to create an App to hook into the Salesforce.com CRM system. This will entail some IFrames, a new tab and an API link-up from the web app to the customer's CRM installation.

Because the system already exists, and all we're doing is just hooking up a few simple API calls, we were hoping to build this in just a few weeks.

We have just discovered that the turnaround for the Security Review is 5 - 7 weeks, blowing the project timescale from a few weeks to several months.

Assuming there is no way to speed this up, can we create a beta testing group of existing Salesforce.com clients for before or during the Security Review phase? Are they able to install the App another way?

Is there anything else we can do to speed up the process?

I have a quick question. In a development org a few developers including myself are on hit the API limit of 5k. Once this happened our Developer Console stopped loading. We've tried multiple computers and browsers to verify it isn't some sort of caching issue. Are these two related some how or is the NA14 server having some issues? 

I saw Salesforce released a new Developer Guide introducing Open CTI which is supposed to allow CTI integration without a desktop adapter.  Sounds exciting, but the Developer Guide seems to be missing some detail.

 

For instance, if I have no desktop adapter, something must takes its place to actually talk CTI to the telephony system.  I see that the field reqAdapterUrl is still required in the Call Center definition.  So what does it point to?  What's the rest of the CTI picture that I'm missing?

  • June 08, 2012
  • Like
  • 0

When Contract End Date is exactly 30 days from now, send email notification.

 

This doesn't seem hard, but I have not been able to set it up. 

 

Am I out of my mind? It seems like the easiest thing in the world would be to set a time trigger that shoots a notification when the calendar turns to a particular date. For example, SEND NOTIFICATION 30 DAY IN ADVANCE OF CONTRACT END DATE. 

 

What am I missing?  I haven't been able to find the solution by searching the documentation; the options for workflow rules (Time Dependent Actions, Immediate Workflow, Record Edited or Created) are confusingly labeled and I just have not gotten a handle on this. The other thing is, there is no way to verify whether a time based workflow works unless the date comes and passes without a notification being triggered. 

 

 

  • April 25, 2012
  • Like
  • 0

Hi everyone,

with my CTIAdapter (version 3.01), I need to redistribute SalesForceCTI.exe, SF_MSApi4.dll, msxml6.dll and msxml6r.dll.

 

My customer want localized version of my CTIAdapter.

I can localize my code, but what about the binary that I redistribute?

More specifically:

SalesForceCTI.exe and mscml6r.dll (as r stand for resources)?

 

Thanks

 

Eric

BTW : I didn't known that we can redistribute msxml6dll and msxml6r.dll. I hope that SalesForce have a agreement with Microsoft for allowing this.

 

This is probably an exceedingly simple oversight on my part, as I am new to JS and coding in general. So I apologize in advance! I have cobbled together this bit of JS from various sources in order to make a custom list button that replicates the "Send an Email" button in Salesforce, but does so with a few important differences:

  • Prepopulates the To and CC fields with text from other custom fields.
  • Auto-selects a specific email template.
  • Utilizes the merge fields of the email template, pulling data from a record in a custom object. This record would be selected via the checkboxes generated by the custom list button, like so:

The record

 

The user will check one item, then click the Email Comment button, which will pull in the record ID of the checked record and apply the data to the merge fields of the email template.

 

Now here's the problem. Whenever I do this now, I receive an error:

 

A problem with the OnClick JavaScript for this button or link was encountered:

Unexpected string

 

So now I'm stuck! Please help! Here is the code that is entered under the custom list button.

 

{!REQUIRESCRIPT("/soap/ajax/19.0/connection.js")} //adds the proper code for inclusion of AJAX toolkit 
var checked= {!GETRECORDIDS($ObjectType.Change_Comment__c)}; //grabs the records that the user is requesting to update 
var record = (checked.toString()); 

if (record[0] == null) { //if the button was clicked but there was no record selected 
alert("Please select one record."); //alert the user that they didn't make a selection 
} else if (record.length > 1) { 
alert("Please select ONLY one record."); 
} else { 
location.replace('/email/author/emailauthor.jsp?retURL=/{!SLX__Change_Control__c.Id}&p24={!SLX__Change_Control__c.Requestor_s_Email__c}&p4={!SLX__Change_Control__c.Reports_To_Email__c}&p3_lkid=' + record '&template_id=00X70000001SBNg&'); 
}

 

 

hi all,

 

In my scenario, i have to query the subject field from Email Message object and make some changes and update those changes back to get effect. while doing this, i am getting the error as 

 

DML operation UPDATE not allowed in Email Message

 

how can i update the Subject field in the Email Message object? 

 

 

thanks

abivenkat

SFDC Learner

I know we can put interaction logs for an object in service cloud console that archive as task but I want to know if it can be modified to create a cases on a Contact.

Alternatively, is it possible to disable interaction log feature and enable similar functionality for cases.

Please let me know if anybody has tried.

 

Thanks!!!!

Hi all this is doing my head in all i have is a query:

 

Select p.PO_Ref__c, (Select id, CreatedDate, Effort__c, Billed__c,Submitted_Date__c From Time_Sheets__r) From Project_Activity__c p

 

now i want to loop through each project activity and pull out the time sheet so ive written:

 

for(Project_Activity__c p : ProjectActivityList)
{
    for(Time_Sheet__c t : p.Time_Sheets__r)
    {   

        TimeSheetList.add(t);
    }

}

 

Am i doing something stupid here? i thought that work work fine but its complaining that im trying to de-reference a null object.

 

Does anyone have any ideas?

 

Thanks

Hello all,

 

I am in the process of upgrading our Salesforce Connector product to Salesforce CTI Toolkit 3.01.

 

I've seen in the release notes that there's a new message that's supposed to allow supporting DTMF ("New ADD_DIALPAD_NUMBER message to support DTMF").

The problem is that I see no example showing how to make this work. Dial pads, as far as I could see, are always associated with a given operation (DIAL, TRANSFER or CONFERENCE). I find it strange to send DTMF from a TRANSFER or CONFERENCE related dialpad.

Could somebody please redirect me to an example or explain how this new feature should be used?

 

Thanks!

 

--

jars

  • July 05, 2011
  • Like
  • 0

Hi,

 

We have customize solution and created visualforce pages for displaying solution records. When we open any solution record on console view in tab it shows "salesforce.com enterprise edition". And we required to display the solution number as it shows in  standard page layout for other objects like Case.

 

Please any buddy help me out of this.

 

Thanks In Advance!

Shirish B

I have created a custom web tab that points to the homepage. When I open this tab outside the service console it shows all the homepage components including the sidebar.

 

I have this same tab in the service console and when I open it I am missing the sidebar. Why is this? I only have the homepage dashboard, calendar and my tasks sections.


My reasoning to have this homepage web tab is so that my reps can log into their softphone console located within the homepage sidebar. Is there a better way to get the softphone console directly into the service console?

We are evaluating Email to Case (On Demand).   It looks like the way it works out of the box is when we forward emails from support@company.com to the SF routing address, because the FromAddress for all the forwards is set to support@company.com, then all cases created via Email to Case (On Demand) will automatically have the Contact field set to a contact record for support@company.com (instead of the actual customer contact account for the person who sent the original email to support@company.com).  

 

What is the recommended (best practice) way to tackle this without having to write something like an after Insert case trigger to update the Contact relationship and parsing the TextBody of the email from the EmailMessage object to determine the true "sender"'s email address?

 

thx!

 

We need a better way to have conversations/tasks between Level 1 and Level 2 Support.

 

Background:  In our shop, difficult support cases can be escalated to Level 3 Support for assistance.   Level 3 never closes cases, just provides advice or fixes and returns cases  to Level 1 or 2 who communicates the fix to our customer.  We have the ability to move cases up and down (1-2-3-2-1).   However, this is being used is a way I didn't anticipate when I designed it.

 

Problem:  Level 3's return a case to the Level 2 rep (the system knows who it was) when they want him/her to answer a question about the case and the Level 2 then returns it to the Level 3 rep with an answer as an internal comment.   So, what's happening is that they are using the Escalate/Return process just to have a conversation about a case.  This was never  intended.  It's add too much delay into the case flow.

 

Needed:  I would prefer that the probable case solver keep ownership of the case but have a trackable way to ask a question of the L2 (or any SF user) or ask for documentation, etc.  Sending emails is no good.  They get lost and don't have any tracking.  Same with case comments.     Can I associate tasks with case?  Can I use Chatter?   Is there a better way to solve this?

 

Ideas welcome!   

The situation is,

 

I have to develop the CTI adapter for Siemens Procenter Using a Broker which is connected to the ProCenter's SDK. Then connection between the CTI adatper and the Broker provided by using the CTP/IP socket and transfering the data.  

 

I am wondering that does it posible to use the Cisco demo adapter code as a source to customize in this situation? 

 

in my understanding, using the event sink class to sink the incoming event and sent to the CTIUserInterface to convert the data to be XML format, am i right? 

 

Then listen to the event from the Broker server via socket connection. and what should i have to do so far with the data from the socket? I cant imagine that whole sequences of the developing processes. 

 

by the way, the evender of Procenter provided the IP and Port of creating Socket, the format of how data has sent and received, and all agent statuses. the event format will be in form like this...  code|status|status_para|incoming no.|destination no.

 

Please suggest how to deal with...

 

Best Regards,

Louis

Original questions was

 

Hi
I am trying to extend Salesforece CTI softphone to pass custom commands to our CTI system.
In salesforce_cti_developer_guide.pdf page 33 is section about "Implementing Call Center User Command Messages", this section shows how to process user command message, but doesn't tell who can send this message from Salesforece CTI softphone  UI.

Really simple just need to add new button to Salesforce CTI softphone and send custom command.
Thank you
CTI Coder

how to make a inbound call in CTI demo adapter.(The phone number may be the number of saved lead or contact record. So, that when a call comes from that phone number, the detail page of the record associated with that phone number should be displayed

  • April 30, 2011
  • Like
  • 0

Hi,

 

I want to ask is self service user using license in salesforce.com? Is there any limitation on using self service user especially user license?

Any information would be great..

Thanks..

I have been assign to take the project developing CTI adater to plug into Seimens HiPath. I do not realy know that how they are connect to each other. My supervicer told me to find out that how they connect to each other. Does anyone know that do i have to configure or set up any extra things? I have to demo the Adapter before building  the CTI adapter.  ( I can't find anything tall about extra set up beside customize the code. Am I right to claim that no need to set anything up)..  By the way, in the developer guide tells that I should use VS 2003. Is it neccesary to use the exactly versio?)

 

Best Regards,

Louis

  • April 12, 2011
  • Like
  • 0

I'm not seeing any clear way to handle user clicks on the elements of an apex:chart.  Is there such a way that I'm missing?  Is anyone aware of JS events that are thrown by the chart based on user interaction?

 

Otherwise I guess it's over to jqPlot or Google Charts.  *sigh*.

I've been a Force.com developer for 7 years and I can't for the life of me figure this out!

 

The docs allude to what this post says directly: that to add a Remote Access Application to a Managed Package, you have to do so during creation of the managed package.

 

However I can find no way to do so.  In the flow of the managed package creation I see this when first making the package:

 

 

Hmm, nothing here.  Maybe after I save it?

 

 

Not here either.  No new button under Remote Access.  Maybe if I edit the package?

 

A few new options here, but nothing regarding a remote access.

 

So maybe if I kill the managed package and make a new Remote Access?

 

 

Not seeing anything here to add to a package, maybe after I save it?

 

 

ARGH!

 

So how exactly can I add this Remote Access Application to my package?  Does anybody know?  Thanks.

I'm not seeing any clear way to handle user clicks on the elements of an apex:chart.  Is there such a way that I'm missing?  Is anyone aware of JS events that are thrown by the chart based on user interaction?

 

Otherwise I guess it's over to jqPlot or Google Charts.  *sigh*.

I have an existing stand-alone web application. I want to create an App to hook into the Salesforce.com CRM system. This will entail some IFrames, a new tab and an API link-up from the web app to the customer's CRM installation.

Because the system already exists, and all we're doing is just hooking up a few simple API calls, we were hoping to build this in just a few weeks.

We have just discovered that the turnaround for the Security Review is 5 - 7 weeks, blowing the project timescale from a few weeks to several months.

Assuming there is no way to speed this up, can we create a beta testing group of existing Salesforce.com clients for before or during the Security Review phase? Are they able to install the App another way?

Is there anything else we can do to speed up the process?

Hi , 

 

I am trying to cover this code but I am not able to cover it even though I satisfy all the conditions. 

 

if(app1.Candidate_Type__c == 'Teacher' && app1.EnrollmentrxRx__Applicant__r.Certification_State__c=='Texas'){
if(app1.Access_Fee_Paid__c){
feeAmountStatement = 'There is no payment due.';
feeAmount = 0.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);
}else{
if(app1.Application_Fee_Paid__c && app1.EnrollmentrxRx__Admissions_Status__c == 'Accepted'){
feeAmountStatement = 'Please pay the required $375.00 fee to process your application. The application fee is a non-refundable processing charge and is not applicable to any future bill.';
feeAmount = 375.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);

}else if(app1.EnrollmentrxRx__Admissions_Status__c == 'Application Started'){
feeAmountStatement = 'Please pay the required $50.00 fee to process your application. The application fee is a non-refundable processing charge and is not applicable to any future bill.';
feeAmount = 50.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);
}
}
}else if(app1.Candidate_Type__c == 'Teacher' && app1.EnrollmentrxRx__Applicant__r.Certification_State__c=='Louisiana'){
if(app1.Access_Fee_Paid__c){
feeAmountStatement = 'There is no payment due.';
feeAmount = 0.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);
}else{
if(app1.Application_Fee_Paid__c && app1.EnrollmentrxRx__Admissions_Status__c == 'Accepted'){
feeAmountStatement = 'Please pay the required $375.00 fee to process your application. The application fee is a non-refundable processing charge and is not applicable to any future bill.';
feeAmount = 400.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);

}else if(app.EnrollmentrxRx__Admissions_Status__c == 'Application Started'){
feeAmountStatement = 'Please pay the required $50.00 fee to process your application. The application fee is a non-refundable processing charge and is not applicable to any future bill.';
feeAmount = 50.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);
}
}
}else if(app1.Candidate_Type__c == 'Principal'){
if(app1.Access_Fee_Paid__c){
feeAmountStatement = 'There is no payment due.';
feeAmount = 0.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);
}else {
if(app1.Application_Fee_Paid__c && app1.EnrollmentrxRx__Admissions_Status__c == 'Accepted'){
feeAmountStatement = 'Please pay the required $425.00 fee to process your application. The application fee is a non-refundable processing charge and is not applicable to any future bill.';
feeAmount = 425.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);

}else if(app1.EnrollmentrxRx__Admissions_Status__c == 'Application Started'){
feeAmountStatement = 'Please pay the required $75.00 fee to process your application. The application fee is a non-refundable processing charge and is not applicable to any future bill.';
feeAmount = 75.00;
feeAmount=feeAmount.setScale(2, System.RoundingMode.UNNECESSARY);
}
}
}

 

any help would be great.. thank you .. 

 

Hi all:

 

I'm a relative newb. I'm building an integration with salesforce.com via the SOAP API. I've reached a sticking point.  There is a report that  I need to access via the API.  I understand I can't access this directly, but the preferred approach is to mimic the SOQL that the report would be running, and generate the same data set that way.  

 

This seems straight forward, but I can't seem to make my SOQL get the same number of results as the report in salesforce.com.  Attached is a screen capture from the report page, as well as the SOQL I'm trying to use to generate the same data set.

 

 

 

 

 

SELECT Count(Id), (SELECT Contact.Name FROM Account.Contacts WHERE Contact.MaRS_Contact_Relationship__c INCLUDES ('Advisory Services Primary Contact') AND Contact.Inactive_Person_left_company__c = false) FROM Account WHERE MaRS_Company_Relationships__c INCLUDES ('Active VG Client', 'High Potential Client', 'SiG Client')

 

Can anyone see how these differ?  Or do you know how, in general, to get the SOQL that the report is executing?

Fairly new to apex fyi,

 

I created a trigger that creates multiple records on a custom object based on certain criteria at the account level. So if certain fields on the account have specific values it could create 3-5 different records on the custom object. The trigger runs fine, what I need to do is make it execute on many of our current accounts. We can't wait until each one is manually updated to make the trigger run but since triggers won't run until the record is updated I believe we need to do a mass update on Accounts.

 

If this is correct, what is the best way to mass update accounts in order to make my trigger execute and create the custom records? Is there a way to make the trigger run without doing a mass update? (roughly 5500 accounts would be affected by the trigger)

 

Thank you!

Gentlemen,

 

I created a button with a script similar function "Change Owner" that I found in internet, the difference is that it only takes the case when this case is in a queue. Blocking I take cases from other users.

 

The problem is that when a user who does not have full access to function if this function does not perform.

 

Could anyone help me in this problem? Maybe run this function in adminitrador mode?

 

Thank you in advance.

 

Regards,

André Salgado

 

{!REQUIRESCRIPT("/soap/ajax/13.0/connection.js")}

var records = {!GETRECORDIDS($ObjectType.Case)};
var userId = "{!$User.Id}";

var updateRecords = [];
var updateRecordsOther = [];
var updateRecordsSelf= [];
var queryResults = sforce.connection.retrieve("CaseNumber, Id, OwnerId,Owner.Type", "Case", records);

for (var caseIndex=0;caseIndex<queryResults.length;caseIndex++)
{
	var caseObj = queryResults[caseIndex];
				  
	var CaseNum = caseObj.CaseNumber;
	var caseID= caseObj .Id;
	var ExistingOwner = caseObj.OwnerId;

	if (ExistingOwner == '00GU0000000P2gSMAS') 
	{
	   
	 //Otherwise accept it
	var caseUpdate = new sforce.SObject("Case");

	caseUpdate.Id = caseID;
	caseUpdate.OwnerId = userId;
	updateRecords.push(caseUpdate);
	}
	else
	{
		if ('{!JSENCODE($User.Id )}' != '{!JSENCODE( Case.OwnerId )}') 
		{
            updateRecordsOther.push(1);
			
		}else
		{
            updateRecordsSelf.push(1);			
	   }
   }
}

if (updateRecordsOther.length>0) 
{	
	alert('Its already have an owner');
}

if (updateRecordsSelf.length>0) 
{
	
}

if (updateRecords.length>0) 
{
	sforce.connection.update(updateRecords);
	
	alert( updateRecords.length + ' Case to: ' + '{!JSENCODE($User.FirstName )}' + ' ' + '{!JSENCODE( $User.LastName )}');
	window.location.reload();
}

 

Steps to reproduce:

  1. Install and configure Demo Adpater 4.02
  2. Select the "Go To Wrap Up After Call" option.
  3. Login to your salesforce edition.
  4. Make incoming call (Call 1).
  5. Click on Answer.
  6. Make another incoming call (Call 2)
  7. Click on answer for that as well.
  8. Make another incoming call (Call 3).
  9. Now click on "End Call" for Call 1 and Call 2.
  10. Now Click on "End Call" for Call 3.
  11. There is no "Done" button or wrap up code option for the logs now and only way to exit out of this limbo is to restart the adapter or make another incoming call, accpet call and then end call.

I have been trying for sometime to figure out what if any paramaters are different that are being passed in this case on End call and in a normal one call accept end scenario but no luck so far.

 

Made a screen capture which can be seen here

 

http://sdrv.ms/RluZ54

Hi All,

 

I have an Apex class which is exposed to the External system as a REST Service with all the different annotations for GET, Post and other methods. Is there any option where i can generate a WSDL file of the Rest Service similar to how we can do it for Soap service built in Apex.

 

waiting for your quick response.

 

Thanks,

Hi,

 

I am trying to develope a POC with CTI 4.01 but am not able to see Contracts as an object in my soft phone layout. Is there a reason for it? I have a phone field on the contract and want the system to check that as well for the incoming calls. Can someone please help me know if there is any other configuration to get this done.

 

Thanks so much.

Best Regards. 

I've been a Force.com developer for 7 years and I can't for the life of me figure this out!

 

The docs allude to what this post says directly: that to add a Remote Access Application to a Managed Package, you have to do so during creation of the managed package.

 

However I can find no way to do so.  In the flow of the managed package creation I see this when first making the package:

 

 

Hmm, nothing here.  Maybe after I save it?

 

 

Not here either.  No new button under Remote Access.  Maybe if I edit the package?

 

A few new options here, but nothing regarding a remote access.

 

So maybe if I kill the managed package and make a new Remote Access?

 

 

Not seeing anything here to add to a package, maybe after I save it?

 

 

ARGH!

 

So how exactly can I add this Remote Access Application to my package?  Does anybody know?  Thanks.

I have a quick question. In a development org a few developers including myself are on hit the API limit of 5k. Once this happened our Developer Console stopped loading. We've tried multiple computers and browsers to verify it isn't some sort of caching issue. Are these two related some how or is the NA14 server having some issues? 

I saw Salesforce released a new Developer Guide introducing Open CTI which is supposed to allow CTI integration without a desktop adapter.  Sounds exciting, but the Developer Guide seems to be missing some detail.

 

For instance, if I have no desktop adapter, something must takes its place to actually talk CTI to the telephony system.  I see that the field reqAdapterUrl is still required in the Call Center definition.  So what does it point to?  What's the rest of the CTI picture that I'm missing?

  • June 08, 2012
  • Like
  • 0

When Contract End Date is exactly 30 days from now, send email notification.

 

This doesn't seem hard, but I have not been able to set it up. 

 

Am I out of my mind? It seems like the easiest thing in the world would be to set a time trigger that shoots a notification when the calendar turns to a particular date. For example, SEND NOTIFICATION 30 DAY IN ADVANCE OF CONTRACT END DATE. 

 

What am I missing?  I haven't been able to find the solution by searching the documentation; the options for workflow rules (Time Dependent Actions, Immediate Workflow, Record Edited or Created) are confusingly labeled and I just have not gotten a handle on this. The other thing is, there is no way to verify whether a time based workflow works unless the date comes and passes without a notification being triggered. 

 

 

  • April 25, 2012
  • Like
  • 0

Hi,

 

Can anybody tell me how to stamp fields on cases from emails.I am using email2case on demand.

 

thanks in advance,

Ritika

Dear SFDC,

the blue text below is my original case.   I beleive the syntax in the code, the original rep. helped me with, is incorrect.  I have a unique Web to Lead = TRUE code written as a hidden field, that is supposed to be "checked" every time we get direct Lead entries into SFDC from our site.  Currently this field is not being automatically checked each time.  It's just an empty field.

 

I was instructed to give this code to our web develpers: <input type=hidden name="00N00000000X0xY" id="00N00000000X0xY" value="CustField"> 

 

I think it's too generic and incorrect.  Please help me with the  correct code.  

 

Many thanks!


 

Dear Angelique,

Here is some information related to the support call we had today

When using salesforce.com's Web to Lead and Web to Case, you can use hidden HTML parameters to set the values of your lead or case fields. The use of hidden parameters prevents your end-users from changing the value of those fields.

To pass a hidden value, use the following HTML tags:

<input type=hidden name="nameofhiddenfield" id="nameofhiddenfield" value="XXXX">

For example, if you want all cases captured via the Online Case Capture interface to have a Priority of High, then you would use the following HTML syntax:

<input type=hidden name="Priority" id="Priority" value="High">

Custom fields can also be passed as hidden fields. However, this may require assistance from the Administrator of the Organization to attain the ID number of the custom field. The correct syntax to pass a hidden custom field would then be:

<input type=hidden name="00N00000000X0xY" id="00N00000000X0xY" value="CustField">

Your case number is 06911137. Please let me know if there is anything else that I can help you with and I will be more than glad to assist you.


I hope you have a great day! Please contact us at any time at 1-800-667-6389 option 2.


Thank you,
Norman Carranza Rojas

I have a master object and it's detail.When this code executes, it is crashing at mo.Contact != null complaining about null pointer reference - i.e master object is null.

I fail to see why this would be, given that I got the master object through a query to database and put it in a map. I am also assuming that salesforce would never try to insert/update a detail object unless the master object field was non-null.

 

Additional info:

 

I  am UPSERTING the detail object using DATA LOADER. So I have an external id on detail object. I also have an external id on the parent object and I am matching the parent based on external id of the parent. When the parent object has been deleted, I usually get an external id not found error.

 

trigger updateDetailObject on Detail_Object__c (before insert, before update) {
     
    Detail_Object__c[] DetailObjects = Trigger.New;
    
    Set<Id> MasterObjectIds = new Set<Id> ();

    for (Detail_Object__c do:DetailObjects ) {
       MasterObjectIds.add(do.Master_Object__c);
    }

   Map<Id, Master_Object__c> MasterObjectMap = new Map<Id, Master_Object__c> ([select Contact__c from Master_Object__c where id in :MasterObjectIds]);
 
   for (Detail_Object__c do:DetailObjects) {    
       Master_Object__c mo = MasterObjectMap.get(do.Master_Object__c);
       if (mo.Contact__c != null) { //crashes here. why would master object map not have the entry in it? 
          ...
       }
   }
}

 

 

How to hide/disable the 'Add Case Comment' button when the case status is closed?

 

Thanks.