• Paqs
  • NEWBIE
  • 120 Points
  • Member since 2011
  • Senior Technical Architect
  • Ciena Corporation


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

Hi!!

I am in France and I am trying to import data to a costumized object with dataloader but i find that for all dates there is a one day shift ( -  1 ) .

i changed the time zone in salesforce and chek Use the europeean format in dataloader settings and changed the time zone in windows.but finaly it didn t work.

is there any solution!!

thanks for help!!

Hello everyone,

 

We are looking to display an alert message of some sort to the user and were glad to find a Highlights Panel in Opportunity page layout. We've added a few fields that are globally visible - like the account name, just to see whether it fits our design but the panel doesn't show up on the detail page. Is there any other permission needed to get this enabled ? I've checked user permissions and profiles and no special permission seems to exist for Highlights Panel.

 

Here's what I've done:

1. Edit the page layout on an Opportunity 'X'

2. Customize the Highlights panel and add a few fields like Name, Amount, Stage

3. Save the page layout and refresh the Opportunity 'X'.

 

Am I missing something ?

 

-Rohit

I would like to modify an existing approval process so that instead of rejecting the approval, the approver could request more information from the original submitter.  My thought was that the request could be assigned back to the original submitter with comments indicating missing information.   After the missing information is completed, the original submitter could then resubmit the request.

 

Is this possible under the native approval functionality or should I write something custom?

Hey all,

I'm developing a salesforce app, it basically provides a search interface to an external database. After the user has finished searching, he can create a new Account and fill some of its fields with data from this external database. 

I want to allow the users to customize which fields from the database map to which fields in their new Account objects. What is the best way to do that? Is there a standard component, code, snippet?

Any help from the more experienced developers would be highly appreciated.

 

Regards,

Nikolay

Guys,

I need to deploy code from Sandbox to prod, This is the first time I am going to do this, wondering why we need test class to deploy Apex code in production, can you guys give me some sample test class code?
Thanks

 
We have a salesforce instance with multiple applications. This setup allows the admin role the ability to configure everything in  every app. Howeever, I have a new customer that wants admin rights to be able to configure their own app e.g. manage users, layouts etc.  How can I accomplish this? I'm thinking I need to set up a new SF instance or is there a way to use the existing instance and just restrict configuration to his application by creating a custom role?
Hi Guys,
Could you please suggest me how to automate this type of Post Deployment Steps in SalesForce. Because I am getting 100's of Post Deployment Steps and this is time consuming process.
EX: 
1>Setup --> Permission Sets --> navigate to one of the 'Permission Set Label' --> Object Settings --> click on Tasks --> click on Edit button --> navigate to one of the field --> enable the both (Read & Edit ) checkboxes --> then Save

2>setup->object->task->find paglayout section ->find "given Task - Click Submitted" ->click on edit ->drag and drop cancel button->save.


These are one of the Post Deployment Steps.
Can you please give me Answers for this It will Great help to me.Thanks In Advance.

Hi everyone,

We're attempting to get a path to production, utilizing CI as we don't have the time or budget to manually transition and merge changes from multiple developer groups up through the environments in our path to prod. We're looking at using git, ant, and jenkins (or similar). There are a lot of tutorials for how to implement that part, however I'm not really finding anything about how to manage package.xml when you have multiple developer groups pushing changes and need to merge the changes into a a chunk to have pushed to the next stage (while ensuring there is no loss of work). 

What's the best way to manage package.xml?

More in depth details below:

 

Our situation is that we're going to have multiple scrum teams performing config and code tasks (it's looking like each team will be around 70% config/30% code). They will each have a group sandbox. When they've finished a story, they will push the changes to git, which will in turn attempt to push the changes to a Dev Integration environment (to ensure each teams changes works with the others).

This will happen multiple times before all those changes will be need to be gathered and pushed to the QA environment (and then up to staging, and then to prod).

There are two goals that we need to accomplish that we are having trouble figuring out;

1) If team 1 changes an object, commits it, then team 2 does a commit without changing said object, it looks like it's possible team 2 could end up overwriting the work team 1 did (if they merge everything into the dev int branch). We need to ensure this doesn't happen.

2) Since there will be numerous commits from the various teams into DevInt before the collective changes get pushed to QA, we need a way to merge all of the changes since the last (good) push into one package.xml so that only what's been changed will be pushed out.

