• VPrakash
  • NEWBIE
  • 180 Points
  • Member since 2010

  • Chatter
    Feed
  • 7
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 12
    Questions
  • 93
    Replies

Hi,

 

We are building an integration between an external system to salesforce. For this we have build a web service to do the required functionality, and the external system is accessing the enterprise wsdl and the web service wsdl. Whenever a login request is sent to salesforce, upon succesful login a session id is generated and is maintained till the required action is performed in salesforce. How can i end this session from the external system? Is there any api call or anything to do this in salesforce?

 

Thanks.

  • May 22, 2012
  • Like
  • 0

Am trying to create an Asset when a case is closed but asset is not being created when i close it , here is my code not sure what's wrong here

 

trigger CaseAsset on Case (after insert) {
List<Asset> ast = new List<Asset>();
   
    for (case c : Trigger.new) {
      
    if(trigger.isinsert && (c.status == 'closed' && c.Type == 'TELECOM MOBILE_(Connectivity, SW, HW)'))
    
      {
         ast.add(new asset(   
        
        Assigned_Number__c = c.Asser_Phone_Number__c,
        Asset_Type__c = c.Asset_Type__c,
        Name = c.Asset_Type__c ));
        
      }
        
    }
    insert ast;
}

  

Is there any way to use my developer account for SFDC on Database.com?

Hello Folks,

 

I have been trying to install the Force.com IDE for over a month, and yet every time I run into trouble. Originally the issue was that once installed, when i tried to launch the app it would throw an error. This happened the first ten or so times I tried installing this tool. I gave up for a while, and yesterday a co worker of mine helped me install it, and it worked just fine. When I came in this morning however, I launched the program and I got the same error message. I would include it as an attachment but I do not see that as an option here. So, this has now happened to me on both of the machines I have to work on, and I cannot do the work I need to because the tool does not work on my machines. Today I reinstalled several times, and each time I had trouble downloading the software, and then even when the proxy was discovered automatically it could not connect. Finally I typed the proxy settings in, and it looked as if it was trying to connect, but could not actually download anything. It would get to the "preparing to download metadata..." part and go unresponsive. I am looking for some help getting this tool working, this is quite frustrating and I could definately use some guidance and assistance troubleshooting.

 

Thank You

I have created an integer that acts as a counter for the number of quote records with the same opportunity id as noted below:

 

Integer bi = [select count() from Quote where opportunityid = :oid];

 

I have added two record types on the Quote record; Budget Quote and Firm Quote. I would like to limit the above code to the Budget Quote recordtype. I have tried the following:

 

Integer bi = [select count() from Quote where opportunityid = :oid and recordtypename='Budget Quote'];

  and I recieve the following error:

Compile Error: No such column 'recordtypename' on entity 'Quote'. If you are attempting to use a custom field, be sure to append the '__c' after the custom field name. Please reference your WSDL or the describe call for the appropriate names.

 

How do i solve this error?

 

Thank you

Hi,

As we know, there could be 2,000,000 characters limitation for total Apex code for an organization. Now, does that number including System.Debug statements as well?  Or this excludes System.Debug statements like comments and @istest ones?

 

Thanks

 

 

 

  • March 08, 2011
  • Like
  • 0

Hi I 'm new to Apex.

What I want want to do is

Every time a new Merchandise record is created I need to create a detail test record with certain fields filled out.

 

Relationship:
Merchandise = Master
Test  = Detail

 

I had create below code but error occured:

 

Trigger CreateNewTestRec on Merchandise__c (after insert){

    list<test__c> AddNR = new list<test__c>();
    
    for(Merchandise__c m : Trigger.new){
        test__c TE = new test__c(
        Merchandise__c = m.Name);
    AddNR.add(TE);
    }
    insert AddNR;
}

 

