Announcements
No record found.
Hi Team,
I have a customised class in which I want to call a standard class method example
the class is WhsUnshipLoadLine and the method is unship().
now this method takes formdatasoucre as parameter but since I am using it in custom class and this method is not being called from a form, I want to somehow pass recid as argument in this parameter when calling this method in my class. Is it possible to convert a recid value to formdatasource format and then passing it in the method parameter? Please help.
My F&O doesn't contain any class called WhsUnshipLoadLine, just a form and an a menu item. Is it the right name? If so, isn't it a custom class?
But in short, it doesn't sound like a good method for your purpose.
Thanks for responding Martin,
My bad the class name is whsUnshipLoadLineForm and the method inside thhis class is unship.
What RecId do you have? If it's a RecId of WHSTmpLoadLineInventory table, it's useless without a reference to a temporary data set. WHSTmpLoadLineInventory is a temporary table is has no data in database at all.
Regarding the method, you can see thayt it isn't good for your purpose, because it requires a form data source, while you don't have any. And you can't create a form data source without a form.
I would look into unship() method and borrow the logic I need. You'll see that most work is done by WHSUnShip class.
Note that other parts of the method are not relevent in your case. For example, the logic getting records selected in a grid makes no sense when you don't have a form. Also, there is no point in running a while select against multiple records if you have just a single one (I'm not sure by that, it's just an assumption).
Thank you Martin,
Actually I am creating a OData action method in which I want to call this method and automatically perform the unship method functionality. Shoul I write a replicate of that method in my custom class to perform that functionality without automatically without form interaction.
Please help.
Any suggestions please help
Please see my suggestion above. If you don't like it, please explain what problem you have with it.
Repearing "Any suggestions please help" is useless, because it provides no information on the topic.
Example-
Actually my scenario is… I have created a custom table XYZWhsUnshipLoadLineTable and a custom data entity ‘XYZWhsUnshipLoadLineEntity’ for this table. A third party is filling the data in this custom table through OData and now we need to create a OData action on this entity so that they can call this action method and through that method the we could perform the unshipping of quantity automatically.
It’s like once they have filled the data into the table we have to call the whsunshiploadlineform.unship() method and reduce the quantity for the laod lines which they have sent into the table.
Now my question is -
1. Since the method takes formdatasource as the argument then I will I have to write my own logic similar to whsunship class to reduce the quantity right?
2. Can I create multiple methods inside my entity class to perform this activity.
Please see screenshot below
1. I already addressed this above. Yes, you need a custom method, but you shouldn't implement something similat to WhsUnship class. You should use this class in your method.
2. Yes, both entities and classes can have more than one method.
Under review
Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.
Congratulations to our 2026 Super Stars!
Thanks to all of our 2025 Community Spotlight stars!
These are the community rock stars!
Stay up to date on forum activity by subscribing.
André Arnaud de Cal... 577 Super User 2026 Season 1
Giorgio Bonacorsi 309
Diego Mancassola 259