Question Status

Verified
IRodman asked a question on 9 Jul 2013 10:05 AM

Hello all,

I have a Display method that I wrote so my SalesCustItemStatistics Report would display the IventoryLocation field. That report uses datas from the CustTable amongs others and the field I'm calling from that Display Method comes from the CustTable. Here is the method:

Display InventLocationId Depot()
{
SELECT InventLocation FROM CustTable;
Return CustTable.InventLocation;
}

It seems good, there is no error message yet when I run the report, my field is completly empty except for the Label saying "Depot" (I chose that as a label, it means warehouse in french). I don't understand what is going on, I even tried without the Method, simply choosing the table CustTable and the Field InventLocation, it was just supposed to call the datat from there since there is a datasource of CustTable in that report but yet again it was completly empty.

Can someone explain to me what is going on? And help me to find a solution?

Thank you.

Reply
Andrew Xu responded on 9 Jul 2013 11:26 AM

Hi Irodman,

I didn't see you declare CustTable, so I assume you did that in other methods.

This display method always returns the inventlocation of the first selected custTable, and I'm guessing that custTable doesn't have inventlocation assigned.

If the custTable is initialized in other methods, you just need to return custTable.InventLocation.

Reply
IRodman responded on 10 Jul 2013 8:22 AM

Hi Andrew,

I didn't declare it because The system tells me that the CustTable is already declared somewhere. I supposed that it's declared because it is used in the Datasource and the reports takes most of the data from there. But despite the fact that everything looks alright it seems doesn't appear.

Reply
Andrew Xu responded on 10 Jul 2013 8:27 AM

can you just return a hardcoded string value in that method to see if this is caused by the report or your code logic?

Reply
IRodman responded on 10 Jul 2013 9:02 AM

There is the CustInventJour Table that is used on that report aswell, that table has an InventLocationId fiel but when I check in the table, that Invent Location is empty. Maybe my report goes there to pick the information despite the fact that I specified that I wanted the my method to take the informations from CustTable. Either way I would like to know what I can do to have my report display the informations from CustTable. My method looks allright I don't understand why it isn't working.

Reply
Dick Wenning responded on 10 Jul 2013 10:42 AM

I think it compiles because the CustTable is part of the datasources.

do you use a fecthmethod?

i

Kind regards, 

Kaya Solutions

Dick Wenning

+31 6 147 989 53 

Landjuweel 5

3905 PE - Veenendaal

 

OTHER CONTACT INFORMATION

Reply
Verified Answer
Kent Carstens responded on 10 Jul 2013 11:59 AM

display InventLocationId depot()

{;

   return CustTable::find(orderAccount).InventLocation;

}

Reply
IRodman responded on 11 Jul 2013 2:05 AM

Thank you all guys for your help. I tried Kent's method and it worked. I would like to know what was wrong with mine though?

Kent can you tell ma in what way your method succeed where mine failed, so I'd able next time to solve a similar issue if I ever encounter one again?

Regards.

Reply
IRodman responded on 11 Jul 2013 3:01 AM

Beside, it only showes the location for some Customers, but for many of them it doesn't despite the fact that there is a locationId for them too, I don't understand why.

Reply
Verified Answer
Kent Carstens responded on 10 Jul 2013 11:59 AM

display InventLocationId depot()

{;

   return CustTable::find(orderAccount).InventLocation;

}

Reply