• SarikaP
  • NEWBIE
  • 15 Points
  • Member since 2014

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 20
    Replies
Hello,

Here it is:

 if({!CONTAINS("AUSTRALIA:FIJI", UPPER(Opportunity.Account.BillingCountry ))} || ({!Opportunity.end_user_account__r.BillingCountry } != null && {!CONTAINS("AUSTRALIA:FIJI", UPPER(Opportunity.end_user_account__r.BillingCountry ) )}))
  {window.alert("Test message"}
  }

Its not working. Above script states that for any opportunity having Account Country or End User Account Country (End User Account is a lookup Account field at Opportunity level) Australia or Fiji, alert pop up should appear.
In addition to this, it should popup only if the opportunity is just created.

Thanks
Hello Team,
We use conga composer for pdf generation and we would like to automate the reports. 
Can anyone suggest other than Conga Courier if we have an option to automate the reports?
Or
I would explain my requirement:
Basically I am creating a custom document/pdf having number fo components, something like executive reports.
I will like to generate the document and send it by email automatically every week the document.
Kindly advise.

Thanks
Hello,

Is there a better way to code the below lines of code:
Logic:
We have 2 terms and conditions for the quote in an custom object Terms_and_Conditions_Quote__c currently for the quotes greater than 5K. (as T&C's are linked to product)
For all the quotes greater than 5K, Term A should not be present and Term B should be present.

  if(setGrtAmtQTC != null && setGrtAmtQTC.size() > 0) //Set of quoteids with quote amount greater than  5K.
        {
            //Looking for Quotes with Term A
            Map<Id,Terms_and_Conditions_Quote__c> mapdelCCTCQuoteId = new Map<Id,Terms_and_Conditions_Quote__c>([select Id,Quote__c,Terms_and_Conditions__c from Terms_and_Conditions_Quote__c where quote__c in : setGrtAmtQTC and Terms_and_Conditions__c =: 'a0o60000000ZyWmAAK']); //Term A
            
            // Delete Credit Card T&C for Quotes having greater amount than 5K
            System.debug('List size to delete credit card quote:' + mapdelCCTCQuoteId.size());
            if(mapdelCCTCQuoteId != null && mapdelCCTCQuoteId.size() > 0)
            { 
                lsttodel1.addall(mapdelCCTCQuoteId.values());
                
                     //check for the quotes with same Term A if we have Term B too.
                for(Terms_and_Conditions_Quote__c obj: mapdelCCTCQuoteId.values())
                    setdelCCQId.add(mapdelCCTCQuoteId.get(obj.Id).Quote__c);
                
                Set<Terms_and_Conditions_Quote__c> setremnetpqid = new Set<Terms_and_Conditions_Quote__c>([select Quote__c from Terms_and_Conditions_Quote__c where quote__c in : setdelCCQId and Terms_and_Conditions__c =: 'a0o60000000ZyWf']); //Term B
          
               //if quotes has term B, remove it from set setdelCCQId
                if(setremnetpqid!= null && setremnetpqid.size() > 0)
                { 
                    for(Terms_and_Conditions_Quote__c objq: setremnetpqid)               
                    setdelCCQId.remove(objq.Quote__c);
               
                }
                //For all the quotes that dont have Term B in the set setdelCCQId add them      
                if(setdelCCQId != null && setdelCCQId.size() > 0)
                {
                    for(Id tcquoteid : setdelCCQId)
                    {
                    lsttoins1.add(new Terms_and_Conditions_Quote__c(
                    Quote__c = tcquoteid,
                    Terms_and_Conditions__c = 'a0o60000000ZyWf'//Term B
                    ));
                    }    
                    
                }
                
            }
            
        }
  • September 04, 2019
  • Like
  • 0
Hello Everyone,

I need help in bulkifying the code below. The requirement is we have multicurrency org, so first check the currency and if currency is greater than 10k USD, a special T&C should appear in addition to regular T&C (if reg T&C not present already)
For amount greater than 10K, only regular T&C should appear.
Here's the code:

    public static void CheckTNC(List<Quote> Qlist){   
      
        Set<Id> setGrtAmtQTC= new Set<Id>();
        Set<Id> setLessAmtQTC = new Set<Id>();
        Set<Id> setdelCCQId = new Set<Id>();
        Set<Id> setremccqid = new Set<Id>();
        Set<Id> setqtcid = new Set<Id>();
        Set<Terms_and_Conditions_Quote__c> settoins = new Set<Terms_and_Conditions_Quote__c>();
        Set<Terms_and_Conditions_Quote__c> settodel = new Set<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lsttodel1 = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lsttodel2 = new List<Terms_and_Conditions_Quote__c>();       
        List<Terms_and_Conditions_Quote__c> lsttoins1 = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lsttoins2 = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lstdelallTC = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lstdelQTC = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lstinsQTC = new List<Terms_and_Conditions_Quote__c>();
        Terms_and_Conditions__c tcspecial = [Select t.Id  From Terms_and_Conditions__c t where t.Id =: 'a0o60000000ZyW']; //less than 10K T&C
        Terms_and_Conditions__c tcregular = [Select t.Id  From Terms_and_Conditions__c t where t.Id =: 'a0o60000000Zy']; //regular T&C
       
        map<string,decimal> queriedcurrencies = new map<string,decimal>();
        List<Opportunity> lstAutoRenOpp = new List<Opportunity>();        
        Map<Id, Quote> mapq = new Map<id, Quote>();
        for(CurrencyType c : [SELECT ISOCode, ConversionRate FROM CurrencyType WHERE IsActive=TRUE]){
            queriedcurrencies.put(c.ISOCode,c.ConversionRate);
            System.debug('Curreny ' + c.ISOCode + 'with conversion rate' + c.ConversionRate);
        }
        mapq.putall(Qlist);
        for(Quote q: mapq.values())
        {
             
            if( q.TotalPrice > 0 )
            {         
                decimal convertedvalue = q.TotalPrice/queriedcurrencies.get(q.CurrencyISOCode);            
                if(q.TotalPrice > 10000)         
                    setGrtAmtQTC.add(q.id);           
                else          
                    setLessAmtQTC.add(q.Id);           
            }          
            
        }
        if(setGrtAmtQTC != null && setGrtAmtQTC.size() > 0)
        {
            Map<Id,Terms_and_Conditions_Quote__c> mapdelCCTCQuoteId = new Map<Id,Terms_and_Conditions_Quote__c>([select Id,Quote__c,Terms_and_Conditions__c from Terms_and_Conditions_Quote__c where quote__c in : setGrtAmtQTC and Terms_and_Conditions__c =: tcspecial.id]);
        
            System.debug('List size to delete credit card quote:' + mapdelCCTCQuoteId.size());
            if(mapdelCCTCQuoteId != null && mapdelCCTCQuoteId.size() > 0)
            { 
                lsttodel1.addall(mapdelCCTCQuoteId.values());                  
                for(Terms_and_Conditions_Quote__c obj: mapdelCCTCQuoteId.values())
                    setdelCCQId.add(mapdelCCTCQuoteId.get(obj.Id).Quote__c);
                    
                //check if quotes have regular T&C, as some products dont, make sure to add it if its not added
                Set<Terms_and_Conditions_Quote__c> setremnetpqid = new Set<Terms_and_Conditions_Quote__c>([select Quote__c from Terms_and_Conditions_Quote__c where quote__c in : setdelCCQId and Terms_and_Conditions__c =: tcregular.Id]); 
                system.debug('setremnetpqid'+setremnetpqid.size());
                if(setremnetpqid!= null && setremnetpqid.size() > 0)
                { 
                    for(Terms_and_Conditions_Quote__c objq: setremnetpqid)               
                    setdelCCQId.remove(objq.Quote__c);
               
                }
                                
                if(setdelCCQId != null && setdelCCQId.size() > 0)
                {
                    for(Id tcquoteid : setdelCCQId)
                    {
                        Terms_and_Conditions_Quote__c objTCNet = new Terms_and_Conditions_Quote__c(); 
                        objTCNet.Quote__c = tcquoteid; 
                        objTCNet.Terms_and_Conditions__c = tcregular.Id; 
                        lsttoins1.add(objTCNet);
                    }
                    
                }
                
            }
            
        }
        if(setLessAmtQTC != null && setLessAmtQTC.size() > 0)
        {
            Set <Terms_and_Conditions_Quote__c> settcqid = new Set<Terms_and_Conditions_Quote__c>( [select quote__c from Terms_and_Conditions_Quote__c where quote__c in : setLessAmtQTC and Terms_and_Conditions__c  =: tcspecial.id]);
            if( settcqid != null &&  settcqid.size() >0)
            {
                for(Terms_and_Conditions_Quote__c t: settcqid)                                     
                setremccqid.add(t.Quote__c); 
                setLessAmtQTC.removeall(setremccqid);   
            }
            if(setLessAmtQTC != null && setLessAmtQTC.size() > 0)
            {
                
                for(Id tcquoteid : setLessAmtQTC)
                {
                    Terms_and_Conditions_Quote__c objTCCC = new Terms_and_Conditions_Quote__c(); 
                    objTCCC.Quote__c = tcquoteid;
                    objTCCC.Terms_and_Conditions__c = tcspecial.id;
                    lsttoins2.add(objTCCC);                                  
                }
                
            }
        }  

        if(lsttodel1!= null &&  lsttodel1.size() > 0)
            settodel.addall(lsttodel1);
      
        if(settodel != null && settodel.size() > 0) 
        {
            lstdelQTC.addall(settodel);
            delete  lstdelQTC;
        }
        if( lsttoins1!= null &&  lsttoins1.size() > 0 )
            settoins.addall(lsttoins1);      
        if(lsttoins2!= null &&  lsttoins2.size() > 0)
            settoins.addall(lsttoins2); 
       
        if(settoins != null && settoins.size() > 0)
        {
            lstinsQTC.addall(settoins);
            insert  lstinsQTC;
        }
    }

 
We have a custom object "Terms & Conditions - Quote'.
Based on the "Amount" of the quote, I have to delete certain 'T&C' from the custom object and add other 'T&C' respectively.
The T&C's are linked to the product, whenever a lineitem is added, all product related T&C's are added. But now we want to add further customization to check the amount too. Based on final amount of quote, T&C's can change.
 
Hello,

What my question is as follows?

1 a
2 a
3 a
4 b
5 b

I want to get 1 a and 4 b and delete 2 a, 3 a, 5 b.
Is it possible to do?
Hello,

I am facing an issue while Cloning Opps & Quotes, reason being I am adding a special T&C only if they select certain kind of product with specific duration. So its runtime determined whether I will be adding T&C to the quote.
Now the issue is suppose the quote has those special T&C's, now when I am cloning the opp/ cloning the quote, it clones T&C's too, which is fine.
But during cloning there is an event on quotelineitem after insert which runs my trigger on quotelineitem that checks if a specific product is inserted with specific duration then insert the special T&C.
So in the end I am recieving duplicate T&C's in the quote.
How can I indicate the trigger that's fired on insert of Quotelineitem, that its a clone action, so this time at the time of insertion don't fire.
Whereas the trigger at quotelineitem can be fired while update/delete.

Thanks in advance!
Hello,

If a contact changes from one account to another, we make that record an obsolete record and create a new contact record under another account.
We have a look up custom field "Prior Contact Record" which is filled in, in the newly created  contact record.
Now a person can do some certifications when he is in one account and now when he changes the account, we still are interested to see his certification details in newly created contact record. Reason being irrespective of any company he owns his certifications.
I was thinking to create a custom object "Prior Certification Details" but my concern can i create a trigger that helps me to add the prior contact record's certification details on the newly created record when the "Prior contact record" is filled in.
Kindly advise.

Thanks
I am trying to mass update records using dataloader. Once a record is updated, the trigger should be fired. I tried to update records but the trigger is not fired when used dataloader. When I manually update the record, the trigger is fired. Here's my code:
Trigger
    if(trigger.isafter && (trigger.isinsert || trigger.isupdate))
      {         
            UpdateExpirydate.UpdateCertDetails(Trigger.new);
      }
Apex controller:
   public static void UpdateCertDetails(List<Certification_Attendees__c> lstcertattendees)
{
    
        List<String> cerType = new List<String>{'Certification','Exam Retake','Recertification'};
        List<String> certLevel = new List<String>{'1','2','3'};
        List<Contact> lstcontacts = new List<Contact>();
        Set<Id> contactIds = new Set<ID>();
        if(lstcertattendees != null && lstcertattendees.size() > 0)
        {
            for(Certification_Attendees__c att : lstcertattendees)
            {
            contactIds.add(att.Attendee__c);
            }
            System.debug('ContactIds' + contactIds.size());
            if ( contactIds != null && contactIds.size() >0)
            {
                    for(Certification_Attendees__c attendee : [Select c.Name, c.Level__c , c.Attendee__c,c.Certified_on__c,c.Expiry_Date__c,c.Type__c,c.Exam_Result__c   from Certification_Attendees__c c where c.Attendee__c in: contactIds and
                    c.Exam_Result__c =: 'Passed' and c.Type__c in: cerType and c.Level__c in: certLevel order by c.Certified_on__c desc LIMIT 1])
                {
                     if(attendee != null)
                     {
                     Contact con = new Contact();
                     con.Id = attendee.Attendee__c;
                     con.Certified_On__c = attendee.Certified_on__c;
                     con.Expiry_Date__c = attendee.Expiry_Date__c;
                    lstcontacts.add(con);
                    }
                }   
            }
        System.debug('lstcontacts.size()' + lstcontacts.size());
            if(lstcontacts !=null && lstcontacts.size() > 0)
            {   
                    update lstcontacts;
                 system.debug('Certification details on Contact Records updated successfully');
            }
        }

}

Thanks in advance!
Hello Everyone,
I am having a field called Discount Percent at quotelineitem. 
If a quotelineitem is of a specific Product Category and there are many quotelineitems of the same product category, when discount % is applied to one lineitem of that product category in an onchange event automatically the discount percent should be applied to all lineitems of the same product category. 
Could anyone suggest how to do that? 
Thanks
 
Hi friends!

I have a custom object having its own Activity history. All I want is to be able to click that "Send An Email" button in the activity history section & when the email is logged in the activity history, i want to keep it private for all users. 
Till now in the activity history, everything is visible to everyone which we want to keep it as it is.

But this is a special request in which emails sent by specific profile should be logged in an opportunity but should not be visible to anyone. Any thoughts?
Hi,

I have a request in my organisation in which they are looking to send emails to customers through salesforce, now those emails when logged in activity history, they dont want any other salesforce user to see them, they want to keep it confidential.
Now if i use the activity history, other people will see them as that's what the setting is right now, which is fine. So is there any alternative way or a way to create separate object having its own activity history that does not integrate with salesforce activity history. Any help is appreciated.
Thanks
Hello,

Here it is:

 if({!CONTAINS("AUSTRALIA:FIJI", UPPER(Opportunity.Account.BillingCountry ))} || ({!Opportunity.end_user_account__r.BillingCountry } != null && {!CONTAINS("AUSTRALIA:FIJI", UPPER(Opportunity.end_user_account__r.BillingCountry ) )}))
  {window.alert("Test message"}
  }

Its not working. Above script states that for any opportunity having Account Country or End User Account Country (End User Account is a lookup Account field at Opportunity level) Australia or Fiji, alert pop up should appear.
In addition to this, it should popup only if the opportunity is just created.

Thanks
Hello Everyone,

I need help in bulkifying the code below. The requirement is we have multicurrency org, so first check the currency and if currency is greater than 10k USD, a special T&C should appear in addition to regular T&C (if reg T&C not present already)
For amount greater than 10K, only regular T&C should appear.
Here's the code:

    public static void CheckTNC(List<Quote> Qlist){   
      
        Set<Id> setGrtAmtQTC= new Set<Id>();
        Set<Id> setLessAmtQTC = new Set<Id>();
        Set<Id> setdelCCQId = new Set<Id>();
        Set<Id> setremccqid = new Set<Id>();
        Set<Id> setqtcid = new Set<Id>();
        Set<Terms_and_Conditions_Quote__c> settoins = new Set<Terms_and_Conditions_Quote__c>();
        Set<Terms_and_Conditions_Quote__c> settodel = new Set<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lsttodel1 = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lsttodel2 = new List<Terms_and_Conditions_Quote__c>();       
        List<Terms_and_Conditions_Quote__c> lsttoins1 = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lsttoins2 = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lstdelallTC = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lstdelQTC = new List<Terms_and_Conditions_Quote__c>();
        List<Terms_and_Conditions_Quote__c> lstinsQTC = new List<Terms_and_Conditions_Quote__c>();
        Terms_and_Conditions__c tcspecial = [Select t.Id  From Terms_and_Conditions__c t where t.Id =: 'a0o60000000ZyW']; //less than 10K T&C
        Terms_and_Conditions__c tcregular = [Select t.Id  From Terms_and_Conditions__c t where t.Id =: 'a0o60000000Zy']; //regular T&C
       
        map<string,decimal> queriedcurrencies = new map<string,decimal>();
        List<Opportunity> lstAutoRenOpp = new List<Opportunity>();        
        Map<Id, Quote> mapq = new Map<id, Quote>();
        for(CurrencyType c : [SELECT ISOCode, ConversionRate FROM CurrencyType WHERE IsActive=TRUE]){
            queriedcurrencies.put(c.ISOCode,c.ConversionRate);
            System.debug('Curreny ' + c.ISOCode + 'with conversion rate' + c.ConversionRate);
        }
        mapq.putall(Qlist);
        for(Quote q: mapq.values())
        {
             
            if( q.TotalPrice > 0 )
            {         
                decimal convertedvalue = q.TotalPrice/queriedcurrencies.get(q.CurrencyISOCode);            
                if(q.TotalPrice > 10000)         
                    setGrtAmtQTC.add(q.id);           
                else          
                    setLessAmtQTC.add(q.Id);           
            }          
            
        }
        if(setGrtAmtQTC != null && setGrtAmtQTC.size() > 0)
        {
            Map<Id,Terms_and_Conditions_Quote__c> mapdelCCTCQuoteId = new Map<Id,Terms_and_Conditions_Quote__c>([select Id,Quote__c,Terms_and_Conditions__c from Terms_and_Conditions_Quote__c where quote__c in : setGrtAmtQTC and Terms_and_Conditions__c =: tcspecial.id]);
        
            System.debug('List size to delete credit card quote:' + mapdelCCTCQuoteId.size());
            if(mapdelCCTCQuoteId != null && mapdelCCTCQuoteId.size() > 0)
            { 
                lsttodel1.addall(mapdelCCTCQuoteId.values());                  
                for(Terms_and_Conditions_Quote__c obj: mapdelCCTCQuoteId.values())
                    setdelCCQId.add(mapdelCCTCQuoteId.get(obj.Id).Quote__c);
                    
                //check if quotes have regular T&C, as some products dont, make sure to add it if its not added
                Set<Terms_and_Conditions_Quote__c> setremnetpqid = new Set<Terms_and_Conditions_Quote__c>([select Quote__c from Terms_and_Conditions_Quote__c where quote__c in : setdelCCQId and Terms_and_Conditions__c =: tcregular.Id]); 
                system.debug('setremnetpqid'+setremnetpqid.size());
                if(setremnetpqid!= null && setremnetpqid.size() > 0)
                { 
                    for(Terms_and_Conditions_Quote__c objq: setremnetpqid)               
                    setdelCCQId.remove(objq.Quote__c);
               
                }
                                
                if(setdelCCQId != null && setdelCCQId.size() > 0)
                {
                    for(Id tcquoteid : setdelCCQId)
                    {
                        Terms_and_Conditions_Quote__c objTCNet = new Terms_and_Conditions_Quote__c(); 
                        objTCNet.Quote__c = tcquoteid; 
                        objTCNet.Terms_and_Conditions__c = tcregular.Id; 
                        lsttoins1.add(objTCNet);
                    }
                    
                }
                
            }
            
        }
        if(setLessAmtQTC != null && setLessAmtQTC.size() > 0)
        {
            Set <Terms_and_Conditions_Quote__c> settcqid = new Set<Terms_and_Conditions_Quote__c>( [select quote__c from Terms_and_Conditions_Quote__c where quote__c in : setLessAmtQTC and Terms_and_Conditions__c  =: tcspecial.id]);
            if( settcqid != null &&  settcqid.size() >0)
            {
                for(Terms_and_Conditions_Quote__c t: settcqid)                                     
                setremccqid.add(t.Quote__c); 
                setLessAmtQTC.removeall(setremccqid);   
            }
            if(setLessAmtQTC != null && setLessAmtQTC.size() > 0)
            {
                
                for(Id tcquoteid : setLessAmtQTC)
                {
                    Terms_and_Conditions_Quote__c objTCCC = new Terms_and_Conditions_Quote__c(); 
                    objTCCC.Quote__c = tcquoteid;
                    objTCCC.Terms_and_Conditions__c = tcspecial.id;
                    lsttoins2.add(objTCCC);                                  
                }
                
            }
        }  

        if(lsttodel1!= null &&  lsttodel1.size() > 0)
            settodel.addall(lsttodel1);
      
        if(settodel != null && settodel.size() > 0) 
        {
            lstdelQTC.addall(settodel);
            delete  lstdelQTC;
        }
        if( lsttoins1!= null &&  lsttoins1.size() > 0 )
            settoins.addall(lsttoins1);      
        if(lsttoins2!= null &&  lsttoins2.size() > 0)
            settoins.addall(lsttoins2); 
       
        if(settoins != null && settoins.size() > 0)
        {
            lstinsQTC.addall(settoins);
            insert  lstinsQTC;
        }
    }

 
We have a custom object "Terms & Conditions - Quote'.
Based on the "Amount" of the quote, I have to delete certain 'T&C' from the custom object and add other 'T&C' respectively.
The T&C's are linked to the product, whenever a lineitem is added, all product related T&C's are added. But now we want to add further customization to check the amount too. Based on final amount of quote, T&C's can change.
 
Hello,

What my question is as follows?

1 a
2 a
3 a
4 b
5 b

I want to get 1 a and 4 b and delete 2 a, 3 a, 5 b.
Is it possible to do?
Hello,

I am facing an issue while Cloning Opps & Quotes, reason being I am adding a special T&C only if they select certain kind of product with specific duration. So its runtime determined whether I will be adding T&C to the quote.
Now the issue is suppose the quote has those special T&C's, now when I am cloning the opp/ cloning the quote, it clones T&C's too, which is fine.
But during cloning there is an event on quotelineitem after insert which runs my trigger on quotelineitem that checks if a specific product is inserted with specific duration then insert the special T&C.
So in the end I am recieving duplicate T&C's in the quote.
How can I indicate the trigger that's fired on insert of Quotelineitem, that its a clone action, so this time at the time of insertion don't fire.
Whereas the trigger at quotelineitem can be fired while update/delete.

Thanks in advance!
Hello Everyone,
I am having a field called Discount Percent at quotelineitem. 
If a quotelineitem is of a specific Product Category and there are many quotelineitems of the same product category, when discount % is applied to one lineitem of that product category in an onchange event automatically the discount percent should be applied to all lineitems of the same product category. 
Could anyone suggest how to do that? 
Thanks
 
Experts, I am generating a report using conga composer manually on daily basis. It is giving the report in .pdf format. Is there any way to automate the process ? I want to store the .pdf report in my computers.

Thanks,
Ram
Hi Developers,

I am attempting to make a request to the endpoint /oppitm/lineitemsort.jsp from a visual force page to sort OLIs. However, it is my understanding that in order to make post request like this I will need the CSRF token present in the request. I am trying to do this but I am having difficutly getting the correct token. I try to retrieve the token with the following ajax request:
$j.ajax({
                 url:"./oppitm/lineitemsort.jsp?id={!oppId}",
                 contentType:"text/html",
                 xhrFields:{withCredentials:true},
            }).done (function(data){
                key_start='csrfToken="';
                key_end='"';
                pos_start=data.indexOf(key_start);
                pos_end=data.indexOf(key_end,pos_start+key_start.length);
                var token=data.substring(pos_start+key_start.length,pos_end);
            });
});