It looks like we may need to auto-generate the package.xml file on each commit/merge (in each branch) to include only what's actually been changed to handle these goals (unless there is a better way, or we're over-engineering here). 

Is this accurate? How would we go about auto-generating package.xml (I've found very few resources floating about the web)? Is this the best way to handle things in our scenario?

To make matters worse, we don't have a large budget for this (for example, I was looking at Flosum, but quickly got told we don't have the budget for it).

 

Thanks for any help anyone can give!

Hi,

 

I have a nice problem that I am not able to figure out. The requirement is to call a JS when pressing a button. The button passes a parameter to the javascript and I want to be able to read that parameter in the controller to generate a string. Then use that generated string in the VF page. I use multiple buttons (depending on the functionality) and somehow, there is an AJAX refresh problem I can't put my finger on.

 

The problem is easily reproducable using the code here. To reproduce: press the first and second button one after the other multiple times, you will see that sometimes, the alert message does not correspond to the button. It seems like it shown the last value. But sometimes, it works. Can't figure out a pattern.

 

Please help!

 

<apex:page controller="ActionFunctionDemoController">
  <apex:form >
      <apex:outputPanel id="jspanel"> 
          <script>  
              function onControllerReturn() {
                alert('{!Msg}')
              }
          </script>
      </apex:outputPanel>
 
      <apex:actionFunction name="doControllerSend" action="{!SendParam}" rerender="jspanel" >
          <apex:param name="param" value="" />
      </apex:actionFunction>
 
      <apex:commandButton onclick="doControllerSend('Param 1');" oncomplete="onControllerReturn()" value="Send Param 1"/>
      <apex:commandButton onclick="doControllerSend('Param 2');" oncomplete="onControllerReturn()" value="Send Param 2"/>
  </apex:form>
</apex:page>

 

public class ActionFunctionDemoController{
   public ActionFunctionDemoController() {}

   public String Msg {get; set;}
   public PageReference SendParam() {
        String param = ApexPages.currentPage().getParameters().get('param');

        Msg = 'Param='+param;
        return null;
   }
}

 

Hi every one,

 

i wrote trigger on glovia OM manage package.Now i am writting test class for those trigger then i am getting error like this-

 

System.DmlException: Insert failed. First exception on row 0; first error: FIELD_CUSTOM_VALIDATION_EXCEPTION, System policy record is missing for glovia OM Application or you may not have access to it. Please contact your system administrator.: []

 

Trigger-

 

