• Micky M
  • NEWBIE
  • 220 Points
  • Member since 2011

  • Chatter
    Feed
  • 8
    Best Answers
  • 2
    Likes Received
  • 0
    Likes Given
  • 75
    Questions
  • 101
    Replies
Hi all,

Does anyone know how to find what object a validation rule is on? so im getting an error 'FIELD_CUSTOM_VALIDATION_EXCEPTION, Please update etc' but is there a way i can search all object validtion rules to find where this is?

Thanks
Hi all,

I have a problem where i have to compare two lists, however each list will be over 50,000 records at some point, does anyone know the best way to go about this? im a bit stumped as i dont want to start bumping into govenor limits and all that stuff. Any ideas would be great thx!
Hi All,

Does anyone know how when i get a list of obects back from a remote call i can assign this to be used in a datatable, so if in javascript ive got something like 

var myList = [];

for(some loop or other)
   myList.push(results[n];

how if at all can i get {!accounts} assigned to the value of myList? is that even possible? im new to javascript remoting.

<apex:dataList value="{!accounts}" var="account">
    <apex:outputText value="{!account.Name}"/>
</apex:dataList>

Thanks
Hi all does anyone know why this class 

public class staticFlagsForRecursionTriggers 
{
    public static boolean firstRun = true;
}

Can't be seen by my trigger when i call a controller from a visual force page?

the trigger is :

if(trigger.isAfter && (trigger.isInsert || trigger.isUpdate) && staticFlagsForRecursionTriggers.firstRun == TRUE)
    {
        handler.calculateTotals(Trigger.new);
        staticFlagsForRecursionTriggers.firstRun = FALSE;
    } 

staticFlagsForRecursionTriggers.firstRun is always false so the trigger isnt running.

Thanks
Hi All, 

I have a problem, where im calling a method in a controller from a button on a visual force page. The controller updates some records but the trigger that i have which is an after update doesnt fire (well acutally it seems like its firing at random there are a good few hundred records) has anyone else had this problem and know how to solve the issue? thanks.
Hi all does anyone know how i can override oppitm/multilineitem.jsp ? i need to display different fields based on the opportunity record type.

i can get to the layout from Customize->Opportunities->Opportunity Products->Page Layouts then edit the layout and select "Edit Multi-Line layout" but how on earth do i override this screen?

Thanks
 
Hi all, does anyone know how i override the mini page layout of an opportunity product? i need to display different fields depending on what record type the opportunity is. I was going to do this with a visual force page but dont know where to override it.

Thanks 
Hi all, is it possible to use an opporunity line item as a master object in a master detail relationship, i want something like:

Opp lineitem
      Opp lineitem breakdown

thanks
Hi all, im using mavensmate and i want to edit the metadata associated with email alerts but i cant see what this is in the list of metadata im presented with, the only mention of email is for email templates. Has anyone else used this?

Thanks. 
Hi all i have two objects related via a lookup up and depending on the value of one i want to update whats happening on the other via apex my code looks like :

InvoiceBreakdowns = [SELECT  Contract_Recurring_Service_Breakdown__r.Breakdown_Accrual__c, Band_Quantity__c, Banding_Total__c, Billing_Term__c, Break_Down_Type__c, Contract_Recurring_Service_Breakdown__r.Hold_Date__c, Contract_Recurring_Service_Breakdown__r.Breakdown_Hold_Value__c, End_Date__c, Id, Invoice_Date__c, MCS_Contract_Invoice_Line_Item__c, Metric__c, Name, Committed__c, Contract_Recurring_Service_Breakdown__r.Id, Start_Date__c, Start_Quantity__c,  Unit_Sell_Price__c, CreatedDate, Unbilled_Usage__c, Contract_Recurring_Service_Breakdown__c from MCS_Contract_Invoice_Line_Item_Breakdown__c Where CreatedDate >= :fromMidnight];

for(MCS_Contract_Invoice_Line_Item_Breakdown__c b : InvoiceBreakdowns)
        {

            //Is the breakdown billed this month? if it is then do all this lot
            if(InvoiceDate.Month() == system.today().month() &&  InvoiceDate.Year() == system.today().year())
            {
                //Check each value to make sure its not null as that blows everything up.
                Decimal ContractBreakdownAccrual = b.Contract_Recurring_Service_Breakdown__r.Breakdown_Accrual__c == null ? 0 : b.Contract_Recurring_Service_Breakdown__r.Breakdown_Accrual__c;
                Decimal Unbilled_Usage = b.Unbilled_Usage__c == null ? 0 : b.Unbilled_Usage__c;
                Decimal Banding_Total = b.Banding_Total__c == null ? 0 : b.Banding_Total__c;

                //add the contract accrual to the banding total.
                b.Banding_Total__c  =  Banding_Total + ContractBreakdownAccrual;

                //now set the accrual on the contract break down to zero
                if(b.Contract_Recurring_Service_Breakdown__c != null)
                {
                    System.debug('id = b.Contract_Recurring_Service_Breakdown__c = ' + b.Contract_Recurring_Service_Breakdown__c);
                    contractBreakdowns.add(new Contract_Recurring_Service_Breakdown__c(id = b.Contract_Recurring_Service_Breakdown__c, Breakdown_Accrual__c = 0));
                }
            }

does anyone know if there's a better way to update the field on the Contract_Recurring_Service_Breakdown__c object rather than do :

contractBreakdowns.add(new Contract_Recurring_Service_Breakdown__c(id = b.Contract_Recurring_Service_Breakdown__c, Breakdown_Accrual__c = 0));

and then run an update? as on a kinda related note this list is ending up with duplicate id's as there are a few breakdowns looking at the contract breakdown.

Thanks All
Hi all im trying to test if the value coming back from a map is null, the key to my map is a string and the value is a list of object, when this bit of code runs :

for(String key : finalFlexBanding.KeySet())
{
  MCS_Opportunity_RS_Line_Item_Import__c l = finalFlexBanding.get(key);

  Decimal minValue = minValues.get(Key);
  System.debug('flex processing bit : minValue = ' + minValue);

  if(minValue == null)
   minValue = 0;

  Opportunity_Recurring_Service_Breakdown__c tempBreakdown = new Opportunity_Recurring_Service_Breakdown__c(Break_Down_Type__c = l.Minimum_or_Flexible__c == 'M' ? 'Minimum Commit' : l.Minimum_or_Flexible__c == 'F' ? 'Flexible' : 'Range', Start_Quantity__c = minValue, End_Quantity__c = l.Quantity__c, Group_Number__c = l.Grouping__c, Metric__c = l.Charging_Metric__c, Unit_Sell_Price__c = l.Unit_Sell_Price__c);
 
  //add it to the map based on grouping
  System.debug('breakdownMap before null test = ' + breakdownMap);
  List<Opportunity_Recurring_Service_Breakdown__c> test = test = breakdownMap.get(Key);

  System.debug('IS TEST NULL? = ' + test);

  if(test == null)
  {
   System.debug('In the null bit ...... ');
   breakdownMap.put(key, new list<Opportunity_Recurring_Service_Breakdown__c>());
  }
  breakdownMap.get(Key).add(tempBreakdown); 
}

if wont go into the condition if(test == null), i have noticed in the debug logs is says the value is (null) rather than null, i dont know if that means anything. Does anyone know whats going on here? Thanks!!!
  • September 09, 2014
  • Like
  • 0
Hi clever people,

does anyone know if its possible to "Re-point" a roll up field to another object? we have some rollups that summerise a certain object and i want to edit the rollup to summerise a different object. Basically so i dont have to change a load of reports to use any new fields.

Thanks

Hi all, i have this code written in java, ive used java -classpath wsc-23.jar com.sforce.ws.tools.wsdlc MyTestWebMethod.wsdl MyTestWebMethod.jar to create my enterprise and apex class jar and added those to the project. I run this ..

public class QuckSoapTest
{
EnterpriseConnection connection;
ConnectorConfig config = new ConnectorConfig();
String UserName = "soapuser@proact.co.uk.developer";
String Password = "Password12345";

public static void main(String[] args)
{
  new QuckSoapTest().go();
}

public void go()
{
  try
  {
   config.setUsername(UserName);
   config.setPassword(Password);
   connection = Connector.newConnection(config);
  
   System.out.println("Auth Endpoint " + config.getAuthEndpoint());
   System.out.println("Service Endpoint " + config.getServiceEndpoint());
  
   com.sforce.soap.MyTestWebMethod.SoapConnection soap = new com.sforce.soap.MyTestWebMethod.SoapConnection(config);
   soap.setSessionHeader(config.getSessionId());
  
   System.out.println(soap.MyTestWebMethod());
  }
  catch (ConnectionException e)
  {
   e.printStackTrace();
  }
}
}

and i get this error :

Auth Endpoint https://test.salesforce.com/services/Soap/c/31.0/0DFM00000004D7r
Service Endpoint https://cs7.salesforce.com/services/Soap/c/31.0/00DM00000009BGt/0DFM00000004D7r
com.sforce.ws.SoapFaultException: No operation available for request {http://soap.sforce.com/schemas/class/MyTestWebMethod}MyTestWebMethod
at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:204)
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:148)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:110)
at com.sforce.soap.MyTestWebMethod.SoapConnection.MyTestWebMethod(SoapConnection.java:177)
at quickSoapTest.QuckSoapTest.go(QuckSoapTest.java:34)
at quickSoapTest.QuckSoapTest.main(QuckSoapTest.java:17)