Error: Invalid Data.
Review all error messages below to correct your data.
Apex trigger CreateNewTestRec caused an unexpected exception, contact your administrator: CreateNewTestRec: execution of AfterInsert caused by: System.StringException: Invalid id: test: Trigger.CreateNewTestRec: line 7, column 26

 

Anybody able to help me?

Thanks in advance

I have a formula field of date return type on custom object. which is rightly calculated and can be seen on the page layout. But when I try to display this field on Visual force page either using outputfield or outputtext tags, the date don't show up on the VF page.

 

Can you guys please give some insight on this? 

 

Here is the tag  I am using on the VF Page

 

<apex:outputText  value="{!BigMachines_Quote__c.Expiration_Date__c}"/>

 

and formula field is

 

Expiration_Date__c = DATEVALUE( Quote_Expiration_Date__c )  //Quote_Expiration_Date__c  is a text field

 

Can you tell me what I am doing wrong? Or am I missing something here? 

 

Thanks in Advance

Hi All,

 

Can we generate WSDL for group of objects like we generate the from the outbound message and send this to other application?

Hello,

 

I developed a VF Page to mass edit records from UI using the standard controller and this is a list button. Here is my VF Page 

<apex:page standardController="Tier_Pricing__c" recordSetVar="unused" tabstyle="Tier_Pricing__c" sidebar="false">
    <apex:includeScript value="{!$Resource.UtilJS}" />
    <apex:form >
        <apex:pageBlock >
            <apex:pageMessages />            
            <apex:pageBlockButtons >
                <apex:commandButton value="Save" action="{!save}"/>
                <apex:commandButton value="Return" action="{!cancel}"/>
            </apex:pageBlockButtons>
            <apex:pageBlockTable value="{!Selected}" var="a" id="table">
                <apex:column headerValue="Name">
                    <apex:outputField value="{!a.name}"/>
                </apex:column>
                <apex:column headerValue="Price break Type">
                    <apex:outputField value="{!a.Price_Break_Type__c}"/>
                </apex:column>                
                <apex:column headerValue="Tier Number">
                    <apex:outputField value="{!a.Tier_Number__c}"/>
                </apex:column> 
                <apex:column headerValue="Value From">
                    <apex:outputField value="{!a.Value_From__c}"/>
                </apex:column>
                <apex:column headerValue="Value To">
                    <apex:outputField value="{!a.Value_To__c}"/>
                </apex:column> 
                <apex:column headerValue="Agreement Price">
                    <apex:inputField value="{!a.Agreement_Price__c}"/>
                </apex:column>                               
            </apex:pageBlockTable>
        </apex:pageBlock>
    </apex:form>
</apex:page>

 

 

This VF page works fine and  I can able to mass edit records at a time. But, when I select records and click the list button, the records are not sorted. So I want to sort the records by Tier Number in the page.

 

 

How can I implement this? 

 

Thanks in advance

 

VPrakash

 

Hi all,

 

We are going to enable Custom fiscal year feature in our org. And there is batch apex class which calculates the opportunity forcast  which is scheduled to run 1st of every month ( Standard Fiscal Year ).

 

If we enable custom fiscal year and add this template 4-4-5 fiscal year that has 4 quarters and 13 weeks per quarter.

 

I want to schedule the above batch apex class to run on start date of every custom fiscal month(Custom Fiscal year) e.g., for March 2011,start date would be 02/27/2011 . Can we do this through the standard apex scheduler? If not, How to implement this?

 

Thanks in advance

 

VPrakash

Hi all,

 

 I am writing a test method for a trigger below

 

