Friday 3 July 2015

Custom PTGL process

Blackbaud CRM 
I had a scenario from one my client that in custom Post to GL process, they want those rows not included in the csv file which contains Zero amount. This can be easily achievable if we have custom class running behind PTGL process which would be calling via Javascript file. But my client only had custom Query view and nothing else and they downloaded their Post to GL file using OOB download file. So that was the problem which i was facing. So, i ran the SQL pro-filer and found one OOB SQL function which solved my issue. That function is called "UFN_POSTTOGLPROCESS_CUSTOMIZE". The original body of this function is

CREATE function [dbo].[UFN_POSTTOGLPROCESS_CUSTOMIZE]   
    (@InRecords UDT_GENERICIDANDBIT readonly, @ID uniqueidentifier)   
    returns @WORKTABLE table   
     (   
     GLTRANSACTIONID uniqueidentifier   
     )      
    with execute as caller   
    as   
    begin   
    /* Products - DO NOT EDIT THIS FUNCTION!  It is only for users to customize their post process*/   
    /* This is a default that just returns the input records */   
       
    insert into @WORKTABLE (GLTRANSACTIONID)   
    select ID from @InRecords   
   
    return   
    end    

So if you analyze above SQL function which is OOB, it only selects all the transaction and return those via table. So I picked that SQL function and alter this SQL function and written my custom logic

ALTER  function [dbo].[UFN_POSTTOGLPROCESS_CUSTOMIZE] 
    (@InRecords UDT_GENERICIDANDBIT readonly, @ID uniqueidentifier) 
    returns @WORKTABLE table 
     ( 
     GLTRANSACTIONID uniqueidentifier 
     )    
    with execute as caller 
    as 
    begin 
    /* Products - DO NOT EDIT THIS FUNCTION!  It is only for users to customize their post process*/ 
    /* This is a default that just returns the input records */ 
   
                insert into @WORKTABLE (GLTRANSACTIONID) 
             select ID from @InRecords  R
                where R.ID in (select ID from GLTRANSACTION where ID = R.ID and AMOUNT <> 0)
                 
 
    return 
    end  


I had filtered only those rows in which amount is not equal to 0 that discarded those rows which contains Zero amount. Because we don’t have any control only if we make a query view, other solution would offcourse a custom class library and filtered all those rows which contains amount equal to zero

12 comments:

  1. Nowadays, most of the businesses rely on cloud based CRM tool to power their business process. They want to access the business from anywhere and anytime. In such scenarios, salesforce CRM will ensure massive advantage to the business owners. Salesforce Training | Salesforce Training in Chennai|Cloud computing course in Chennai

    ReplyDelete
  2. I as well as an aspiring blog writer, but I’m still new to the whole thing. Do you have any recommendations for newbie blog writers? I’d appreciate it.
    occupational health and safety course in chennai

    ReplyDelete
  3. Amazing article. Your blog helped me to improve myself in many ways thanks for sharing this kind of wonderful informative blogs in live.

    dot net training in chennai | dot net training institute in chennai | dot net course in chennai | .NET Training Center in Chennai | Best .NET Course in Chennai with placements

    ReplyDelete
  4. Hey, would you mind if I share your blog with my twitter group? There’s a lot of folks that I think would enjoy your content. Please let me know. Thank you.
    Java Training in Chennai | J2EE Training in Chennai | Advanced Java Training in Chennai | Core Java Training in Chennai | Java Training institute in Chennai

    ReplyDelete
  5. Appreciating the persistence you put into your blog and detailed information you provide.

    Selenium Training in chennai | selenium

    ReplyDelete
  6. I wish to show thanks to you just for bailing me out of this particular trouble.As a result of checking through the net and meeting techniques that were not productive, I thought my life was done.
    Best PHP Training Institute in Chennai|PHP Course in chennai

    Best .Net Training Institute in Chennai
    Matlab Training in Chennai

    Embedded Training in Chennai

    SAS Training in Chennai

    ReplyDelete
  7. Nice and good article. It is very useful for me to learn and understand easily. oracle training in chennai

    ReplyDelete
  8. Infycle Technologies, one of the best software training institutes in Chennai offers excellent Oracle PLSQL training in Chennai for freshers and students, and Tech Professionals of any field. Other demanding courses such as Java, Hadoop, Selenium, Big Data, Android, and iOS Development will also be trained with complete hands-on training. After the completion of training, the students will be sent for placement interviews in the core MNC's. Dial 7504633633 to get more info and a free demo.Excellent Oracle PLSQL Training Chennai | Infycle Technologies

    ReplyDelete
  9. Infycle Technologies, the No.1 software training institute in Chennai offers the No.1 Selenium course in Chennai for tech professionals, freshers, and students at the best offers. In addition to the Selenium, other in-demand courses such as Python, Big Data, Oracle, Java, Python, Power BI, Digital Marketing, Cyber Security also will be trained with hands-on practical classes. After the completion of training, the trainees will be sent for placement interviews in the top companies. Call 7504633633 to get more info and a free demo.

    ReplyDelete