Does anyone have any idea what im doing wrong as im slowly going insane!!! thanks all.
Hi all,

Could anyone help me, i need to call a salesforce web method from java, ive got the code to connect to salesfroce and ive genterated the jars from my wsdl's using wsc. So im at the point where i can connect and run soql statements against salesforce and get results back and process them. But i need to be able to call a web method directly rather than run soql. Does anyone have any code to do this?

Thanks
Hi all im trying to get the value of a picklist from an array of rows on a vf page so i have something like

select list 1
   Some stuff
select list 2
   Some stuff
select list 3 
   Some stuff

so im using 

function calcBandingTotal(value)
            {
                var row = value.getElementsByTagName("td");
               
                var listvalue = row[2].getElementsByTagName("select")[0].value);


                var startQuantity = parseFloat(row[2].getElementsByTagName("input")[0].value);
                var endQuantity = parseFloat(row[3].getElementsByTagName("input")[0].value);
                var unitSellPrice = parseFloat(row[5].getElementsByTagName("input")[0].value);
                            
                var banding = endQuantity - startQuantity;
                var total = banding * unitSellPrice;
               
                //Banding total column        
                row[4].getElementsByTagName("span")[0].innerHTML = banding.toFixed(2);
               
                //Banding total column        
                row[6].getElementsByTagName("span")[0].innerHTML = "GBP " + total.toFixed(2);
            }


