• Srikant Joshi
  • NEWBIE
  • 25 Points
  • Member since 2012

  • Chatter
    Feed
  • 1
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 0
    Questions
  • 26
    Replies

Hello,

 

I have the following trigger to update the Visit object based off of the Workorder object. There is a Visit lookup on the Workorder object. Thus, ..the code checks if the Id from Visit and Workorder matches - the trigger will update. 

 

However, the trigger doesn't seem to fire. 

 

The changes on the Salesforce side is sent from a mobile that updates a field in the Workorder object. This has been tested. The field gets updated. (Date/time) I'm not sure what i'm doing wrong or why the trigger isn't being fired. 

 

trigger WorkorderToVisit on jbbfc2__Workorder__c (before update, before insert) {
set <Id> setWoId = new set <Id> ();
for(jbbfc2__Workorder__c wo: trigger.new){
setWoId.add(wo.Visit__c);
}
map <Id, Visit__c> mapVisit = new map <Id, Visit__c> ();
for(Visit__c v : [Select Id from Visit__c where Id in :setWoId]){
mapVisit.put(v.id, v);
}

list <Visit__c> UpdVisit = new list <Visit__c> ();
for(jbbfc2__Workorder__c wo: trigger.new){
if(mapVisit.ContainsKey(wo.Visit__c) == true){// if WO Id is true then update the visit object

mapVisit.get(wo.Visit__c).Customer_Notes__c = 'trigger works';
mapVisit.get(wo.Visit__c).Field_Notes__c = 'trigger works'; 
}
else{
mapVisit.get(wo.Visit__c).Customer_Notes__c = 'trigger works';
mapVisit.get(wo.Visit__c).Field_Notes__c = 'trigger works'; 
}
}
if(UpdVisit.isEmpty()==false){
update UpdVisit;
}
}

 

Hello,

 

I have created a workflow rule that will alert a specific department when a change is made to the Account Status field.  The alert works fine, but the only thing is that I don't want the email alert to trigger if the Account Status is changed to a blank field.  We have three options in the picklist, but we also allow for the field to be left empty even after it has been populated.  The workflow alert triggers is the formula evaluates to TRUE.

 

Here is the basic formula I have. 

 

ISCHANGED( Account_Status__c )

 

Thanks in advance.

 

Hi Frnds

I don't know how write a code on character count on rich text area any one pls tell me it is very urgert

 

Field: Email

Datatype:richt ext 

 

regards,

Sateesh.T

Hi Guys

I have a requirement to send an Email Alert to a Contact record that is the Parent's parent of a custom Object.

eg.

Contact > ObjectA > Object B

 

I have a field at ObjectB that I'm using to determine when to send the email, and I want it sent to ObjectB.ObjectA.Contact.email_address
However, there doesn't appear to be a way to use any of these lookup values to find the Contact's email address.

 

Has anyone come across this and found a solution?
In a normal database, it would be a pretty simple join to traverse up the tables.

 

thanks
Nick

 

 

Hi,

 

I have a requirement where I need to check the database for existing records(like printer, scanner,xerox for object officeequip) if any of the three mentioned are not present in the database, then I need to create them.

Can some one please help me on this?

 

Thanks,

JBabu.

  • April 11, 2012
  • Like
  • 0

hi

i hope that yoo can help me

 

im new in force.com

 

my problem is that i want to copy or move all the attachments records to file or copy and convert

 

the main topic is that i want to make a search into the file actually i can't search into because it's on attachment 

 

i not sure if i need to move to file or documents but the requirement is move from attachments

 

i don't know if i need to create a trigger or class 

can some body give and example 

  • April 06, 2012
  • Like
  • 0

Hi,

 

I want to add subscriberId's into a list of Id's.

 

below is the code for the same.

 

List<Id> usr=new List<Id>();
AggregateResult[] sub= [select subscriberId from EntitySubscription group by SubscriberId having count(ParentId)>= 500];
for (AggregateResult ar : sub)
usr.add(ar.get(subscriberId));

 

but i'm getting error like Variable does not exist: subscriberId.

 

Can someone correct the above.

 

Thanks in advance.

Hi,

 

I am creating an application and i am getting "Maximum view state size limit (135KB) exceeded" error. Actually i am displaying record in tabular form and i am getting more 10,000 record from database. I have mentioned variables as a transient and but still i am facing same problem. Can you please tell me is there any other option to recover from that problem.

 

Thanks,

Mitul


Hello,

 

I have the following trigger to update the Visit object based off of the Workorder object. There is a Visit lookup on the Workorder object. Thus, ..the code checks if the Id from Visit and Workorder matches - the trigger will update. 

 

However, the trigger doesn't seem to fire. 

 

The changes on the Salesforce side is sent from a mobile that updates a field in the Workorder object. This has been tested. The field gets updated. (Date/time) I'm not sure what i'm doing wrong or why the trigger isn't being fired. 

 

