GeeKs Blogging @ dotCOM

Let's share…
  • Home
  • About
  • Contribute
  • How To – FAQs
  • Disclaimer
  • Terms & Conditions
11 May 2009

Siebel – Looping multiple records – Update records

by Nitin Jain


Hi,

We often come across a requirement where we need to loop through multiple records satisfying a certain search spec on a particular BC.

Let’s assume a simple search spec, for eg. to update the Status of all Sales Orders to Submitted which have their Account as “Nitin Test Account”.

One easy way to do it through Siebel scripts is maybe a pseudocode as follows:

var bo_Order = TheApplication().GetBusObject ( “Order Entry (Sales)” );
var bc_Order = bo_Order.GetBusComp ( “Order Entry – Orders” );

with (bc_Order)
{
ClearToQuery();
SetViewMode(AllView);
ActivateField ( “Status” );
SetSearchSpec ( “Account”, “Nitin Test Account” );
ExecuteQuery ( ForwardOnly );

var IsRecord = FirstRecord();

while (IsRecord)
{
SetFieldValue ( “Status”, “Submitted” );
IsRecord = NextRecord();
}
}
return (CancelOperation);

Or, a more elegant approach which I personally prefer for the above solution, use a workflow. Use the step Siebel Operation.
The Siebel Operation, Update operation, will automatically update all the records satisfying that particular Search Spec fed in as Input.

One line solution to nearly 10-15 lines of script!

Tags: eScript, problems, Scriptless solutions, Siebel



For regular updates, enter your email address below. We don't spam, we don't share with others!




This entry was posted on Monday, May 11th, 2009 at 7:26 PM and is filed under Siebel CRM. You can follow any responses to this entry through the RSS 2.0 feed. You can leave a response, or trackback from your own site.

8 Responses to “Siebel – Looping multiple records – Update records”

  1. ursvisnu says:
    May 11, 2009 at 7:57 PM

    Thank you
    but it updates allways even when a new record is created.
    And
    my query where we need to write the script and in which event

  2. Nitin Jain says:
    May 12, 2009 at 12:29 AM

    Hi Vishnu

    How will it update for a new record? I ran an ExecuteQuery().

    This script would most probably be written in a custom Business Service.

  3. GeeKs Blogging @ dotCOM - Siebel - Looping multiple records - Query and Process says:
    May 12, 2009 at 10:42 AM

    [...] In my last post, I discussed as to how we can query and update multiple records in Siebel Database. You can find it in the link below: Siebel – Looping multiple records – Update. [...]

  4. Bob says:
    June 3, 2009 at 3:44 PM

    By the way your script is wrong …

  5. Nitin Jain says:
    June 3, 2009 at 7:02 PM

    Hi,

    Thanks for the updates. I just updated the TheApplication() to bo_Order. Anything else that you can see amiss here?

    This was just intended as a pseudocode / sample script and has not been run practically. Please do point out in case you feel it can be improved.

  6. Bob says:
    June 4, 2009 at 12:36 PM

    As “Account” in only use in a query you don’t need to Activate it.
    ExecuteQuery would be fine with a ForwardOnly .

  7. Nitin Jain says:
    June 4, 2009 at 1:17 PM

    Hi Bob,

    I agree. I have made ur suggested changes to the sample script above. Even if we activate account before query, it would work without issues. In any case, following the best coding practices, I have removed it. Cheers.. :-)

  8. Madhvi says:
    April 27, 2010 at 9:05 AM

    Hi,
    I was using wokflow to update multiple records uing Siebel Operation Step.But to my surprise, it threw error “Error updating business component at step ‘Siebel Operation 1′.(SBL-BPR-00187)
    –
    This error is returned when the workflow/task is executing the Siebel Operation business service.(SBL-BPR-00100)
    –
    No Primary Row found in ‘Channel Partner’ for Siebel Operation.(SBL-BPR-00101)”
    I also tried using Query Step and then update.Then also, it threw error.
    I am not sure if it works on Primary BC.
    I think it works if we first query on Primary BC and then update the records of child BC.

Leave a Reply

Click here to cancel reply.

You must be logged in to post a comment.