trigger TreatmentPrice on Treatments__c (After Insert,After Update,before Delete)
{
//Limit the size of list by using Sets which do not contain duplicate elements
set<ID> SQIds = new set<ID>();
set<ID> PTIDs=new set<ID>();
set<string> PFamily=new set<string>();
//When adding new create invoice or updating existing quote

if(trigger.isInsert || trigger.isUpdate)
{
for(Treatments__c p : trigger.new)
{
SQIds.add(p.Sales_Quote_Id__c);
PTIDs.add(p.Treatment_Name__c);
}

//Map will contain one quote Id to one Count value(no of Invoice)
map<Id,Decimal> SalesQuoteMap = new map<Id,Decimal>();
map<Id,Decimal> SalesQuoteMap1 = new map<Id,Decimal>();
try{
List<Treatments__c > PF=[select id,Treatment_Name__c from Treatments__c where Sales_Quote_Id__c IN :SQIds AND Treatment_Name__c IN :PTIDs ];
//use group by to have a single appointment Id with a single sum value
for(AggregateResult q : [select Sales_Quote_Id__c,SUM(Total_Price__c) from Treatments__c where Sales_Quote_Id__c IN :SQIds group by Sales_Quote_Id__c])
{
SalesQuoteMap.put((Id)q.get('Sales_Quote_Id__c'),(Double)q.get('expr0'));
}
/*for(AggregateResult q : [select Sales_Quote_Id__c,SUM(Credit_Adjustments__c) from Treatments__c where Sales_Quote_Id__c IN :SQIds group by Sales_Quote_Id__c])
{
SalesQuoteMap1.put((Id)q.get('Sales_Quote_Id__c'),(Double)q.get('expr0'));
}*/

List<gii__SalesQuote__c> SalesQuoteToUpdate = new List<gii__SalesQuote__c>();

//Run the for loop on Sales Quote using the non-duplicate set of Sales quote Ids
for(gii__SalesQuote__c o : [Select Id,Treatment_Discount__c,Estimated_cost__c from gii__SalesQuote__c where Id IN :SQIds])
{
Double QuoteCount = SalesQuoteMap.get(o.Id);
//Double Discount = SalesQuoteMap1.get(o.Id);
//o.Treatment_Discount__c= Discount;
o.Estimated_cost__c =QuoteCount ;

SalesQuoteToUpdate.add(o);
}
update SalesQuoteToUpdate;
}
Catch(Exception e)
{
//ApexPages.Message myMsg = new ApexPages.Message(ApexPages.Severity.FATAL, 'Please check treatment object');
//ApexPages.addMessage(myMsg);
for(Treatments__c t :trigger.new)
{
//t.addError('Please check treatment object');
}
}
}

//When deleting created quote
if(trigger.isDelete)
{
for(Treatments__c p : trigger.old)
{
SQIds.add(p.Sales_Quote_Id__c);
system.debug('Quote id'+SQIds);
PFamily.add(p.Name);
}
//Map will contain one appointment Id to one Count value(no of Invoice)
map<Id,Decimal> SalesQuoteMap = new map<Id,Decimal>();
map<Id,Decimal> SalesQuoteMap1 = new map<Id,Decimal>();
List<Treatments__c > PF=[select id,Name,Sales_Quote_Id__c from Treatments__c where Sales_Quote_Id__c IN :SQIds AND Name=:PFamily];

//use group by to have a single Quote Id with a single sum value
if(PF.size()>0)
{
for(AggregateResult q : [select Sales_Quote_Id__c,SUM(Total_Price__c) from Treatments__c where Name=:PFamily AND Sales_Quote_Id__c IN :SQIds group by Sales_Quote_Id__c])
{
SalesQuoteMap.put((Id)q.get('Sales_Quote_Id__c'),(Double)q.get('expr0'));
}
/*for(AggregateResult q : [select Sales_Quote_Id__c,SUM(Credit_Adjustments__c) from Treatments__c where Name=:PFamily AND Sales_Quote_Id__c IN :SQIds group by Sales_Quote_Id__c])
{
SalesQuoteMap1.put((Id)q.get('Sales_Quote_Id__c'),(Double)q.get('expr0'));
}*/

List<gii__SalesQuote__c> SalesQuoteToUpdate = new List<gii__SalesQuote__c>();

//Run the for loop on sales quote using the non-duplicate set of Quote Ids
for(gii__SalesQuote__c o : [Select Id, Treatment_Discount__c,Estimated_cost__c from gii__SalesQuote__c where Id IN :SQIds])
{
Double QuoteCount = SalesQuoteMap.get(o.Id);
//Double Discount = SalesQuoteMap1.get(o.Id);
//o.Treatment_Discount__c= o.Treatment_Discount__c-Discount;
o.Estimated_cost__c =o.Estimated_cost__c-QuoteCount;
SalesQuoteToUpdate.add(o);

}
update SalesQuoteToUpdate;
}
}
}

 

//Test class

 