trigger PartnumberCheck on FAQPartNumber__c (before insert, before update,after insert,after update) {
    if(!PriceForceUtility.isUpdateFromclass){
        if(Trigger.isBefore){
            set<String> partnumber = new set<String>();            
            Agreement_Line_Item__c[] ali2check = [select id,name,part_number__c,product__c,Product_Class__c from Agreement_Line_Item__c where Agreement_Line_Item__c.Agreement__c=:trigger.new[0].agreement__c];        
            
            system.debug(ali2check);            
            for(Agreement_Line_Item__c ali:ali2check){            	
                if(ali.Product_Class__c == 'Instrument')
                    partnumber.add(ali.part_number__c);                                        
            }
            for (Integer i=0; i<Trigger.size; i++) {
            	system.debug(trigger.new[i]);
                if(!(partnumber.contains(trigger.new[i].part_number__c))){                
                    trigger.new[i].adderror('Cannot Add the part number not on the agreements instrument list');
                }
            }
        }
        FAQ__c[] faqstoupdate = new FAQ__c[]{};
        if(Trigger.isAfter){
            FAQ__c faq = [select id,name,part_number__c from FAQ__c where id=:trigger.new[0].FAQ__c];
            string partnumber = '';
            FAQPartNumber__c[] faqparts = [select id,name,part_number__c from FAQPartNumber__c where FAQPartNumber__c.FAQ__c=:faq.Id];
            integer i=0;
            for(FAQPartNumber__c faqpart:faqparts){
                if(i==0){
                    partnumber = faqpart.part_number__c;
                }else{
                    partnumber = partnumber+'^'+faqpart.part_number__c;
                }
                i++;        
            }       
            faq.Part_Number__c= partnumber;
            faqstoupdate.add(faq);
        }
        update faqstoupdate;
    }
}

 

 My test code is as follows 

 

 

@isTest
private class PartNumberCheckTest {
	static testmethod void testfaqpartnumber(){
		
		Agreement__c agreement = new Agreement__c();
		agreement.Name = 'Test Agreement';
		agreement.Agreement_Type__c = 'GPO';
		agreement.Agreement_Code__c = 'AMERINET';
		agreement.Start_Date__c = date.newInstance(2007,1,1);
		agreement.End_Date__c = date.newInstance(2012,12,31);
		insert agreement;
		
		Agreement_Line_Item__c ALI2 = new Agreement_Line_Item__c();
		ALI2.Agreement__c = agreement.id;
		ALI2.Part_Number__c = '6E119';
		insert ALI2;
		
		id recordtypeid = [select id from RecordType where name='Part Number Record Type' and SobjectType ='Agreement_Line_Item__c'].id;
		Agreement_Line_Item__c ALI1 = new Agreement_Line_Item__c();
		ALI1.Agreement__c = agreement.id;
		ALI1.Part_Number__c = 'A71456' ;
		ALI1.RecordTypeId = recordtypeid;
		ALI1.Agreement_Price__c = 12345;
		
		insert ALI1;
		
		FAQ__c faq = new FAQ__c(Agreement__c = agreement.id,Water__c = 'Yes',Sonicator__c = 'Yes',AirfareIncluded__c = 'No',Ups__c = 'No',TradeInAllowed__c='No',AdditionalTraining__c='0',Linearity__c='No');
		insert faq;
		system.debug(ALI1);
		PriceForceUtility.isUpdateFromclass = false;
		FAQPartNumber__c faqpart = new FAQPartNumber__c(FAQ__C = faq.Id,product__c = '01t30000001V0hg');
		insert faqpart;
}

 

 

My trigger is invoked from the test method and the trigger works on the data from different objects (Agreement_Line_Item__c), which I retrieved using a query in the trigger. This trigger works fine in the UI but when trying to write a test class for this trigger I am not getting test data(back to the trigger) to validate in the trigger using the query.

 

 

Please look in to this and let me know where I am doing wrong 

 

Thanks In advance 

 

VPrakash 

 

 

Hi all,

 

How to insert a Child record (e.g., Child__c) into multiple parent records ( e.g., Parent__c) from the UI?

 

Can we implement this using Apex and Visualforce? If so Can you please provide me with the start point 

 

 

Thanks in advance 

 

VPrakash

Hi all,

 

Parent : Agreement__c

Child : Agreement_line_item__c

 

I have a URL button on child as  /apex/MassInsertALI1?{!Agreement__c.Id}. 

 

I have to use this id to be captured and used through out the my custom controller and assign this id to the newly created child records. I know this can be done through the standard controller but the button is on the child related list on the parent page layout. 

 

Can you please help with this issue?

 

Thanks in advance 

 

VPrakash

Hi all,

 

I have a requirement where i need to insert the chatter feed on the parent(account) whenever a new chatter feed is inserted in the child(contact or opportunity) record.

 

Can this be done using the chatter Triggers? If so can you provide me the start point? 

 

 

Thanks in advance 

 

VPrakash

Hi all,

 

Can we customize the process of adding products as opp line items to the opportunities using Apex and Visualforce? If so can you please provide me with some sample code or references.

 

 

Thanks in Advance 

Hi all,

 

Can you please provide some example force.com flow example files and uses cases you are working on.

Hi all, 

 

Here is the scenario, We have a contract object to which contract line items is a child object. We want to add multiple contract line items to the contract object. Contract line items are nothing but the products with some extra fields. Like we add opp line items to the opportunities as in standard functionality. Can we do this for my scenario using apex and visualforce. Is this possible? 

 

Thanks in advance 

 

--VPrakash

Hello,

 