« Siebel – Deploying SRF without Server/OM Re-start!!!!
Siebel – Looping multiple records – Query and Process »



  • Admin Controls

    • Log in
  • Talk to us

    • Bouquets, brickbats, suggestions, complaints?

    • Click here...
  • Authorships

    • We are currently looking out for active authors. Are you willing to contribute?

    • Please click here

    • Everyone's invited..
  • Subscribe by Email


    • For regular updates, enter your email address below. We don't spam, we don't share with others!

  • Sponsors

  • Subscribe

    • Entries (RSS)
    • Comments (RSS)
  • Siebel Bookshelf

  • Daily Dilbert

    •          
  • Categories

    • Admin Notifications (9)
    • Business Intelligence (2)
      • Actuate (2)
    • CRM (118)
      • CRM News (6)
      • Sage Software / ACT! (1)
      • Salesforce.com (2)
      • Siebel CRM (106)
    • EAI (2)
    • Events (1)
    • FUN 'n' FROLIC (6)
    • Hot Technologies (7)
    • IT News (47)
    • Meet the Author (9)
    • ORACLE (15)
      • Database (2)
      • Oracle Fusion Applications Stack (8)
      • Oracle Policy Automation (1)
    • Product Demostrations (5)
    • Uncategorized (4)
  • Tag Cloud

    Admin Admin Notifications Applet Author Introductions Business Component Calculated Function Certification CFG file Client Configuration Critique CRM Database Debugging EAI EIM eScript Fundamentals Fusion Middleware Google IT News License Login Microsoft ORACLE Oracle Fusion Applications Performance problems Product Defect Product Demostrations Salesforce Scriptless solutions Security Server Siebel Siebel Secrets SOA Tips Tools Tricks Tutorials Upgrade User Property Workarounds workflows



  • Archives

    • May 2013
    • February 2013
    • January 2013
    • August 2012
    • August 2011
    • July 2011
    • June 2011
    • May 2011
    • April 2011
    • November 2010
    • August 2010
    • May 2010
    • April 2010
    • March 2010
    • February 2010
    • January 2010
    • December 2009
    • November 2009
    • October 2009
    • September 2009
    • August 2009
    • July 2009
    • June 2009
    • May 2009
    • April 2009
    • March 2009
  • Authors

    • Ankit Bhardwaj
    • Ashish Kaul
    • brijesh
    • Himanshu Bajpai
    • Madhvi Arora
    • nanpats
    • Nitin Jain
    • Prachi Sharma
    • Renuka Ankam
    • Vikas Luthra
  • Administrators

    • geeksblogging@gmail.com
    • admin@geeksbloggingat.com

Fresh Ideas

  • How long do you think Siebel CRM will be around ?
  • Still confused about the Oracle roadmap for Siebel CRM ?
  • Oracle VM 3.2 Now Available
  • Oracle Policy Modelling (OPM) - Unable to compile Excel documents
  • Login Failed in Dedicated Web Client : MVF Issue
  • Oracle Fusion Applications price list
  • Research to Development - Fusion Apps Series
  • Oracle ACE Program
  • HCM user Experience through UI - Fusion Apps series
  • "Managing Oracle Fusion Applications"

Just Said

  • Abhay on Siebel – SIA BC Utility Service – Loop multiple records
  • SriRam Sudarsan on Siebel – Installer hangs midway
  • Joey on Oracle Policy Modelling (OPM) – Unable to compile Excel documents
  • chandra on Siebel – Unable to login to mobile client
  • Varun P M on Siebel – Installer hangs midway
  • Mat on Siebel – EAI Siebel Adapter – Looping Multiple Records
  • Nitin Jain on Siebel – EAI Siebel Adapter – Looping Multiple Records
  • Nitin Jain on Siebel – EAI Siebel Adapter – Looping Multiple Records
  • Mat on Siebel – EAI Siebel Adapter – Looping Multiple Records
  • Sheldon on Siebel – EAI JMS Transport

Most Commented

  • Siebel - SIA BC Utility Service - Loop multiple records
  • Siebel - Installer hangs midway
  • Siebel - Adding License Keys to Sample
  • Siebel - Reading data directly from Siebel SRF
  • Siebel - Popup Update Only
  • Siebel - Automatic User Logout
  • Siebel - EAI Queue - Usage
  • Siebel - Looping multiple records - Update records
  • Siebel - SIS OM PMT Service
  • Siebel Tools hangs when checking out objects

Old Favourites

  • Highrise Customer Relationship Management
  • Siebel - Autosave Opportunity data - Sample Code
  • Siebel - Autosave Opportunity data - The concept
  • Renuka Ankam
  • Siebel - Merge Records - Checklist
  • Siebel - Fetch Active view properties - III
  • Oracle 11g Certification coming soon
  • Siebel - Fetch Active view properties - II
  • Siebel - Fetch Active view properties
  • Siebel - Automating Merge Records by script - II

If you also want to write on GeeksBlogging@dotCOM, click here. Area of Specialization no constraint. Become Famous!


Entries (RSS) and Comments (RSS).