But I continually get redirected to "Unable to access page." when using the CSRF token that is returned.  My understanding is that Visual Force will store the CSRF token in the form under an input with id "com.salesforce.visualforce.ViewStateCSRF" following a post, so I have been trying to get the token that way. But all attempts to do so result in an empty value in that element. Any ideas when that is appending to the form and how I can get it?
  • April 29, 2015
  • Like
  • 1
I'd like to re-open the discussion of SortOrder on the OpportunityLineItem object. A thread from 3.5 years ago can be located here:
http://community.salesforce.com/sforce/board/message?board.id=general_development&message.id=3154

Looks like people from SF were going to look into it but obviously nothing has come to fruition. The reason I have put this in the Visualforce board is that we have have a few VF applications that could really take advantage of access to this field. Visualforce has also opened up new possibilities to UI design where the ability to manage SortOrder could be useful.

Also, no offense to salesforce.com, but the tool for sorting OpportunityLineItems is not that useful when there are multiple products with the same name. I have actually built a pretty slick sorting application but this is currently useless.

A lot of the concerns were about error handling. What happens if you have 3 line items but sort order is defined as, 1, 2, 2. Or 1, 2, 4. How about just throwing a sortOrder exception and force the developers to write good code?

Ideas? Thoughts?
http://ideas.salesforce.com/article/show/10092062/OpportunityLineItem_SortOrder_to_be_CreatableUpdatable

-Jason


Message Edited by TehNrd on 09-05-2008 01:22 PM
  • September 03, 2008
  • Like
  • 1