and its this line thats causing the problem 

var listvalue = row[2].getElementsByTagName("select")[0].value);

does anyone know how to do this?

Thanks

Hi all im trying to clone an opportunity product and found this : /{!OpportunityLineItem.Id}/e?clone=1&retURL={!OpportunityLineItem.Id} that you can use as a detail button on the product object. However when i save the clone i get this message: "You are missing information needed by the page you have attempted to access. If you believe this is an error, please refresh your screen. If the error persists, please report it to our Customer Support team and provide the URL of the page you were requesting as well as any other related information."

ive found a couple of posts about this but no one has a soluation, has anyone on here had the same thing? and if so did anyone manage to fix it?

Thanks
Hi all i have two objects linked via a lookup and i want to assign a value from object 1 to object 2

so

Project_Activity->Project_Order

no does anyone know how i can set the Project_Order.Effort to the same value as Project_Activity.effort so my formula is :

PO_Ref__r.Effort_From_Activity__c =  Effort__c

but this isnt setting a value its just a comparison. Does anyone know how or if this can be done?

Thanks
Hi all,

Does anyone know if its possible to get the contents of a visualforce input field so i can check it and throw a message to the page if need or just save it if its ok?

all i need to do is when the user created a new record just say is the quantity on this record the same as another quanitity, I cant use a validation rule as there are a list of these objects.

Thanks
Hi All,

I dont know if this is possible, i have a list of objects (line items) that im displaying on a vf page allowing the user to add new objects and what i need to do is ensure the a quantity on the newly added object matches a quantity on the parent object. Does anyone know if i can do this using a validation rule rather that a trigger?

So i have:

Parent Object Quantity 54
    line item 1 Quantity 0
    line item 2 Quantity 45
    line item 3 Quantity 54

so if line item 3 is the new obect and i need to test if this quanitity is the same as the parent quantity how would i do that with a validation rule .. if i can.

Thanks
Hi All,

I have a sheduled job that i need to debug, but where can i see system.debug output statements, and is it really only possible to run these jobs every hour?

Thanks
Hi all, im using mavensmate and i want to edit the metadata associated with email alerts but i cant see what this is in the list of metadata im presented with, the only mention of email is for email templates. Has anyone else used this?