trigger WorkorderToVisit on jbbfc2__Workorder__c (before update, before insert) {
set <Id> setWoId = new set <Id> ();
for(jbbfc2__Workorder__c wo: trigger.new){
setWoId.add(wo.Visit__c);
}
map <Id, Visit__c> mapVisit = new map <Id, Visit__c> ();
for(Visit__c v : [Select Id from Visit__c where Id in :setWoId]){
mapVisit.put(v.id, v);
}

list <Visit__c> UpdVisit = new list <Visit__c> ();
for(jbbfc2__Workorder__c wo: trigger.new){
if(mapVisit.ContainsKey(wo.Visit__c) == true){// if WO Id is true then update the visit object

mapVisit.get(wo.Visit__c).Customer_Notes__c = 'trigger works';
mapVisit.get(wo.Visit__c).Field_Notes__c = 'trigger works'; 
}
else{
mapVisit.get(wo.Visit__c).Customer_Notes__c = 'trigger works';
mapVisit.get(wo.Visit__c).Field_Notes__c = 'trigger works'; 
}
}
if(UpdVisit.isEmpty()==false){
update UpdVisit;
}
}

 

I am trying to prepopulate values in a standard page using field-IDs. I have hard-coded the field-ID. I am not sure - if when I move the code to other orgs/package it, will the field-ID work? Is there anyway I can get the field-ID dynamically?

 

The link which I use currently is : 

 

onclick="window.parent.location.href='/a0U/e?CFxxxxxxxxxxxxxxx={!account.Name}&CFxxxxxxxxxxxxxxx_lkid={!account.Id}&retURL={!account.Id}'"

 

Any ideas on this would be really helpful.

 

Thanks.

 

 

hi
Is it possible to convert Lookup field into the dropdown list on custom visualforce page using apex?

Standard Lookup field only shows recently visited items.

Therefore i was thinking to convert Lookup fields into the picklist on VF page.

by using the standrd field i have been got.but my requirments is custom visualforce page
please help me

thanks in advance

 

  • March 29, 2012
  • Like
  • 0

Hello Everyone, Is There any way to display COntent PDF file in Visual Force Page without allowing it to be downloaded? i need to display Content files in my customer portal, but i dont want anyone to download those pdf's. Thanks in advance.

 

 

  • March 29, 2012
  • Like
  • 0

Hi All,

 

How to enable notes and attachementes in camaign object.i want add new notes in campaign object so how can i do that ,Pls let me know asap

 

Thanks

  • March 29, 2012
  • Like
  • 0

Hi all,

 

Can anyone tell me how to collect the opportunity id from the list view displaying opportunity record.

 

I have a list view in new opportunity page..

 

 

i should select the opportunity and when i click the send mass email button. it has to collect id of the selected opportunity and mail to the owner of the record.

 

Can anyone give me a solution for this?

 

 

I have a child object (Master Detail) of the Account page that has a checkbox checked(via workflow) if the rate is below a minimum rate on the account page. Each account is only allowed a certain minimum per month. What I was going to was create a roll up summary of all records with the checkbox, however I only want it to count a record if it was created this month. What is the best way to do this? I was thinking of creating a formula field on a child object that would return true if the checkbox was checked this month, then adding that field as criteria on the roll up summary. However, I'm not exactly sure how to create that formula. Any ideas?

  • March 28, 2012
  • Like
  • 0

Hi,

 

I have have an custom multiple pick list account field that I would like to autofill into an opportunity field whenever an opportunity is created for that account...?

 

I tried many different formulas but nothing works. Can someone help by writing an opportunity field formula that will work for me? If a opportunity formula field is not the way to go please give me your suggestion/best practice.

 

Gary

  • March 28, 2012
  • Like
  • 0

I would like to populate the owner field for a custom object based on the value of another field in that same record.  In pseudocode, that might look like this

 

switch (owner) {

     case 'ED':

          owner = "Ellen M"

          break

     case "HLTH":

           owner = "Toni"

 

Can this be done.  These records are being uploaded daily from our student information system, but I'd rather not mess with the import file if I don't need to.

Hi "clouders"; i'll gladly thank everyone who'll have the time to get me out from this riddle.

I'ld like to copy the user.communitynickname into a custom nickname__c.

Will explain it a lil better :

 

I've a custom object named xxx__c that has a field called nickname__c.

I'ld like to parse the id of the user, already insered via autheticathed customer portal, and set it as my nickname__c.

 

Have used an extension to the standardcontroller to make a custom pagereference and to save the xxx__c fields he needs to fill but can't manage to have the " Id id = System.currentPageReference().getParameters().get('id'); " set as nickname__c .

 

Ty in advance !

  • March 28, 2012
  • Like
  • 0