 I need to parse XML string available in one of the Sobject field and save the parsed data(from different nodes) into corresponding related(Master-Detail) object fields.

Hello,

 

I am new to Apex triggers and need help on creating one.  My organization has a custom object called product subscriptions.  I would like to run a trigger to checks if a field called quantity on my custom object is equal to 0.  If the quantity is equal to 0 I would like the trigger to delete that record.  Below is the trigger I have started(it may be completely wrong):

 

trigger DeleteZeroQtySubscriptions on Product_Subscription__c (after update, after insert) {
//This trigger deletes any product subscription that has a quantity of 0
//Created by Bennett 1082013

Product_Subscription__c[] toBeDeleted = new list<Product_Subscriptions__c>();

for (Product_Subscription__c sub : Trigger.Old)
{
if (sub.Quantity__c == '0')
{
toBeDeleted.add(sub);
}
}
delete toBeDeleted;
}

 

Also, how can I test this trigger?

 

Thanks,

inside a try / catch, im querying a custom setting and when theres no records to select, i see an error message rather than my catch exception executing. whats up with that? how can i pre-query to ensure a record before this error page gets rendered?

Hi,

 

We are building an integration between an external system to salesforce. For this we have build a web service to do the required functionality, and the external system is accessing the enterprise wsdl and the web service wsdl. Whenever a login request is sent to salesforce, upon succesful login a session id is generated and is maintained till the required action is performed in salesforce. How can i end this session from the external system? Is there any api call or anything to do this in salesforce?

 

Thanks.

