• lodoss118
  • NEWBIE
  • 0 Points
  • Member since 2007

  • Chatter
    Feed
  • 0
    Best Answers
  • 0
    Likes Received
  • 0
    Likes Given
  • 33
    Questions
  • 28
    Replies
I want to create my own admin area where i can mass disable these validation rules if necessary??
How can i trigger a timeflow workflow again once it has done osmething already for example i have a time flow trigger to update a field in which my apex script does something to that record but how do i keep looping this?
Is there anyway i can program a time workflow in apex?
Hi how do i get the workitemid of the approval instance if already submitted manually?
can it for example update more than 5k accounts etc in batches
Hi i have a apex script which escalates a case for approval to the next department if the previous department does not do anything
now the solution i thought i could do this is have a flag that gets sets by a time trigger workflow which sets this flag on the case and thus my before
update apex trigger will execute but it does not, i really want a easy solution i.e. as i am not the best programmer but have skillzz.
Hi i have a custom object called sales order now i want to find out all the sales orders that have a note or attachment

i done this but i am not sure how to define to only show if there is an attachment or note

Select s.Id, (Select Id, ParentId From Notes), (Select Id, ParentId From Attachments) From SCRB_SalesOrder__c s

????

this doesn't work?

Select s.Id, (Select Id, ParentId From Notes Where Id != null),
(Select Id, ParentId From Attachments Where Id != null) From SCRB_SalesOrder__c s


Hi is there any tutorials or articles in which shows how you can use apex to communicate with other apis?
Hi guys i am using javascript to reassign an approval to someone else but i am having problems getting the workitemitds i am confused on what methods i can call on these two objects in javascript


var rDate = new Date();
                rDate.setDate(rDate.getDate() + 2);       
                CreateTask("00520000000tKm3", "IS IN SALES - SENIOR MANAGER", "SUP SUP", rDate, "High");
                UpdateCaseStage("Senior Manager");
               
                var request = new sforce.ProcessSubmitRequest();
                request.objectId = "{!Case.Id}";
                request.comments = "Test Process Submit Request";
                var processRequest = sforce.connection.process([request]);
                //alert(processRequest);
           
                var record = new Array();
                record[0] = processRequest[0];
                alert(record[0].success);
               
                /*var workItem = new sforce.ProcessWorkitemRequest();
                workItem.action = "Approve";
                workItem.workitemId = "04aT00000008POi";
                workItem.nextApproverIds = "00520000000sbtx";
                workItem.comments = "Assigned to Senior Manager";
                var processWorkItem = sforce.connection.process([workItem]);
                alert(processWorkItem);*/


What i am trying to do is get the workItemId from processRequest object but having no go help pls?
Hi i am using the CronJob tool from the appxexchange and i am getting the error too many dml rows 101 here is the code that the batch run trigger runs

public class SalesOrderBatchRun
{
    private static final List<SCRB_SalesOrder__c> findOrders = new List<SCRB_SalesOrder__c>([Select
           Id, Name, Description__c, Approved_Date__c, StatusCode__c From SCRB_SalesOrder__c
               Limit 100]);
              
    public static String updateOrderDescription()
    {
        String orderId = '';
       
        try
        {       
            for(SCRB_SalesOrder__c batch : findOrders)
            {
                batch.Description__c = '---- UPDATED IN APEX SCRIPT FROM BATCH SCHEDULER ----';
                orderId = batch.Id;
            }
           
            update findOrders;
           
        }catch(System.DmlException e)
        {
            System.debug('#### DML EXCEPTION ####:' + e.getMessage());
            return 'Updated Description: FAILED';
        }
       
        return 'Updated Description: SUCCESS' + ': ' + orderId;
    }
}

And in the batch script i put this

 if (batchRun.cron__Batch_Job_Name__c == 'Update Order Description') {
                error = false;
                results = ''
                SalesOrderBatchRun.updateOrderDescription();
    }


why is this happening, this sucks :(....



How can one do this using apex code for example i have a list of accounts more than 200 how do i split these into batch jobs?
Can anyone give an example how i would batch update loads of records in apex?

for example say i have a query that returns like 10k accounts and i want to update a field on all those accounts how would i update those accounts in apex code?
Hi i have added an scontrol in a new layout section in the page layout settings. What i want to do is to hide/show this whole section how can i do this
Hi what i have done is shown a list products in a page using the pageblockTable tag what i want to do is add checkboxes to each row of the table next to the product name how can i do this?
can a Visualforce page be loaded on a page layout like an scontrol?

I just want to show an extra section which list products in a case?
what does the limit for script statements mean can anyone give me example how would end up in this limit seems abit funny as i have some very long code :)       :)       :)
Hi i was wondering how do you package approval processes i didn't see them in the add drop down list?
i tried product2Id, productId but i still can;t access it, it says it is a invalid field i.e.


