-
ChatterFeed
-
1Best Answers
-
0Likes Received
-
0Likes Given
-
14Questions
-
32Replies
How to pass ArrayOfString value to apex function?
Hi, I have an apex class generated from a WSDL. There is a function in the class that takes an ArrayOfString object as input. For testing, how can I assign a value to a variable of type ArrayOfString?
I have the variable declared as: soaNrccuaOrgOms.ArrayOfString saleNumbers= new soaNrccuaOrgOms.ArrayOfString(); and the function is called as: Boolean result = obj.TipOrderStatusUpdate(saleNumbers); Thanks, Saania |
-
- Saania
- January 30, 2013
- Like
- 0
- Continue reading or reply
Error ... SELF_REFERENCE_FROM_TRIGGER: between 2 triggers updating each other.
We have a custom object for Contact Roles. A field in Contacts (the gone field) updates the value of a field in 'Contact Roles', and a field in Contact Roles when updated (not one field but a combination of fields) has to set the value of a field in Contact. I know its a loop, but the requirements are such that I cant think of a work around. The trigger in 'Contact Roles' has to be an 'after', while the one in Contact is 'before'
Is there a way to specify the order in which these triggers are executed, or stop execution of one trigger till the other completes its execution?
Thanks,
Saania
-
- Saania
- September 03, 2009
- Like
- 0
- Continue reading or reply
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : Entity type cannot be inserted: Campaign
I am getting the error specified as the subject when i create a Campaign in VC#. There is no issue of access rights in this case for sure, since I am the System Administrator.
The code is pretty simple. I just create a Campaign object, and call binding.create method with the campaign object as an sObject array. The binding is correct, because I am using it to query the Campaign object earlier as well, that returns correct results
Thanks,
-
- Saania
- October 14, 2008
- Like
- 0
- Continue reading or reply
Getting 'EXCEEDED_ID_LIMIT: record limit reached' error on binding.create()
I am creating a piece of code that adds campaign members to selected campaign via a UI in VC#.
the Campaign can have many members (obviously more than 200 in most cases), when I use binding.create() method to create an instance (or even an array) of CampaignMember object(s), I get an error ...
'EXCEEDED_ID_LIMIT: record limit reached. cannot submit more than 200 records'
Any suggestion for a work around would definately help.
Thanks,
-
- Saania
- October 09, 2008
- Like
- 0
- Continue reading or reply
Error during ant deploy/delete.
I am trying to update an already exiting trigger in production. I have done the 'ant deploy' procedure several times earlier as well, but this time I am getting this error:
On ant deploy: Failed to login: Unable to serialize property of 'classes' on type common.api.soap.wsdl.CompileandTestResult.
and On ant delete:Failed to login: Unable to serialize property of 'runstestsresults' on type common.api.soap.wsdl.CompileandTestResult.
Thanks.
-
- Saania
- September 30, 2008
- Like
- 0
- Continue reading or reply
Two triggers in deadlock
I have a trigger in Opportunity object (UpdateOpportunityAmount) that updates the Amount field based on stage. This trigger calls the Opportunity Line Item object to update the unit price accordingly.
In Opportunity Line Item we have a trigger (UpdateOpportunityProduct) that sets certain fields in opportunity object, based on selected Product. The error I am getting is.
UpdateOpportunityAmount: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 00k60000005cTOLAA2; first error: CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY, UpdateOpportunityProduct: execution of BeforeUpdate caused by: System.DmlException: Update failed. First exception on row 0 with id 0066000000APwGhAAL; first error: UNKNOWN_EXCEPTION, Object (id = 0066000000APwGh) is currently being updated in trigger UpdateOpportunityAmount: [Id] Trigger.UpdateOpportunityProduct: line 45, column 17 Trigger.UpdateOpportunityAmount: line 27, column 17
I know the reason, I just cant think of a solution or a workaround. because of the before update/ after update issue with triggers, i cant perform the Opportunity Line Item operation within the Opportunity Trigger.Any help would be highly appreciated.
Thanks,
-
- Saania
- September 15, 2008
- Like
- 0
- Continue reading or reply
EXIST statement equivalent in SOQL
The statement I want to execute is ... 'Clients that did not have a sale last FY, but did buy a product in last 3 years'.
That is, if a client bought a product in FY 2005, but not in FY 2007 (which was the previous FY), I want the client to show up in the list.
In my SQL Server table, we were using the DISTINCT and EXIST statements to retrieve such clients. The clients were matched on the products they bought and the fice(a unique id for the client). But the allsls (All Sales) table can have multiple entries for the same fice and product, for a given client.
In SOQL since these statements are not available, how to accomplish this?
The SQL statement is as:
SELECT distinct sc.fice, sc.state, sc.product FROM dbo.allsls AS sc (NOLOCK) WHERE sc.trxdate BETWEEN '07/01/2004' AND '06/30/2006' -- Colleges bought 3 to 4 FY ago (2005-2006) (i.e. not last FY year, but last 3) AND NOT EXISTS (SELECT t1.product FROM dbo.allsls as t1 (NOLOCK) WHERE t1.product = sc.product AND t1.fice = sc.fice AND t1.trxdate BETWEEN '07/01/2006' AND '06/30/2008' -- Didn't buy current FY (2008) or prev FY (2007) )
I would definately appreciate any help to solve this query.
Thanks,
-
- Saania
- May 12, 2008
- Like
- 0
- Continue reading or reply
Contact Owner to be Account Owner (By Default)
I want the Contact Owner to be the Account Owner, when the user creates a new COntact. I can see that a Field Update on Contact Owner is not an option.
What else can be done to accomplish this? (with some examples, if possible)
Thanks,
-
- Saania
- February 29, 2008
- Like
- 0
- Continue reading or reply
Getting salesforce ID from page URL.
I thought that the ID in the URL for any object is unique. For instance, if the URL is some account is ‘https://www.salesforce.com/0016000000In2ky’, where 0016000000In2ky is the internal SF ID. But the problem is that the actual ID pulled from the SF database is ‘0016000000In2kyAAB’.
So, if I want to create a SOQL query in AJAX based on ID like
result = sforce.connection.query("Select fice__c from Account where Id like ’" + name + "’");
where 'name' is the ID from the URL, the query wont work. Also, even though documents suggets that you can use '%' in SOQL, a query like:
result = sforce.connection.query("Select fice__c from Account where Id like ’" + name + "%’");
still does not work.
I would truly appreciate any help in this regard.
Thanks,
-
- Saania
- February 25, 2008
- Like
- 0
- Continue reading or reply
Checking if any picklist value has been selected.
we have a checkbox named 'On Behalf Of', which when checked should have a value in the picklist named 'On Behaf of user'.
I already have a field dependency set to show the picklist values only when the checkbox is checked, but we need to make sure that the user selects something in the picklist ( and not just leave it as --None--).
The validation rule I was using is:
AND(On_Behalf_of__c , IF( ISPICKVAL( On_Behalf_of_User__c, "none") , FALSE, TRUE)).
But this prevents the users from saving the data, even when they have a valid value in the picklist. I think the problem is the "none" part in the picklist, so how should one check to see if the picklist has a value other than --None--.
Thanks,
-
- Saania
- February 05, 2008
- Like
- 0
- Continue reading or reply
Getting 'System.Exception: SObject row does not allow errors:' on addError
'execution of BeforeUpdate caused by: System.Exception: SObject row does not allow errors:'. The code I am using is ...
trigger UniqueRoleProductTrigger on Contact_Role__c (before insert, before update)
{
if (Trigger.isBefore)
{
if (Trigger.isUpdate)
{
for (Integer i = 0; i < Trigger.new.size(); i++)
{
Contact_Role__c newRole = Trigger.new[i];
Contact curContact =
[select id, AccountId from Contact where id = :newRole.Contact_Person__c];
Contact_Role__c[] RoleProduct =
[select id, Product__c, Role__c from Contact_Role__c
where id = :newRole.Id];
for (Contact_Role__c r: RoleProduct)
{
if ((r.Product__c == newRole.Product__c) && (r.Role__c == newRole.Role__c))
{
r.addError('Role, Product pair already exists. Can not have duplicate Role-Product pair for the same contact.');
} //end of if statement
} //end of for loop
}
}//end if update
}
}
I tried Trigger.new.addError as well, but still getting the error. Would greatly appreciate any help.
Thanks
-
- Saania
- January 14, 2008
- Like
- 0
- Continue reading or reply
Trouble directing a URL to a Tab
Hi,
I did an override of the New Button in Account Object, with my custom HTML SControl. The SControl simply checks unique Fice (our internal primary ID), and creates an account if the fice is unique.
When the fice is left empty, the user is simply taken to the new accounts page. I am using the following code to perform this action.
window.parent.location.href = "{!URLFOR($Action.Account.New, Account.Id, [retURL=URLFOR($Action.Account.New, Account.Id)], true)}"
The problem is, that if a valid fice and account name is entered, and an account created, I want the user to be redirected to either the edit page of the new account, or to the Account Tab. I tried the following options,
window.parent.location.href = "{!URLFOR($Action.Account.Tab, Account.Id)}"
and window.parent.location.href = "{!URLFOR($Action.Account.Edit, Account.Id)}"
but the page is not redirected to either the Tab or the edit page. It remains in the html page of scontrol.
Thanks,
Saania
-
- Saania
- October 08, 2007
- Like
- 0
- Continue reading or reply
Validation Rule: to assign value to text field
I thought this should be simple, but it didnt work out the way I had it in mind. I have a checkbox named ALL. I want to write something in a textbox if the checkbox is checked.
All I did was
IF ( All__c, Link_selected__C = " some text here", null).
But when I create a new object, nothing is entered into the text field Link Selected. And there is nothing in the field when I save the record.
Would appreciate any help.
Thanks,
Saania
-
- Saania
- August 23, 2007
- Like
- 0
- Continue reading or reply
Add entries to Playlist at run time.
I wanted to do it in a more logical way, by adding a button on the form that creates my Custom Object to add a new entry, but I do not know how to do it? (The S_Controls appear on the records, rather than at the point where you are creating a new instance). Would need some guidance in that as well.
So I have simply entered a new Text field, and asked the user to enter a value. Now I want to enter this value to a PlayList. For instance, when I use the IF statement, to check if the LEN of the text box is greater than 0, I should assign the textbox value to the playlist, but I get a syntax error.
What I am trying to do is Work_item_c = work_item_text_c ... where work_item is a playlist, and it tells me that I cannot use the playlist like this.
Kindly guide me here.
Thanks
-
- Saania
- June 19, 2007
- Like
- 0
- Continue reading or reply
Query for All accounts with Client ID and (opportunity stage 6 or Client ID)
Hello,
I am trying to get my query to only return Accounts that have a client Id as well as opportunities that are in stage 6 or have a client id.
This is what I have so far:
Select a.Website, a.Sub_Status__c, a.Status__c, a.Official_Name__c, a.Name, a.Industry, a.Id, a.Client_ID__c,
(Select o.Id, o.Name, o.StageName, o.AccountId From Opportunities o Where o.StageName = '6 - Closed/Won' Or o.Account.Client_ID__c != NULL ),
a.Business_Unit__c, a.BillingStreet, a.BillingState, a.BillingPostalCode, a.BillingCountry, a.BillingCity,
a.D_U_N_S__c, a.Tax_Number__c, a.Owner.Name, a.Owner.EmployeeNumber, a.Company_Reg__c, a.Channel_Owner__c From Account a
The above returns me all of the accounts for our company and joins the opportunities that are either stage 6 or have a client id.
What I need the query to do is return only Accounts with a client ID as well as Accounts that have an opportunity in Stage 6 or opportunities that have a client ID.
If I add a where clause at the end of the main select such as WHERE a.Client_ID__c !=NULL, I get all the accounts that have client ids but I miss the accounts that have an opportunity in stage 6 that don't have a client ID.
I am really hoping someone out here can help me out.
Thank you,
- lashak
- January 26, 2010
- Like
- 0
- Continue reading or reply
Help with a SOQL statement.
I am trying to do a nested SOQL statement. I want to have a query that I order by descending to find the biggest number and then use that number to only find the records with that number. So one part of the nested query will find the largest number and then I will use that number to show only the records that have number.
I can find the value with this query
Select Height__c
from Person__c
Order By Height__c desc limit 1
Just wondering if i can get this value to compare the rest of the records and display the results thanks.
Thanks
- intern2424
- November 02, 2009
- Like
- 0
- Continue reading or reply
CANNOT_INSERT_UPDATE_ACTIVATE_ENTITY : Entity type cannot be inserted: Campaign
I am getting the error specified as the subject when i create a Campaign in VC#. There is no issue of access rights in this case for sure, since I am the System Administrator.
The code is pretty simple. I just create a Campaign object, and call binding.create method with the campaign object as an sObject array. The binding is correct, because I am using it to query the Campaign object earlier as well, that returns correct results
Thanks,
- Saania
- October 14, 2008
- Like
- 0
- Continue reading or reply
Getting 'EXCEEDED_ID_LIMIT: record limit reached' error on binding.create()
I am creating a piece of code that adds campaign members to selected campaign via a UI in VC#.
the Campaign can have many members (obviously more than 200 in most cases), when I use binding.create() method to create an instance (or even an array) of CampaignMember object(s), I get an error ...
'EXCEEDED_ID_LIMIT: record limit reached. cannot submit more than 200 records'
Any suggestion for a work around would definately help.
Thanks,
- Saania
- October 09, 2008
- Like
- 0
- Continue reading or reply
Error during ant deploy/delete.
I am trying to update an already exiting trigger in production. I have done the 'ant deploy' procedure several times earlier as well, but this time I am getting this error:
On ant deploy: Failed to login: Unable to serialize property of 'classes' on type common.api.soap.wsdl.CompileandTestResult.
and On ant delete:Failed to login: Unable to serialize property of 'runstestsresults' on type common.api.soap.wsdl.CompileandTestResult.
Thanks.
- Saania
- September 30, 2008
- Like
- 0
- Continue reading or reply
Is there any way to get current date and time as per the logged in user time zone in apex?
Hi,
Is there any way to get current date and time as per the logged in user time zone in apex?
I used System.now(), but its returning as per GMT time zone.
I need it as per the user time zone.Like if logged in use time zone is Singapore time zone then it should return current time and date as per the Singapore time zone which is GMT+8, not as per the GMT time zone.
Thanks and Regards,
Rajan Jasuja
- RajanJasuja
- September 11, 2008
- Like
- 0
- Continue reading or reply
Update Account Sample not working
//create the account object to hold our changes
sforce.sObject updateAccount = new sforce.sObject();
//need to have the id so that API knows which account to update
//set a new value for the name property
updateAccount.Id = "0016000000hkyAAN";
System.Xml.XmlDocument doc = new System.Xml.XmlDocument();
System.Xml.XmlElement nameElement = doc.Xml.XmlElement("Name");
nameElement.InnerText = "New Account Name from Update Sample";
updateAccount.Any = new System.Xml.XmlElement[] { nameElement };
updateAccount.type = "Account";
sforceP.SforceService binding = Utility.GetPartnerBinding (this.Context);
//call the update passing an array of object
sforce.SaveResult[] saveResults = binding.update(new sforceP.sObject[] { updateAccount });
System.Xml.XmlDocument doc does not have a member doc.Xml.XmlElement
Can somebody advise
many thanks
- Sorn1
- June 27, 2008
- Like
- 0
- Continue reading or reply
EXIST statement equivalent in SOQL
The statement I want to execute is ... 'Clients that did not have a sale last FY, but did buy a product in last 3 years'.
That is, if a client bought a product in FY 2005, but not in FY 2007 (which was the previous FY), I want the client to show up in the list.
In my SQL Server table, we were using the DISTINCT and EXIST statements to retrieve such clients. The clients were matched on the products they bought and the fice(a unique id for the client). But the allsls (All Sales) table can have multiple entries for the same fice and product, for a given client.
In SOQL since these statements are not available, how to accomplish this?
The SQL statement is as:
SELECT distinct sc.fice, sc.state, sc.product FROM dbo.allsls AS sc (NOLOCK) WHERE sc.trxdate BETWEEN '07/01/2004' AND '06/30/2006' -- Colleges bought 3 to 4 FY ago (2005-2006) (i.e. not last FY year, but last 3) AND NOT EXISTS (SELECT t1.product FROM dbo.allsls as t1 (NOLOCK) WHERE t1.product = sc.product AND t1.fice = sc.fice AND t1.trxdate BETWEEN '07/01/2006' AND '06/30/2008' -- Didn't buy current FY (2008) or prev FY (2007) )
I would definately appreciate any help to solve this query.
Thanks,
- Saania
- May 12, 2008
- Like
- 0
- Continue reading or reply
Import functionality for files
I want to know whether we can implement the Import functionality in Apex like Salseforce.com has
provided for importing data from xls files.
If yes what are the available ways to get local machine file contents in Salesforce.com? Are there any APIs
in Salesforce.com to read buffer data from remote client or it uses HTTP to transfer data?
Any pointers in the regard will be helpful.
Thanks in advance.
- Maddy123
- May 12, 2008
- Like
- 0
- Continue reading or reply
workflow between objects
I'm trying to create a workflow rule that will update a field in an assoicated object.
Basically, I have an object called album.
This album has a payment, but occassionally the album can't be produced, so we need the customer to create a second album. Seeing as they've already paid for the first album, they don't pay for the second album.
The payment stays associated with the first album, and because the first album can't be produced, the payment will remain as 'unfulfilled'.
I'm trying to create a workflow rule that will update the first album as being completed, when the second album is completed.
This way we can determine whether the payment has been honoured and we don't owe any product for the initial payment.
I've tried creating a look-up relationship between the two album objects (custom object), but this doesn't seem to work as I can't update a field in the first album based on a field in the second album.
I've also tried creating a credit custom object that essentially transfers the payment between the two albums, but this won't work either.
I'm using Salesforce Enterprise Edition.
Any help or advice would be great
thanks
Message Edited by nicksquash on 03-17-2008 03:41 PM
- nicksquash
- March 17, 2008
- Like
- 0
- Continue reading or reply
Not like in SOQL
- manas.de
- May 08, 2007
- Like
- 0
- Continue reading or reply
Time Based Workflow Question: Time based rule evaluation?
- Xiidaen
- March 08, 2007
- Like
- 0
- Continue reading or reply