• KamsR_DEV
  • NEWBIE
  • 35 Points
  • Member since 2013

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

Dear Friends,

 

I have a problem to which i am not able to figure out a solution since long. I am hoping you guys would be able to shed some light on this. So here goes.

 

I have a apex page which has a look-up field to a custom object called DunsID. Here's a look:

 

[IMG]http://i40.tinypic.com/2en4xsm.jpg[/IMG]

 

Now, the DUNS ID is a number which can be searched. If i just click on the magnifing glass, all the results are returned Like follows :

 

[IMG]http://i44.tinypic.com/29pbsxh.jpg[/IMG]

 

 

When i search with a string or a part of a string for DUNS ID, i get the following results as such :

 

[IMG]http://i43.tinypic.com/otewk5.jpg[/IMG]

 

But i want to be able to search by typing in the CP Name instead of the DUNS ID, like if i type in Talk* or TalkTalk, the above resuts should be returned. But when i try doing the same, no results are shown, like follows:

 

[IMG]http://i44.tinypic.com/2it0gas.jpg[/IMG]

 

Could you guys please give me a way to do so??

 

Thanks and regards,

Surya Teja

  • September 30, 2013
  • Like
  • 0

Hi,

 

I'm in need of integrating QB with Salesforce using Apex code. For that, I have created a IPP account for Quickbooks API and created authendication between Quickbooks Online and intermediate application.

 

This Quickbooks API is used to integrate the Quickbooks Online and Salesforce through a custom Apex code and not to depend on any other third-party tool.

 

So, anyone help me how to call the response from the Quickbooks API to Salesforce through Apex code.

I searched may blogs and so, but I need the endurl to connect the QB API and SF.

 

If anybody used the same method to create apex callout to get the response from the QB API, it will be very useful.

 

 

Thanks in Advance,

Kamatchi Devi

 

 

Hi,

 

I'm in need of integrating QB with Salesforce using Apex code. For that, I have created a IPP account for Quickbooks API and created authendication between Quickbooks Online and intermediate application.

 

This Quickbooks API is used to integrate the Quickbooks Online and Salesforce through a custom Apex code and not to depend on any other third-party tool.

 

So, anyone help me how to call the response from the Quickbooks API to Salesforce through Apex code.

I searched may blogs and so, but I need the endurl to connect the QB API and SF.

 

If anybody used the same method to create apex callout to get the response from the QB API, it will be very useful.

 

 

Thanks in Advance,

Kamatchi Devi

 

 

Hi,

 

I have a custom setting in which I have about 4 field's api names.

 

Now, based on some logic, I would have to update one of the fields with a value, so I would know the field name only in run time, so how do I write the code for it in Apex ?

 

Sample code

----------------

 

List<AuditObjects__c> lstObj = [select ObjectName__c,ObjectPrefix__c from AuditObjects__c where ObjectPrefix__c=:keyPrefix LIMIT 1];

 

String lookupRelationship = lstObj[0].ObjectName__c;


 auditRecord.lookupRelationship = recordId;  // This is where I want to dynamically bind the field name.

 

update auditRecord;

  • September 30, 2013
  • Like
  • 0

Dear Friends,

 

I have a problem to which i am not able to figure out a solution since long. I am hoping you guys would be able to shed some light on this. So here goes.

 

I have a apex page which has a look-up field to a custom object called DunsID. Here's a look:

 

[IMG]http://i40.tinypic.com/2en4xsm.jpg[/IMG]

 

Now, the DUNS ID is a number which can be searched. If i just click on the magnifing glass, all the results are returned Like follows :

 

[IMG]http://i44.tinypic.com/29pbsxh.jpg[/IMG]

 

 

When i search with a string or a part of a string for DUNS ID, i get the following results as such :

 

[IMG]http://i43.tinypic.com/otewk5.jpg[/IMG]

 

But i want to be able to search by typing in the CP Name instead of the DUNS ID, like if i type in Talk* or TalkTalk, the above resuts should be returned. But when i try doing the same, no results are shown, like follows:

 

[IMG]http://i44.tinypic.com/2it0gas.jpg[/IMG]

 

Could you guys please give me a way to do so??

 

Thanks and regards,

Surya Teja

  • September 30, 2013
  • Like
  • 0

how to get lists from 4 different unrelated sobject in one pageblocktable.pls help me

  • September 27, 2013
  • Like
  • 0

Hi all,

 

In Standara page there one picklist, based on the selecting picklist values we need to be display checkbox ? It should be happen in standard page ? is the possible ?

if not please provide any other suggestion ?

 

 

Thanks,