Thanks. 

Hi guys, im not one for posting loads of code but im a bit stuck here. I have a custom object on an opportunity and that object has a sub object related via a master detail relationship. What i want to do is convert this opportunity objecs to contract objects. So i pull out all the opportunity line items and the related line item break downs. I loop though the line items creating new contract line items and that works fine, how ever the sub object cant be inserted as the id for the contract line item hasnt been created yet. Can anyone see how i can get around this ... thanks!

 

/Get all the Opportunity MCS recurring services with break down object attached to an opportunity.
List<MCS_Opportunity_Recurring_Service__c> mcso = [SELECT Id, Asset__c, Billing_Term__c, Charging_Metric__c, Contract_Term__c,
End_Date__c, Name, Opportunity__c, Quantity__c, Start_Date__c, Unit_Cost__c, Unit_Hard_Cost__c,
Unit_Price__c, Unit_Sales_Margin__c, Unit_Sell_Price__c, Unit_Soft_Cost__c,
(SELECT Start_Quantity__c,End_Quantity__c,Id,MCS_Recurring_Service_Breakdown__c,Break_Down_Type__c,
Customer_Allowance__c FROM Opportunity_Recurring_Service_Breakdown__r) FROM MCS_Opportunity_Recurring_Service__c
where Opportunity__c = :opportunityId and id in (select MCS_Recurring_Service_Breakdown__c
from Opportunity_Recurring_Service_Breakdown__c)];


List<MCS_Contract_Recurring_Service__c> mcsc = new List<MCS_Contract_Recurring_Service__c>();
map<id, List<Contract_Recurring_Service_Breakdown__c>> contractRecurringServiceWithBreakdowns = new map<id, List<Contract_Recurring_Service_Breakdown__c>>();
List<Contract_Recurring_Service_Breakdown__c> opportunityRecurringServiceBreakdownList = new List<Contract_Recurring_Service_Breakdown__c>();

//Get the related breakdown object attached to the Opportunity Recuring service and create a map
//using the service id as the key.
for(MCS_Opportunity_Recurring_Service__c o : mcso)
{
MCS_Contract_Recurring_Service__c temp = new MCS_Contract_Recurring_Service__c();

temp.Billing_Term__c = o.Billing_Term__c;
temp.Asset__c = o.Asset__c;

temp.Start_Date__c = o.Start_Date__c;
temp.End_Date__c = o.End_Date__c;

temp.Quantity__c = o.Quantity__c;
temp.Charging_Metric__c = o.Charging_Metric__c;

temp.Unit_Price__c = o.Unit_Price__c;
temp.Unit_Cost__c = o.Unit_Cost__c;

temp.Unit_Hard_Cost__c = o.Unit_Hard_Cost__c;
temp.Unit_Soft_Cost__c = o.Unit_Soft_Cost__c;

temp.Unit_Sell_Price__c = o.Unit_Sell_Price__c;
temp.Unit_Sales_Margin__c = o.Unit_Sales_Margin__c;

temp.contract__c = contractID;
mcsc.add(temp);


for(Opportunity_Recurring_Service_Breakdown__c orsb : o.Opportunity_Recurring_Service_Breakdown__r)
{
Contract_Recurring_Service_Breakdown__c tempContractBreakDown = new Contract_Recurring_Service_Breakdown__c();
tempContractBreakDown.End_Quantity__c = 1005;
tempContractBreakDown.MCS_Recurring_Service__c = temp.id;

opportunityRecurringServiceBreakdownList.add(tempContractBreakDown);
}
contractRecurringServiceWithBreakdowns.put(temp.id, opportunityRecurringServiceBreakdownList);
system.debug('temp.id =' + temp.id);
}
insert(mcsc);

system.debug('mcsc = ' + mcsc);
system.debug('contractRecurringServiceWithBreakdowns map = ' + contractRecurringServiceWithBreakdowns);

Hi all,

Does anyone know how to find what object a validation rule is on? so im getting an error 'FIELD_CUSTOM_VALIDATION_EXCEPTION, Please update etc' but is there a way i can search all object validtion rules to find where this is?

Thanks
Hi all,

I have a problem where i have to compare two lists, however each list will be over 50,000 records at some point, does anyone know the best way to go about this? im a bit stumped as i dont want to start bumping into govenor limits and all that stuff. Any ideas would be great thx!
Hi All,

