Pmt SM Operation Script

Any issue about Cyclos 4 scripting and Webservices

Moderators: hugo, alexandre, rmvanarkel

Post Reply
onyekachi
Posts: 42
Joined: Mon Feb 04, 2013 12:47 pm

Pmt SM Operation Script

Post by onyekachi »

I am not sure this is right section to discus Cyclos code extension since this forum is mainly for Community instead of Cyclos Pro. Please redirect me for next time if I am in the wrong forum

Let's assume we are receiving all my properties , name, amount vehicleid from the SMS. Also, assume that vehicleid is an internal name for a payment field defined in the account.

What do you see wrong with the code why, I am getting an error that says "Invalid input: Vehicle Id is required"

source code.png
source code.png (114.88 KiB) Viewed 2785 times
Last edited by onyekachi on Thu Oct 16, 2014 9:17 pm, edited 1 time in total.

luis
Posts: 182
Joined: Fri Feb 17, 2006 11:01 am

Re: Pmt SM Operation Script

Post by luis »

Hi. We've moved this topic to a new forum area, for scripting and web services.
Actually Cyclos 4.3 will allow doing exactly what you are doing: passing the internal name instead of the id in VO references.
In 4.2, you need instead to use the entityManagerHandler to find the field by internal name first, then create a VO with its id.
Something like:

Code: Select all

import org.cyclos.entities.banking.TransactionCustomField
...
def vehicleId = entityManagerHandler.find(TransactionCustomField, 'vehicleId')
...
customvaluedto.field = new CustomFieldVO(vehicleId.id);
Should do the trick.
Luis Fernando Planella Gonzalez
Cyclos development team

onyekachi
Posts: 42
Joined: Mon Feb 04, 2013 12:47 pm

Re: Pmt SM Operation Script

Post by onyekachi »

Yes, It did do the trick

Post Reply