I have a simple trigger that works in the sandbox, does exactly what I want it to do. Cannot get code coverage above 40%.

I also do not know how to see what code is not covered. The test class below was pieced together from samples I found.

Any help would be appreciated!

 

Trigger:

 

trigger Pharmacy_Demo_Completed on Task (before insert){
   for (Task T : trigger.new){
      string TaskProfile = 'Implementation Director';
      string TaskSubject = t.subject;
      string TaskType = 'Send Contracts';
      if (TaskSubject == 'Pharmacy Demo Completed'){
          List <User> usr = [select Id from User where Profile.Name =:TaskProfile limit 1];
          system.debug (Usr.size());

          If (Usr.size() < 1){
             system.debug ('No entries found for ');}
                                       
          if (usr.size() > 0){
                User u = [select Id ,name from User where Profile.Name =:TaskProfile limit 1];
                t.ownerid = u.id;
                t.type = TaskType;}
      
}
}
}
Test Class: (Saves without error)

 

@isTest
public class Taskusertest2 {
    List<Task> insertedTasks = new List<Task>{};
    static testMethod void myUnitTest() {
    for(Integer i = 0; i < 100; i++)    
        {Task t = new Task();
            t.IsRecurrence = FALSE;
            t.sma__CreatedLocationVerified__c = FALSE;
            t.IsReminderSet = FALSE;
            t.MA_Clean_State__c = 'tx';
            t.Subject = 'Testing';
            t.Type = 'Research';
            t.Priority = 'Normal';
            t.Description = 'Task Class Test';
            t.Status__c = 'Demo Scheduled';
            t.Status = 'Completed';
        insert t;}
        
         List<Task> insertedTasks = [SELECT Description
                                                FROM Task
                                                WHERE Status = 'Demo Scheduled'];
         {for(Task t : insertedTasks)
          System.assertEquals(
          'This Task is probably left over from testing. It should probably be deleted.',
          t.Description);}
        
    }}

 

I am getting this error "value for <apex:outputField> is not a dynamic binding!" on my VFP and not sure why. I read somewhere on forumns that this can be caused potentially by multi-currency being enabled, which I do have on but I'm not 100% sure that has anything to do with it.

 

VFP:

 

<apex:page controller="listorgs">

    <apex:form >
    
        <Apex:pageblock >

            <apex:pageblockTable value="{!newlist}" var="obj">
                <apex:column >
                    <Apex:outputfield value="obj.name"/>
                </apex:column>
            </apex:pageblockTable>
        </Apex:pageblock>
        
    </apex:form>
    
</apex:page>

 

Controlling class:

 

Public class listorgs
    implements iterator<org__c>{
        public static List<org__c> newlist {get; set;}
        Integer i {get; set;}
        
        public listorgs(){
            newlist = [select id, name from org__c];
            i = 0;
                }
        Public boolean hasnext(){
            if(i>= newlist.size()){
                return false;
            } else {
                return true;
            }
        }
        Public Org__c next(){
            if(i==100){return null;}
            i++;
            return newlist[i-1];
        }
}

    

 

Thanks to anyone who can help!

 

I have a custom object that I am trying to execute a trigger on after insert, update, and delete.   The trigger functions as expected for the insert and update cases, but I'm getting an error when trying to execute it after delete (I tried changing to before delete as well, and got the same error).

The trigger is below.  I get the error at line "for (MyObject thisObject : System.Trigger.new) {", so I imagine my syntax must be incorrect here for the "delete" case.  However, I've had difficulty finding an example to refer to in the Force.com Cookbook or by searching Salesforce.com.  Any insight would be appreciated.

Here is my trigger:

trigger MyTrigger on MyObject (after insert, after update, after delete) {

    Map<String, MyObject> soMap = new Map<String, MyObject>();

    for (MyObject thisObject : System.Trigger.new) {
        Decimal Total = 0;
        Long Count = 0;

        // First, check for records meeting criteria A
        for (MyObject obj : [ SELECT Amount from MyObject where Account__c = :thisObject.Account__c  and fieldA = 'A']) {
            // sum the amounts
            Total += obj.Amount;
            Count++;
        }           
   
        // if no records exist, look for criteria B
        if (Count == 0) {
            for (MyObject obj : [ SELECT Amount from MyObject where fieldA = 'B' and CreatedDate = LAST_N_DAYS:365 AND Account__c = :thisObject.Account__c  ]) {
                // total the amounts
                Total += obj.Amount;
            }           
           
            // get 50% of the total
            Total = 0.5 * Total;
        }      

        // update value
        for (Account a : [select id from Account where id = :thisObject.Account__c]) {
            a.customField = Total;
            update a;
        }
    }
}