item1.ProductId = '12312312313312';
item1.product2 = '123213213213';
item.product2Id = '123123123';


none of these work?????
i see a table for workflow rules but not validation rules?
I.e in accounts using apex i can do

Account a;

a.Owner.UserRoleId;

In my trigger before insert this field is always null or the owner object is always null why is that?

for(Account a : trigger.new) {
   a.Owner.userRoleId; //this is always null do i have to use an SOQL statement or something.
}
can it for example update more than 5k accounts etc in batches
Hi is there any tutorials or articles in which shows how you can use apex to communicate with other apis?
Hi i am using the CronJob tool from the appxexchange and i am getting the error too many dml rows 101 here is the code that the batch run trigger runs

public class SalesOrderBatchRun
{
    private static final List<SCRB_SalesOrder__c> findOrders = new List<SCRB_SalesOrder__c>([Select
           Id, Name, Description__c, Approved_Date__c, StatusCode__c From SCRB_SalesOrder__c
               Limit 100]);
              
    public static String updateOrderDescription()
    {
        String orderId = '';
       
        try
        {       
            for(SCRB_SalesOrder__c batch : findOrders)
            {
                batch.Description__c = '---- UPDATED IN APEX SCRIPT FROM BATCH SCHEDULER ----';
                orderId = batch.Id;
            }
           
            update findOrders;
           
        }catch(System.DmlException e)
        {
            System.debug('#### DML EXCEPTION ####:' + e.getMessage());
            return 'Updated Description: FAILED';
        }
       
        return 'Updated Description: SUCCESS' + ': ' + orderId;
    }
}

And in the batch script i put this

 if (batchRun.cron__Batch_Job_Name__c == 'Update Order Description') {
                error = false;
                results = ''
                SalesOrderBatchRun.updateOrderDescription();
    }


why is this happening, this sucks :(....



Hi,

I want to call Yahoo web service through REST protocol from my apex code.

I am using following example given in apex language reference guide. I have just replaced my url in the code.

public class HttpCalloutSample {
// Pass in the endpoint to be used using the string url
public String getContent() {
// Instantiate a new http object
Http h = new Http();
// Instantiate a new HTTP request, specify the method (GET) as well as the endpoint
HttpRequest req = new HttpRequest();
String url = 'http://travel.yahooapis.com/TripService/V1.1/tripSearch?appid=YahooDemo';
req.setEndpoint(url);
req.setMethod('GET');
// Send the request, and return a response
HttpResponse res = h.send(req);
return res.getBody();
}
}

I am calling following line from my S-Control (in my javascript function)
var success = sforce.apex.execute("HttpCalloutSample", "getContent", {});

I am getting following exception.

faultcode soapenv:Client
faultstring No operation available for request {http://soap.sforce.com/schemas/package/HttpCalloutSample}getContent, please check the WSDL for the service.

So what is the problem? Is it a right way?
Does anyone have any example code or syntax show how I would make that call?

Thanks
Hi what i have done is shown a list products in a page using the pageblockTable tag what i want to do is add checkboxes to each row of the table next to the product name how can i do this?
what does the limit for script statements mean can anyone give me example how would end up in this limit seems abit funny as i have some very long code :)       :)       :)
Hi i was wondering how do you package approval processes i didn't see them in the add drop down list?
i tried product2Id, productId but i still can;t access it, it says it is a invalid field i.e.


item1.ProductId = '12312312313312';
item1.product2 = '123213213213';
item.product2Id = '123123123';


none of these work?????
I.e in accounts using apex i can do

Account a;

a.Owner.UserRoleId;

In my trigger before insert this field is always null or the owner object is always null why is that?

for(Account a : trigger.new) {
   a.Owner.userRoleId; //this is always null do i have to use an SOQL statement or something.
}
Hi i am having problems in getting the account owner user role id, i was trying to do this but it is wrong from the relationship query?

Didn't understand relationship 'User__r' in FROM part of query call

:'(

public static void Find_User(Account[] b)
{
   try {

             for(Account a : [select Id, PostCode_Area__c, (select Id, Name, UserRoleId,
                          Working_Area__c from User where Id = :b.OwnerId)
                                  from Account where Id = :b.Id])  {
             }

       }
}