@isTest
private class testRollUpNoOfTeatmentQuote
{
    static testMethod void countNoOftreatmentQuote()
    {
        Datetime myDate = datetime.newInstance(2008, 2, 5, 8, 30, 12);
        Profile pf = [Select Id from Profile where Name='System Administrator'];
        User u = new User();
        u.FirstName='Test';
        u.LastName='User';
        u.Email='shiv@test.com';
        u.CompanyName='KVP';
        u.Title='Software Engineer';
        u.Username='shiv@kvpcorp.com';
        u.Alias='test';
        u.communityNickName='kvpian';
        u.TimeZoneSidKey='America/Mexico_City';
        u.LocaleSidKey='en_US';
        u.EmailEncodingKey='ISO-8859-1';
        u.ProfileId=pf.Id;
        u.LanguageLocaleKey = 'en_US';
        insert u;
        //creating clinic record
        Clinic__c cl = new Clinic__c(Name = 'Ajax');
        insert cl;
        //creating clinic record
        Referral_Card__c r = new Referral_Card__c(Name = 'XXX123',Referral_Card_Type__c='rty');
        insert r;
        //creating staff record
        Staff__c staff = new Staff__c(Name = u.id,User_Name__c=u.id);
        insert staff;
        //creating rsource record
        Resource__c resource = new Resource__c(Name = 'X-rayMachine',Clinic__c=cl.Id);
        insert resource;
        //creating staff schedule record
        Staff_Schedule__c staffSchedule = new Staff_Schedule__c(Staff__c=staff.id, Shift_Start__c=myDate,Shift_Endds__c=myDate.addDays(1), Clinic__c=cl.id);
        insert staffSchedule;
        //creating resource schedule
        Resource_Schedule__c resourceSchedule = new Resource_Schedule__c(Close_Time__c=myDate.addDays(1), Open_Time__c=myDate, Clinic__c=cl.id,Staff_Name__c=staff.id, Name__c = resource.id);
        insert resourceSchedule;
        //Creating record for patient
        contact p= new contact(FirstName='Michel',No_of_Appointment__c=1,No_Of_Webcam_Used__c=1, LastName='Methew',Email='Michel@gmail.com', Status__c='open', Preferred_Phone_Number__c='12345678', LeadSource='ccr');
        insert p;        
        //creating record for treatment
        Treatments1__c t= new Treatments1__c(Name='SkinTightning', Resource_Name__c= resource.id,Type__c='Treatment',Price__c=100);
        insert t;
        //Creatting appointment record
         opportunity o=new opportunity(Clinic__c=cl.Id,Treatment_Name__c = t.Id, Name='testAppointMent', CloseDate=system.Today(), Appointment_Start_Date_Time__c=myDate,Appointment_End_Date_Time1__c=myDate.addDays(1),StageName='booked', Resource__c=resource.id, Patient_Name__c=p.id);
        insert o;
        //Createing record for Campaign
        Campaign c= new Campaign(Name='XYZ');
        insert c;        
        //Createing record for Account
        Account a= new Account(Name='Skin Vitality');
        insert a;
        //Creating treatment pitch record
        Treatment_Pitch__c tp=new Treatment_Pitch__c(Name='maintenance',Treatments__c=t.id,Treatment_Number__c=1);
        Insert tp;
        //Create sales Quote
             gii__SalesQuote__c SQ = new gii__SalesQuote__c(     
                                                                    Customer_Name__c=p.Id,
                                                                    Appointment_Name__c=o.Id,
                                                                    Medical_Representative__c=staff.Id,
                                                                    Estimated_cost__c=50,
                                                                    Status__c='Invoiced',
                                                                    gii__Account__c=a.id                   
                                                                    );
                    
                     insert SQ;
          //Create invoice     
              if(SQ.Status__c=='Invoiced')  
                  {             
                   
                        Invoices__c Inv = new Invoices__c (
                                                            Sales_Quote_Id__c=SQ.Id,
                                                            Contact_ID__c=p.Id, 
                                                            Appointment_Name__c=o.Id                  
                                                              
                                                           ); 
                        insert Inv;   
                  }
           //Create treatment   
                if(SQ.Status__c=='Invoiced' && t.Type__c=='Treatment')  
                  {             
                   
                        Treatments__c  Trt= new Treatments__c(
                                                            Treatment_Name__c=t.Id,
                                                            of_Treatment__c=2,                    
                                                            Sales_Quote_Id__c=SQ.Id  
                                                           ); 
                        insert Trt;   
                  }
             //Update sales quote     
                gii__SalesQuote__c SQ1 = [select Estimated_cost__c from gii__SalesQuote__c  limit 1];
                List<gii__SalesQuote__c> QuoteListToUpdate =new List<gii__SalesQuote__c>();
                for(integer i=0 ; i<250 ;i++)
                {  
                    SQ1.Estimated_cost__c = 200;                    
                    QuoteListToUpdate.add(SQ1);
                    Update QuoteListToUpdate ;
                }
                
                
                //delete TreatmentListToInsert[0];
           
       
     }   
}

 

 

 

Please help me to solve this problem.

 

Regards,

DD

 Hello...........

    

      I Want to pass values from vf to controller, Here my requirement is when i click on 'A' I want to display only records starts with A,like that i want to search from A-Z,here my problem is how can i pass values from vf to controller , for this i wrote one method ,i want pass parameters to that method dynamically if user clicks on A then the method has to retrieve A accounts only 

I can't figure out how to get rid of the space and the line at the top of my Visualforce page.  See the attached screenshot, which shows the extra space that it is taking up that is not at all necessary.

