Create a record in an object from another object, also using

Posted by Wim on 31-Jan-2016 01:46

Guys,

Trying to run next code:

// We also create a tyrehistory record

 var v_arrh = [];

 v_arrh['name']       = v_recordId;   // the recordId of the created tyre1 will be used in the 'name' field.
 v_arrh['tyrehistoryl_firstmount']   = {!vehicletyrel_firstmount};
 v_arrh['tyrehistoryn_tyreposition']  = {!vehicletyren_tyreposition};
    v_arrh['R_tyrehistory_vehicle']   = {!R126650521.id};  // gekoppeld voertuig
    v_arrh['tyrehistorym_activity']   = '{!status#value}';  
    v_arrh['tyrehistorym_tyresize']   = '{!R_vehicletyre_tyresize#value}';
    v_arrh['tyrehistorym_supplyscope']   = '{!R_vehicletyre_supplyscope#value}';
 v_arrh['tyrehistorym_description']   = '{!R_vehicletyre_supplyscope#value}';
    v_arrh['tyrehistoryn_speedometer']  = {!R126650521.vehiclen_speedometer};
    v_arrh['tyrehistorym_tyrestatus']  = '{!R_vehicletyre_tyrestatus#value}'; // tyrestatus
    v_arrh['tyrehistorym_serialnumber']  = '{!R262070.tyre1m_serialnumber}'; 
    v_arrh['tyrehistorya_tread']   = {!vehicletyrea_tread};
    //v_arrh['tyrehistoryd_date']    = {!createdAt};  //deze geven problemen indien 'ingesterd' bij createRecord 'v_arrh' waarde
 //v_arrh['tyrehistoryd_date']    = '{!createdAt#iso}'.substring(0,10);
    //v_arrh['tyrehistoryd_speedometerdate']  = '{!R126650521.vehicled_speedometerdate#iso}'; 
    // test jorrit hieronder
    //v_arrh['tyrehistoryd_date']    = {!createdAt};  //deze geven problemen indien 'ingesterd' bij createRecord 'v_arrh' waarde
 
    
    rbv_api.printArr(v_arrh);      

    //var v_recordIdh =
    rbv_api.createRecord("tyrehistory", v_arrh);

The creation of the record works only if we leave out the 'tyrehistoryd_date' and 'tyrehistoryd_speedometerdate'

However this is required for correct operations in the application as you can imaging.

Now it must be something like a format in with we have to assign to the values,

Question: wat should we use as format; as you see we use: '{!createdAt#iso}'; but that does not work.

Please help

Thanks in advance,

BTW, IramK if you also follow this post, i admire your sharp questions, looks you'r doing a creat job improving the Rollbase product!

Posted by Wim on 01-Feb-2016 06:28

Hello Pradeep,
 
It works fine now, i tested in using the trigger!!!
 
Thanks again !!
 
Wim Hassink
Van: Wim Hassink ll CTA Consulting B.V.
Verzonden: maandag 1 februari 2016 13:17
Aan: 'TU.Rollbase@community.progress.com' <TU.Rollbase@community.progress.com>
Onderwerp: RE: [Technical Users - Rollbase] Create a record in an object from another object, also using date fields does not work as aspected
 
Hello Pradeep,
 
Thanks for your information, i tested it quickly through the debugger and there is no error.
It takes some more time for me to test it in the script and trigger environment, sop lease let me come back to you with that result.
Thanks,
Wim Hassink
 
Van: Pradeep Kagithalagudem [mailto:bounce-pkagitha@community.progress.com]
Verzonden: maandag 1 februari 2016 11:54
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Create a record in an object from another object, also using date fields does not work as aspected
 
Update from Progress Community
Afbeelding verwijderd door afzender.
 

Create record should also work. i think you are setting string to a date field instead use javascript date like below

v_arrh['tyrehistoryd_date']    = new Date('{!createdAt}');

Thanks and Regards

Pradeep

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Afbeelding verwijderd door afzender.
 

All Replies

Posted by Pradeep Kagithalagudem on 31-Jan-2016 23:59

Hi,

Can you try using conversion map with create record trigger.

Thanks and Regards

Pradeep

Posted by Wim on 01-Feb-2016 03:12

Hello Pradeep,
Is the way that we use rollbase (create record, with array variables) the wrong way to work.
(We were tought to do so from people in Holland that work with rollbase even before it was owned by Progress)
Is ask that because we use this function a lot, without using dates as part of that array of variables because that does not work properly – or do we use the wrong format for that date, as part of the array
Can you confirm this?
 
Regards, Wim Hassink
 
Van: Pradeep Kagithalagudem [mailto:bounce-pkagitha@community.progress.com]
Verzonden: maandag 1 februari 2016 07:01
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Create a record in an object from another object, also using date fields does not work as aspected
 
Update from Progress Community
 

Hi,

Can you try using conversion map with create record trigger.

Thanks and Regards

Pradeep

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

 

Posted by Pradeep Kagithalagudem on 01-Feb-2016 04:51

Create record should also work. i think you are setting string to a date field instead use javascript date like below

v_arrh['tyrehistoryd_date']    = new Date('{!createdAt}');

Thanks and Regards

Pradeep

Posted by Wim on 01-Feb-2016 06:18

Hello Pradeep,
 
Thanks for your information, i tested it quickly through the debugger and there is no error.
It takes some more time for me to test it in the script and trigger environment, sop lease let me come back to you with that result.
Thanks,
Wim Hassink
 
Van: Pradeep Kagithalagudem [mailto:bounce-pkagitha@community.progress.com]
Verzonden: maandag 1 februari 2016 11:54
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Create a record in an object from another object, also using date fields does not work as aspected
 
Update from Progress Community
Afbeelding verwijderd door afzender.
 

Create record should also work. i think you are setting string to a date field instead use javascript date like below

v_arrh['tyrehistoryd_date']    = new Date('{!createdAt}');

Thanks and Regards

Pradeep

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Afbeelding verwijderd door afzender.
 

Posted by Wim on 01-Feb-2016 06:28

Hello Pradeep,
 
It works fine now, i tested in using the trigger!!!
 
Thanks again !!
 
Wim Hassink
Van: Wim Hassink ll CTA Consulting B.V.
Verzonden: maandag 1 februari 2016 13:17
Aan: 'TU.Rollbase@community.progress.com' <TU.Rollbase@community.progress.com>
Onderwerp: RE: [Technical Users - Rollbase] Create a record in an object from another object, also using date fields does not work as aspected
 
Hello Pradeep,
 
Thanks for your information, i tested it quickly through the debugger and there is no error.
It takes some more time for me to test it in the script and trigger environment, sop lease let me come back to you with that result.
Thanks,
Wim Hassink
 
Van: Pradeep Kagithalagudem [mailto:bounce-pkagitha@community.progress.com]
Verzonden: maandag 1 februari 2016 11:54
Aan: TU.Rollbase@community.progress.com
Onderwerp: RE: [Technical Users - Rollbase] Create a record in an object from another object, also using date fields does not work as aspected
 
Update from Progress Community
Afbeelding verwijderd door afzender.
 

Create record should also work. i think you are setting string to a date field instead use javascript date like below

v_arrh['tyrehistoryd_date']    = new Date('{!createdAt}');

Thanks and Regards

Pradeep

View online

 

You received this notification because you subscribed to the forum.  To unsubscribe from only this thread, go here.

Flag this post as spam/abuse.

Afbeelding verwijderd door afzender.
 

This thread is closed