Menu

Searching for a particular item from a different class

2014-03-26
2014-03-26
  • jitsobullet

    jitsobullet - 2014-03-26

    Hi,

    I was wondering if someone could please help me find a suitable way to search another class for a value, where the object is similar to one preselected.

    I have read the forum and have found the following lines of code:

    ~~~~
    $sOQL = "SELECT CustomerContract";
    $oSet = new DBObjectSet(DBObjectSearch::FromOQL($sOQL));
    $oSet->OptimizeColumnLoad(array('name'));
    while($oPerson = $oSet->Fetch())
    {
    $sMac = $oPerson->Get('name');
    }

    ~~~~~~~~~~~~~~~~~

    But unfortunately this provides an error associated with no Class found:

    Error: Unknown class '', expected a value in{

    Any Ideas?

    Thanks in advance

     
  • Pankaj khurana

    Pankaj khurana - 2014-03-26

    Hello jitsobullet ,

    Can you clear me more about your question....
    Thanks and Regards

     
  • jitsobullet

    jitsobullet - 2014-03-26

    Hi Pankaj,

    Its actually similar to your issue - https://sourceforge.net/p/itop/discussion/922360/thread/9eab1cf5/?limit=25#dda0

    The only difference is im trying to implement this inside of the class. Ideally i would like this to be scripted in Ajax.

    I have an Enum list under Customer Contracts called 'Invoice unit' where the list is the same as items under table 'Invoice unit' In this table, the invoice unit has an associated rate per Invoice unit. Inside customer contracts, there is also another string field for quantity.

    What i am looking for is when user types in Quantity i.e. 5, the system will look at the Invoice Unit, find the same title under Invoice unit table and then use this value to multiply by the quantity to find the final rate.
    Each customer has a different rate.

    Are you able to help please?

     

Log in to post a comment.

Want the latest updates on software, tech news, and AI?
Get latest updates about software, tech news, and AI from SourceForge directly in your inbox once a month.