Does anyone have any ideas on how to make it go away?  It would be a great help.  Thanks.
 

Is there a way to query a CustomObject, like Account, to get all it's current metadata settings? It seems like all the examples expect you to create a new CustomObject, set the full name to "Account" and then run update. I've seen no clear examples of how to query the Account metadata analoguous to how you can query for Account records using the EnterpriseConnection query() method.

 

Is there a way to do this?

 

Thanks,

Derek

Hey all,

I'm developing a salesforce app, it basically provides a search interface to an external database. After the user has finished searching, he can create a new Account and fill some of its fields with data from this external database. 

I want to allow the users to customize which fields from the database map to which fields in their new Account objects. What is the best way to do that? Is there a standard component, code, snippet?

Any help from the more experienced developers would be highly appreciated.

 

Regards,

Nikolay

Hello

 

I've been trying to figure this out for a while but with no luck.

 

I'm trying to add my SF Site URL to an email template.

When I select the available Site merge fields and use them in the email, the actual email I receive comes with empty/blank text e.g.. the Site's fields are not merged into the email.

 

Does anyone know how to include the Site's URL in an email template?

 

Many thanks

 

 

  • May 17, 2012
  • Like
  • 0

I have this query

 

List <Booking__C> bk = [Select (Select Contact__c From Pupils__r) From Booking__c b where b.id = :bookingId];

 

This query should return me the related Contact ID's from Pupils sObject which is a Child Object for Booking and I'm saving the result in a List of type Booking__c, but how do I access the result of related records in another query, if I want to run another query with the results of this one

 

For Eg:

 

List <contact> con = [select firstname, lastname, id from contact where id = ??? (I have tried bk.Contact__C, also tried bk.Pupils__r.id - nothing works, it comes up with an error)

 

I'm new to salesforce can't get my head around accessing nested query results.

 

I'll be glad if any one can tell me where I'm going wrong.

 

Thanks

I have cases with status= "On Hold" and would like to know how I can setup a way to automatically update all those recs with a new public comment that also sends an e-mail to the contact on the account.

I have created a report to select all the correct records and saved them in excel with the field Case number(which is unique), status and description field. I added a column for comment and have updated the comment field with the text that I want in salesforce for each of those recs. I'd like to know how to have those recs updated with the new comment that is also going to be sent  to the contact.( just as if I were to manually click in the case on New comment, type the text and click make public and send email check boxes and finally save.  Any advice will be appreciated... if excell is not the way to go ... I'm also willing to try something in Crystal reports.

Hi,

 

Do we have a template/mapping sheet where we can have Mappings established between ACT database and Salesforce Schema?

 

Want to know :-

 

1) How data is migrated from ACT to Salesforce
2) When is data cleansing done?(before loading into Salesforce or after loading it)
3) Best Practices for Data Migration, Data Cleansing activities, etc
4) What are the things one needs to take care while loading data
5) Transformation Logic for fields having dates/picklists as datatypes
6) Any constraints from Salesforce side for datatypes like date fields etc to be in specific formats
7) Any AppExchange tools etc
8) Any other valuable information you can provide

 


Thanks,

 

Vimal

Hi

 

when i open my text file with the url."..servlet/servlet.FileDownload?file=015M00000005K26IAE "

 

 i can't display special caracter like é à ....

 

Thanks

Hi All,

 

We have a a number of 'Account Owners' that need to have an equal number of accounts allocated to them, is there a way (either through apex or another method) to lookup how many accounts each owner has and then allocated any new accounts to the owner with the least number of accounts or in the event that 2 or more owners have the same number, to the owner who hasnt had an account allocated to them for the longest amount of time.

 

I hope this makes sense!

 

Thanks in advance for any assistance

 

Steve

Hello I have a Visualforce page with a standardcontroller and a controller extension. In this there is a pagereference method in which I save a new order-record. I now want to redirect the user to the previous page. How can I do that. I tried it with the following:

 

public string retPage = ApexPages.currentPage().getParameters().get('retURL');

page.retPage;

 

did not work. The same with

 

return retPage;

 

Where is the fault?

 

Thanks

Harry

When someone takes the time/effort to repspond to your question, you should take the time/effort to either mark the question as "Solved", or post a Follow-Up with addtional information.  

 

That way people with a similar question can find the Solution without having to re-post the same question again and again. And the people who reply to your post know that the issue has been resolved and they can stop working on it.