Does anyone know how when i get a list of obects back from a remote call i can assign this to be used in a datatable, so if in javascript ive got something like 

var myList = [];

for(some loop or other)
   myList.push(results[n];

how if at all can i get {!accounts} assigned to the value of myList? is that even possible? im new to javascript remoting.

<apex:dataList value="{!accounts}" var="account">
    <apex:outputText value="{!account.Name}"/>
</apex:dataList>

Thanks
Hi all does anyone know why this class 

public class staticFlagsForRecursionTriggers 
{
    public static boolean firstRun = true;
}

Can't be seen by my trigger when i call a controller from a visual force page?

the trigger is :

if(trigger.isAfter && (trigger.isInsert || trigger.isUpdate) && staticFlagsForRecursionTriggers.firstRun == TRUE)
    {
        handler.calculateTotals(Trigger.new);
        staticFlagsForRecursionTriggers.firstRun = FALSE;
    } 

staticFlagsForRecursionTriggers.firstRun is always false so the trigger isnt running.

Thanks
Hi All, 

I have a problem, where im calling a method in a controller from a button on a visual force page. The controller updates some records but the trigger that i have which is an after update doesnt fire (well acutally it seems like its firing at random there are a good few hundred records) has anyone else had this problem and know how to solve the issue? thanks.
Hi all, does anyone know how i override the mini page layout of an opportunity product? i need to display different fields depending on what record type the opportunity is. I was going to do this with a visual force page but dont know where to override it.

Thanks 
Hi all, is it possible to use an opporunity line item as a master object in a master detail relationship, i want something like:

Opp lineitem
      Opp lineitem breakdown

thanks
Hi clever people,

does anyone know if its possible to "Re-point" a roll up field to another object? we have some rollups that summerise a certain object and i want to edit the rollup to summerise a different object. Basically so i dont have to change a load of reports to use any new fields.

Thanks

Hi all, i have this code written in java, ive used java -classpath wsc-23.jar com.sforce.ws.tools.wsdlc MyTestWebMethod.wsdl MyTestWebMethod.jar to create my enterprise and apex class jar and added those to the project. I run this ..

public class QuckSoapTest
{
EnterpriseConnection connection;
ConnectorConfig config = new ConnectorConfig();
String UserName = "soapuser@proact.co.uk.developer";
String Password = "Password12345";

public static void main(String[] args)
{
  new QuckSoapTest().go();
}

public void go()
{
  try
  {
   config.setUsername(UserName);
   config.setPassword(Password);
   connection = Connector.newConnection(config);
  
   System.out.println("Auth Endpoint " + config.getAuthEndpoint());
   System.out.println("Service Endpoint " + config.getServiceEndpoint());
  
   com.sforce.soap.MyTestWebMethod.SoapConnection soap = new com.sforce.soap.MyTestWebMethod.SoapConnection(config);
   soap.setSessionHeader(config.getSessionId());
  
   System.out.println(soap.MyTestWebMethod());
  }
  catch (ConnectionException e)
  {
   e.printStackTrace();
  }
}
}

and i get this error :

Auth Endpoint https://test.salesforce.com/services/Soap/c/31.0/0DFM00000004D7r
Service Endpoint https://cs7.salesforce.com/services/Soap/c/31.0/00DM00000009BGt/0DFM00000004D7r
com.sforce.ws.SoapFaultException: No operation available for request {http://soap.sforce.com/schemas/class/MyTestWebMethod}MyTestWebMethod
at com.sforce.ws.transport.SoapConnection.createException(SoapConnection.java:204)
at com.sforce.ws.transport.SoapConnection.receive(SoapConnection.java:148)
at com.sforce.ws.transport.SoapConnection.send(SoapConnection.java:110)
at com.sforce.soap.MyTestWebMethod.SoapConnection.MyTestWebMethod(SoapConnection.java:177)
at quickSoapTest.QuckSoapTest.go(QuckSoapTest.java:34)
at quickSoapTest.QuckSoapTest.main(QuckSoapTest.java:17)

Does anyone have any idea what im doing wrong as im slowly going insane!!! thanks all.
Hi all,

Could anyone help me, i need to call a salesforce web method from java, ive got the code to connect to salesfroce and ive genterated the jars from my wsdl's using wsc. So im at the point where i can connect and run soql statements against salesforce and get results back and process them. But i need to be able to call a web method directly rather than run soql. Does anyone have any code to do this?

Thanks