  • May 22, 2012
  • Like
  • 0

I have a object that i need to migrate the data to a new object, then remove the old object. Im not worried about removing the old object thats the easy part. Whats the best way to get all the data from object A to object B they have different structures. Do i wright a class and execute it some how, or do i use the data loader? Whats the best way to do this, Thanks in advance

 

RSSBus Excel Add-In for Salesforce provides the easiest way to view and modify Salesforce data. Users simply supply their account credentials via the connection wizard to create a connection, and can immediately begin working with live Salesforce tables of data. The Excel Add-In is completely self-contained; no additional software installation is required. (http://www.rssbus.com/excel/salesforce)

 

Advanced Import/Export and Visualization

RSSBus Excel Add-In for Salesforce is useful for cleaning and mass-updating Salesforce data from within Excel. With the Excel Add-In for Salesforce, users have unlimited access to commonly used Salesforce constructs like Leads, Contacts, Opportunities, Accounts, Products, Custom Objects, and more.

 

Perfect for mass imports / exports / updates, data cleansing & de-duplication, Excel based data analysis, and more!

  • Modify and delete Records.
  • Quickly export and back-up data.
  • Operate on data with Charts and Pivot Tables.

http://www.rssbus.com/excel/salesforce

Hi

 

In record sharing if we add the record to All Internal Users,So for which type of users the record is shared.

I need to know the User's profile which come under All Internal Users.

 

If any one know about this please help me.

Hello, I am very new to SF and Apex code (Not new to OOP, though). I have been searching all over the net for a solution to my problem, but I cannot seem to find one. 

 

We have setup an email service to receive emails and these emails have 1 tab delimited text file attachment. The content of these text files need to be read and uploaded to a DB Object we created. 

 

Does anyone have a link on how to read through an attached text file? If I get that working, then I should be able to do the rest.

 

Any help would be greatly appreciated.

 

Thank you,

 

Wes Cooper

I Have a checkbox that the default checked is set in the object. I created a visualforce page with the checkbox. But when i hit the new button it is not checked. How do i make the default value checked. Thanks

 

<apex:inputCheckbox value="{!Debt_Info__c.Round_Payment__c}" />

 

Hi Guys,

 

I am trying to use data loader command line to import data from other system to Salesforce for daily synchronization.

 

In old system, the account table come with role table(many-to-one, child-parent relationship). But in salesforce,  it is designed by account object with corresponding record type.

 

According to the data load guide, I can specified the extenal id on the salesforce destination object, then the data could be imported with the relationships between the account and role.

 

But it seems I cannot add new external Id field on the record type object. How can I transfer the account and role from orignal system to salesforce?

 

Since we are still using the old system, the new roles may be inserted into the system. In this case, we cannot manually specify the record type id on the csv file.

 

Any help would be greatly appreciated.

 

 

Am trying to create an Asset when a case is closed but asset is not being created when i close it , here is my code not sure what's wrong here

 

trigger CaseAsset on Case (after insert) {
List<Asset> ast = new List<Asset>();
   
    for (case c : Trigger.new) {
      
    if(trigger.isinsert && (c.status == 'closed' && c.Type == 'TELECOM MOBILE_(Connectivity, SW, HW)'))
    
      {
         ast.add(new asset(   
        
        Assigned_Number__c = c.Asser_Phone_Number__c,
        Asset_Type__c = c.Asset_Type__c,
        Name = c.Asset_Type__c ));
        
      }
        
    }
    insert ast;
}

  

I have  the following relationship query instantiated to a Map<>:

 

Map<Id, Account> accountsMap = new Map<Id, Account>([
select a.id, a.Name, a.Active_Support_Contract__c,
(select s.id, s.status__c, s.status, s.name, s.accountId, s.recordType.name from a.ServiceContracts s)
from Account a where a.id in :accountIds]);
.
.
.
Account account = accountsMap.get(aid);

if (account.ServiceContracts != null) {...} // "Attempt to de-reference a null object"
if (account.ServiceContracts.size() != 0 {...} // "Attempt to de-reference a null object"
for (ServiceContract sc : account.ServiceContracts) {} // "Attempt to de-reference a null object"

 

I've tried several ways of accessing the Account's ServiceContracts. Everything works fine in my sandbox but when I'm ready to deploy to production, I get the errors above.

 

The log files are not helpful either. 

 

 

I have a formula field of date return type on custom object. which is rightly calculated and can be seen on the page layout. But when I try to display this field on Visual force page either using outputfield or outputtext tags, the date don't show up on the VF page.

 

Can you guys please give some insight on this? 

 

Here is the tag  I am using on the VF Page

 

<apex:outputText  value="{!BigMachines_Quote__c.Expiration_Date__c}"/>

 

and formula field is

 

Expiration_Date__c = DATEVALUE( Quote_Expiration_Date__c )  //Quote_Expiration_Date__c  is a text field

 

Can you tell me what I am doing wrong? Or am I missing something here? 

 

Thanks in Advance